# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274953994 -10800 # Node ID 7d93ee07fb27d58bf1d1c47c113258dcd333d2bc # Parent b9e04db066d4b8ac36a0ce05affeb1a38a85878e Revision: 201019 Kit: 2010121 diff -r b9e04db066d4 -r 7d93ee07fb27 inc/mpxvideo_debug.h --- a/inc/mpxvideo_debug.h Fri May 14 15:53:50 2010 +0300 +++ b/inc/mpxvideo_debug.h Thu May 27 12:53:14 2010 +0300 @@ -41,7 +41,7 @@ #ifdef _MPX_FILE_LOGGING_ #define FU_DEBUG MPXDebug::FileLog #else - #define FU_DEBUG MPXDebug::NullLog + #define FU_DEBUG #endif #endif @@ -49,15 +49,6 @@ class MPXDebug { public: - inline static void NullLog( TRefByValue /*aFmt*/, ... ) - { - } - - inline static void NullLog( TRefByValue /*aFunctionName*/, - TRefByValue /*aFmt*/, ... ) - { - } - inline static void FileLog( TRefByValue aFmt, ... ) { VA_LIST list; @@ -77,8 +68,8 @@ #define MPX_DEBUG TFusionLog::FusionLog #define MPX_ENTER_EXIT TEnterExitLog _s #else - #define MPX_DEBUG MPXDebug::NullLog - #define MPX_ENTER_EXIT MPXDebug::NullLog + #define MPX_DEBUG + #define MPX_ENTER_EXIT #endif @@ -160,8 +151,13 @@ 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); +#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__ diff -r b9e04db066d4 -r 7d93ee07fb27 inc/videoservices.h --- a/inc/videoservices.h Fri May 14 15:53:50 2010 +0300 +++ b/inc/videoservices.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#3 % +// Version : %version: 5 % #ifndef __VIDEOSERVICES_H__ #define __VIDEOSERVICES_H__ @@ -164,21 +164,61 @@ VideoServiceUriFetch* mServiceUriFetch; /** + * Deprecated VideoServiceUriFetch service instance. + */ + VideoServiceUriFetch* mServiceUriFetchDeprecatedNewService; + + /** + * Deprecated VideoServiceUriFetch service instance. + */ + VideoServiceUriFetch* mServiceUriFetchDeprecatedOldService; + + /** * VideoServicePlay service instance. */ VideoServicePlay* mServicePlay; /** + * VideoServicePlay service instance. + */ + VideoServicePlay* mServicePlayDeprecatedNewService; + + /** + * VideoServicePlay service instance. + */ + VideoServicePlay* mServicePlayDeprecatedOldService; + + /** * VideoServiceView service instance. */ VideoServiceView* mServiceView; /** + * VideoServiceView service instance. + */ + VideoServiceView* mServiceViewDeprecatedNewService; + + /** + * VideoServiceView service instance. + */ + VideoServiceView* mServiceViewDeprecatedOldService; + + /** * VideoServiceBrowse service instance. */ VideoServiceBrowse *mServiceBrowse; /** + * Deprecated VideoServiceBrowse service instance. + */ + VideoServiceBrowse *mServiceBrowseDeprecatedNewService; + + /** + * Deprecated VideoServiceBrowse service instance. + */ + VideoServiceBrowse *mServiceBrowseDeprecatedOldService; + + /** * Pointer of QVideoPlayerEngine. */ QVideoPlayerEngine* mEngine; diff -r b9e04db066d4 -r 7d93ee07fb27 mediasettings/mediasettingsengine/group/MPSettROPModel.mmp --- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Fri May 14 15:53:50 2010 +0300 +++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Thu May 27 12:53:14 2010 +0300 @@ -16,10 +16,11 @@ -// Version : %version: 5 % +// Version : %version: 6 % +#include #include TARGET mpsettropmodel.dll CAPABILITY CAP_ECOM_PLUGIN @@ -41,7 +42,7 @@ START RESOURCE MPSettingsROPModel.rss HEADER TARGET mpsettingsropmodel.rsc -TARGETPATH resource +TARGETPATH RESOURCE_FILES_DIR END USERINCLUDE . diff -r b9e04db066d4 -r 7d93ee07fb27 mediasettings/mediasettingsengine/rom/mpsettropmodel.iby --- a/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby Fri May 14 15:53:50 2010 +0300 +++ b/mediasettings/mediasettingsengine/rom/mpsettropmodel.iby Thu May 27 12:53:14 2010 +0300 @@ -21,8 +21,6 @@ #include -ECOM_PLUGIN( mpsettropmodel.dll, 101f857b.rsc ) - -data=DATAZ_\resource\MPSettingsROPModel.rsc resource\MPSettingsROPModel.rsc +ECOM_PLUGIN( mpsettropmodel.dll, mpsettropmodel.rsc ) #endif // MPSETTROPMODEL_IBY \ No newline at end of file diff -r b9e04db066d4 -r 7d93ee07fb27 mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby --- a/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby Fri May 14 15:53:50 2010 +0300 +++ b/mediasettings/mediasettingsengine/rom/mpsettropmodelrsc.iby Thu May 27 12:53:14 2010 +0300 @@ -22,7 +22,7 @@ #include -data=DATAZ_\APP_RESOURCE_DIR\MPSettingsROPModel.rsc APP_RESOURCE_DIR\MPSettingsROPModel.rsc +data=DATAZ_\RESOURCE_FILES_DIR\mpsettingsropmodel.rsc RESOURCE_FILES_DIR\mpsettingsropmodel.rsc #endif // MPSETTROPMODELRSC_IBY \ No newline at end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/inc/videocollectiontrace.h --- a/videocollection/inc/videocollectiontrace.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/inc/videocollectiontrace.h Thu May 27 12:53:14 2010 +0300 @@ -29,11 +29,11 @@ #define DISABLE_TRACE 0 /** - * 0 = Tracing into RDebug in all builds. - * 1 = Tracing into RDebug in winscw, file in ARM. (Default) + * 0 = Tracing into RDebug in all builds. (Default) + * 1 = Tracing into RDebug in winscw, file in ARM. * 2 = Tracing into file in all builds. */ -#define TRACE_OUTPUT 1 +#define TRACE_OUTPUT 0 //----------------------------------------------------------------------------- // Trace configuration diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Thu May 27 12:53:14 2010 +0300 @@ -180,6 +180,18 @@ * @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: @@ -340,6 +352,13 @@ */ RArray iMdsOpResultsUint32; + /** + * When videos are removed or added from cache, the indexes of the + * changed albums are stored here. Reason is to calculate new attributes + * only once per changed album. + */ + RArray iChangedAlbums; + }; #endif // VCXMYVIDEOSALBUMS_H diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Thu May 27 12:53:14 2010 +0300 @@ -359,8 +359,13 @@ * Called from RunL when albums remove completes. */ void HandleRemoveAlbumsCompletedL(); + + /** + * Registers observing to MDS session. + */ + void SetObservingL(); - public: + protected: /** * From MMdEQueryObserver. @@ -396,14 +401,12 @@ TObserverNotificationType aType, const RArray& aRelationArray); -#if 0 //not used /** * From MMdERelationObserver */ void HandleRelationNotification(CMdESession& aSession, TObserverNotificationType aType, const RArray& aRelationIdArray); -#endif private: diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Thu May 27 12:53:14 2010 +0300 @@ -294,8 +294,8 @@ // void CVcxMyVideosAlbum::CalculateAttributesL( TInt aStartIndex ) { + TInt videoCount = 0; TUint32 count = iVideoList.Count(); - iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, count ); TInt newCount = 0; CMPXMedia* video; CMPXMedia* latestNewVideo = NULL; @@ -308,6 +308,7 @@ video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos ); if ( video ) { + videoCount++; flags = TVcxMyVideosCollectionUtil::FlagsL( *video ); if ( flags & EVcxMyVideosVideoNew ) { @@ -321,7 +322,7 @@ } } } - iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, count ); + iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, videoCount ); iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, newCount ); if ( latestNewVideo ) { diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Thu May 27 12:53:14 2010 +0300 @@ -49,6 +49,7 @@ void CVcxMyVideosAlbums::ConstructL() { iAlbums.Reset(); + iChangedAlbums.Reset(); } // --------------------------------------------------------------------------- @@ -81,6 +82,7 @@ iMdsOpResults.Close(); iMdsOpResultsUint32.Close(); iRemoveFromAlbumVideos.Close(); + iChangedAlbums.Close(); } // ---------------------------------------------------------------------------- @@ -766,4 +768,39 @@ 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 diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Thu May 27 12:53:14 2010 +0300 @@ -49,8 +49,6 @@ CVcxMyVideosAsyncFileOperations* CVcxMyVideosAsyncFileOperations::NewL( CVcxMyVideosCollectionPlugin& aCollection ) { - MPX_FUNC("CVcxMyVideosAsyncFileOperations::NewL"); - CVcxMyVideosAsyncFileOperations* self = new (ELeave) CVcxMyVideosAsyncFileOperations( aCollection ); CleanupStack::PushL(self); @@ -65,8 +63,6 @@ // CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations() { - MPX_FUNC("CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations"); - iOperationIdArray.Close(); iOperationResult.Close(); delete iFileCopier; @@ -78,11 +74,9 @@ // Constructor. // ---------------------------------------------------------------------------- // -CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( - CVcxMyVideosCollectionPlugin& aCollection ) +CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( CVcxMyVideosCollectionPlugin& aCollection ) : iCollection( aCollection ) { - MPX_FUNC("CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations"); } // ---------------------------------------------------------------------------- @@ -579,17 +573,11 @@ MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: Copy succeeded"); if ( iIsMoveOperation ) { - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: move case"); + 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 ); - 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 ); - } } } } @@ -598,15 +586,21 @@ MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: CopyFile failed: %d", aErr); } - // roll mds and cache back if file operations failed + // roll everything back if file operations failed if ( aErr != KErrNone ) { if ( iIsMoveOperation ) { - MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move failed %d", aErr ); - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back and leaving." ); + MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move operation failed %d", aErr ); + 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 { diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Thu May 27 12:53:14 2010 +0300 @@ -541,6 +541,8 @@ CleanupStack::PopAndDestroy( &nonVideoIds ); + iAlbums->UpdateChangedAlbumsL(); + iMessageList->SendL(); } diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Thu May 27 12:53:14 2010 +0300 @@ -50,27 +50,8 @@ void CVcxMyVideosMdsAlbums::ConstructL() { GetSchemaDefinitionsL(); - CActiveScheduler::Add( this ); - - 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 - } - - //TODO: do we need this? - //iMdsDb.MdsSessionL().AddRelationPresentObserverL(); + SetObservingL(); + CActiveScheduler::Add( this ); } // --------------------------------------------------------------------------- @@ -160,6 +141,30 @@ } // --------------------------------------------------------------------------- +// 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 // --------------------------------------------------------------------------- // diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Thu May 27 12:53:14 2010 +0300 @@ -233,6 +233,7 @@ if ( iAlbums ) { iAlbums->GetSchemaDefinitionsL(); + iAlbums->SetObservingL(); } } else diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Thu May 27 12:53:14 2010 +0300 @@ -219,6 +219,8 @@ { MPX_DEBUG1("CVcxMyVideosOpenHandler:: KVcxMvcCategoryIdAll: calling HandleOpen(iCache.iVideoList)"); iCache.iVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + iCache.iVideoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); iCollection.iObs->HandleOpen( iCache.iVideoList, KErrNone ); } else @@ -227,6 +229,8 @@ CMPXMedia* videoList = iCache.CreateVideoListByOriginL( origin ); MPX_DEBUG1("CVcxMyVideosOpenHandler:: calling HandleOpen(new list)"); videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + iCache.iVideoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); iCollection.iObs->HandleOpen( videoList, KErrNone ); delete videoList; } @@ -403,6 +407,8 @@ //videolist complete CMPXMedia* videoList = album->CreateVideoListL(); videoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + videoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); iCollection.iObs->HandleOpen( videoList, KErrNone ); delete videoList; iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete ); @@ -500,6 +506,11 @@ MPX_DEBUG2("CVcxMyVideosOpenHandler:: First videos for album %d arrived, calling HandleOpen()", aAlbumId); iAlbumVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath ); + if ( aComplete ) + { + iAlbumVideoList->SetTObjectValueL( KVcxMediaMyVideosInt32Value, + EVcxMyVideosVideoListComplete ); + } iCollection.iObs->HandleOpen( iAlbumVideoList, aError ); iPendingAlbumOpenId = 0; } diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Thu May 27 12:53:14 2010 +0300 @@ -14,7 +14,7 @@ * Description: Video list cache. Contains cached data from MDS.* */ -// Version : %version: TB101_57 % +// Version : %version: TB101_58 % // INCLUDE FILES @@ -1504,6 +1504,7 @@ if ( aUpdateCategories ) { iCollection.CategoriesL().VideoAddedL( aVideo ); + iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( aVideo ); } return KErrNone; @@ -1563,6 +1564,7 @@ pos != KErrNotFound /* no need to update if item is on iPartialVideoList*/ ) { iCollection.CategoriesL().VideoRemovedL( *video ); + iCollection.AlbumsL().VideoAddedOrRemovedFromCacheL( *video ); } if ( pos != KErrNotFound ) diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/inc/hbinputdialog.h --- a/videocollection/tsrc/stubs/inc/hbinputdialog.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/inc/hbinputdialog.h Thu May 27 12:53:14 2010 +0300 @@ -20,6 +20,8 @@ #define HBINPUT_DIALOG_H #include "hbwidget.h" +#include "hbaction.h" +#include #include class HbInputDialog : public HbWidget @@ -27,20 +29,52 @@ Q_OBJECT public: - HbInputDialog(QGraphicsItem *parent= 0) : HbWidget(parent) {} - ~HbInputDialog() {} + HbInputDialog(QGraphicsItem *parent= 0); + ~HbInputDialog(); /** * Returns string in parameter text if mGetTextReturnValue is null QString. */ + /* static QString getText(const QString &label,const QString &text = QString(), - bool *ok = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0); + bool *ok = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0);*/ + + /** + * Create new HbInputDialog after call to this and call emitDialogFinished to finish the sequence. + */ + void getText(const QString &heading + ,QObject *receiver + ,const char *member + ,const QString &text=QString() + ,QGraphicsScene *scene=0 + ,QGraphicsItem *parent=0); + + void emitDialogFinished( QObject* receiver, const char* member, int actionNum ); + + void setAttribute(int attribute); - static bool mGetTextFails; + QList actions() const + { + return mActions; + } + + QVariant value(int row = 0) { Q_UNUSED(row); mValueCallCount++; return mValueReturnValue; } + +signals: + + void finished(HbAction *action); - static QString mGetTextReturnValue; +public: + + QList mActions; + static QString mLastHeading; + static QString mLastText; static int mGetTextCallCount; + static int mAttribute; + + static QVariant mValueReturnValue; + static int mValueCallCount; }; #endif //HBINPUT_DIALOG_H diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/inc/hbmessagebox.h --- a/videocollection/tsrc/stubs/inc/hbmessagebox.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/inc/hbmessagebox.h Thu May 27 12:53:14 2010 +0300 @@ -19,22 +19,49 @@ #ifndef HBMESSAGEBOX_H #define HBMESSAGEBOX_H +#include #include +#include "hbaction.h" class QGraphicsWidget; class QGraphicsScene; class QGraphicsItem; -class HbMessageBox +class HbMessageBox : public QObject { + Q_OBJECT + public: + enum MessageBoxType { + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + + HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + ~HbMessageBox(); + + /** + * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence. + */ + void open( QObject* receiver = 0, const char* member = 0 ); + + void emitDialogFinished( QObject* receiver, const char* member, int actionNum ); + + void show(); + + void setAttribute(int attribute); + /** stubbed from HbMessgeBox */ - static bool question(const QString &questionText, - const QString &primaryButtonText = QString(), - const QString &secondaryButtonText = QString(), - QGraphicsWidget *headWidget = 0, - QGraphicsScene *scene = 0, - QGraphicsItem *parent = 0); +/* static void question(const QString &questionText, + QObject *receiver, + const char *member, + const QString &primaryButtonText = tr("Yes"), + const QString &secondaryButtonText = tr("No"), + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 );*/ /** stubbed from HbMessgeBox */ static void information(const QString &informationText, @@ -47,8 +74,20 @@ QGraphicsWidget *headWidget = 0, QGraphicsScene *scene = 0, QGraphicsItem *parent = 0 ); + + QList actions() const + { + return mActions; + } + +signals: + + void finished(HbAction *action); + +public: + + QList mActions; + }; - - #endif // HBMESSAGEBOX_H diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/inc/hbmessageboxdata.h --- a/videocollection/tsrc/stubs/inc/hbmessageboxdata.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/inc/hbmessageboxdata.h Thu May 27 12:53:14 2010 +0300 @@ -28,6 +28,10 @@ mLatestTxt = ""; mWarningCallCount = 0; mInformationCallCount = 0; + mType = -1; + mAttribute = -1; + mOpenCallCount = 0; + mShowCallCount = 0; } public: // data @@ -35,8 +39,10 @@ static QString mLatestTxt; static int mWarningCallCount; static int mInformationCallCount; + static int mType; + static int mAttribute; + static int mOpenCallCount; + static int mShowCallCount; }; - - #endif // HBMESSAGEBOXDATA_H_ diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/inc/testobjectstore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/inc/testobjectstore.h Thu May 27 12:53:14 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2008-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: +* +*/ + +#ifndef TESTOBJECTSTORE.h +#define TESTOBJECTSTORE.h + +#include +#include +#include + +class TestObjectStore : public QObject +{ + Q_OBJECT + +public: + + static TestObjectStore &instance(); + + void addObject(QObject *object); + +private slots: + + void objectDestroyed(QObject *obj); + +private: + + TestObjectStore(); + + ~TestObjectStore(); + + QList mObjects; + +}; + +#endif diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/hbdocumentloader.cpp --- a/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Thu May 27 12:53:14 2010 +0300 @@ -309,5 +309,9 @@ { obj = new HbStackedWidget(); } + else if(name == DOCML_NAME_LBL_MARKALL) + { + obj = new HbLabel(); + } return obj; } diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/hbinputdialog.cpp --- a/videocollection/tsrc/stubs/src/hbinputdialog.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/hbinputdialog.cpp Thu May 27 12:53:14 2010 +0300 @@ -16,37 +16,61 @@ */ #include "hbinputdialog.h" +#include "testobjectstore.h" -bool HbInputDialog::mGetTextFails = false; -QString HbInputDialog::mGetTextReturnValue = QString(); int HbInputDialog::mGetTextCallCount = 0; - +int HbInputDialog::mAttribute = -1; +QString HbInputDialog::mLastHeading = ""; +QString HbInputDialog::mLastText = ""; +QVariant HbInputDialog::mValueReturnValue = QVariant(); +int HbInputDialog::mValueCallCount = 0; -QString HbInputDialog::getText(const QString &label,const QString &text, - bool *ok, QGraphicsScene *scene, QGraphicsItem *parent) +HbInputDialog::HbInputDialog(QGraphicsItem *parent) : HbWidget(parent) { - Q_UNUSED(label); - Q_UNUSED(scene); - Q_UNUSED(parent); - mGetTextCallCount++; - QString textReturn; - if(HbInputDialog::mGetTextReturnValue.isNull()) - { - textReturn = text; - } - else - { - textReturn = mGetTextReturnValue; - } - if(mGetTextFails) - { - *ok = false; - textReturn = ""; - } - else - { - *ok = true; - } - return textReturn; + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); + + TestObjectStore::instance().addObject(this); } +HbInputDialog::~HbInputDialog() +{ + while(!mActions.isEmpty()) + { + delete mActions.takeFirst(); + } +} + +void HbInputDialog::getText(const QString &heading + ,QObject *receiver + ,const char *member + ,const QString &text + ,QGraphicsScene *scene + ,QGraphicsItem *parent) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + Q_UNUSED(scene); + Q_UNUSED(parent); + + mLastHeading = heading; + mLastText = text; + mGetTextCallCount++; +} + +void HbInputDialog::emitDialogFinished( QObject* receiver, const char* member, int actionNum ) +{ + if(connect(this, SIGNAL(finished(HbAction *)), receiver, member)) + { + emit finished(mActions.value(actionNum)); + disconnect(this, SIGNAL(finished(HbAction *)), receiver, member); + } +} + +void HbInputDialog::setAttribute(int attribute) +{ + HbInputDialog::mAttribute = attribute; +} + diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/hbmessagebox.cpp --- a/videocollection/tsrc/stubs/src/hbmessagebox.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/hbmessagebox.cpp Thu May 27 12:53:14 2010 +0300 @@ -19,27 +19,71 @@ #include "hbmessagebox.h" #include "hbmessageboxdata.h" +#include "testobjectstore.h" bool HbMessageBoxData::mQuestionReturnValue = false; QString HbMessageBoxData::mLatestTxt = ""; int HbMessageBoxData::mWarningCallCount = 0; int HbMessageBoxData::mInformationCallCount = 0; +int HbMessageBoxData::mType = -1; +int HbMessageBoxData::mAttribute = -1; +int HbMessageBoxData::mOpenCallCount = 0; +int HbMessageBoxData::mShowCallCount = 0; -bool HbMessageBox::question(const QString &questionText, - const QString &primaryButtonText, - const QString &secondaryButtonText, - QGraphicsWidget *headWidget, - QGraphicsScene *scene, - QGraphicsItem *parent) +HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + HbMessageBoxData::mType = type; + + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); + + TestObjectStore::instance().addObject(this); +} + +HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent) { - Q_UNUSED(primaryButtonText); - Q_UNUSED(secondaryButtonText); - Q_UNUSED(headWidget); - Q_UNUSED(scene); Q_UNUSED(parent); + HbMessageBoxData::mLatestTxt = text; + HbMessageBoxData::mType = type; - HbMessageBoxData::mLatestTxt = questionText; - return HbMessageBoxData::mQuestionReturnValue; + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); + + TestObjectStore::instance().addObject(this); +} + +HbMessageBox::~HbMessageBox() +{ + while(!mActions.isEmpty()) + { + delete mActions.takeFirst(); + } +} + +void HbMessageBox::show() +{ + HbMessageBoxData::mShowCallCount++; +} + +void HbMessageBox::open( QObject* receiver, const char* member ) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + HbMessageBoxData::mOpenCallCount++; +} + +void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum ) +{ + if(connect(this, SIGNAL(finished(HbAction *)), receiver, member)) + { + emit finished(mActions.value(actionNum)); + disconnect(this, SIGNAL(finished(HbAction *)), receiver, member); + } } void HbMessageBox::information(const QString &informationText, @@ -68,4 +112,9 @@ HbMessageBoxData::mWarningCallCount++; } +void HbMessageBox::setAttribute(int attribute) +{ + HbMessageBoxData::mAttribute = attribute; +} + // end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/testobjectstore.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/tsrc/stubs/src/testobjectstore.cpp Thu May 27 12:53:14 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2008-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 "testobjectstore.h" + +TestObjectStore::TestObjectStore() +{ + +} + +TestObjectStore::~TestObjectStore() +{ + while(!mObjects.isEmpty()) + { + QObject *obj = mObjects.takeFirst(); + delete obj; + } +} + +TestObjectStore &TestObjectStore::instance() +{ + static TestObjectStore _store; + return _store; +} + +void TestObjectStore::addObject(QObject *object) +{ + if(connect(object, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *)))) + { + mObjects.append(object); + } +} + +void TestObjectStore::objectDestroyed(QObject *obj) +{ + if(obj) + { + disconnect(obj, SIGNAL(destroyed(QObject *)), this, SLOT(objectDestroyed(QObject *))); + mObjects.removeOne(obj); + } +} diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videocollectionuiloader.cpp --- a/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Thu May 27 12:53:14 2010 +0300 @@ -97,8 +97,9 @@ storeOrphans(list); } -QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name) +QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name, bool loadIfNotFound) { + Q_UNUSED(loadIfNotFound); QGraphicsWidget *widget = 0; if(VideoCollectionUiLoaderData::mFindFailure) { @@ -111,8 +112,9 @@ return widget; } -QObject* VideoCollectionUiLoader::doFindObject(const QString &name) +QObject* VideoCollectionUiLoader::doFindObject(const QString &name, bool loadIfNotFound) { + Q_UNUSED(loadIfNotFound); QObject *object = 0; if(VideoCollectionUiLoaderData::mFindFailure) { @@ -199,7 +201,7 @@ QObject* VideoCollectionUiLoader::createObject(const QString& type, const QString &name) { - QObject* object = doFindObject(name); + QObject* object = doFindObject(name, true); if (!object) { if (name == DOCML_NAME_VIEW) diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videolistselectiondialog.cpp --- a/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Thu May 27 12:53:14 2010 +0300 @@ -144,4 +144,16 @@ // not stubbed } +void VideoListSelectionDialog::newAlbumNameDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + +void VideoListSelectionDialog::finalize(QString albumName) +{ + Q_UNUSED(albumName); + // not stubbed +} + // end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videolistview.cpp --- a/videocollection/tsrc/stubs/src/videolistview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videolistview.cpp Thu May 27 12:53:14 2010 +0300 @@ -246,4 +246,10 @@ // not stubbed } +void VideoListView::createCollectionDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + // end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videolistwidget.cpp --- a/videocollection/tsrc/stubs/src/videolistwidget.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp Thu May 27 12:53:14 2010 +0300 @@ -133,12 +133,6 @@ // not stubbed } -void VideoListWidget::panGesture (const QPointF &point) -{ - Q_UNUSED(point); - // not stubbed -} - void VideoListWidget::openItemSlot() { // not stubbed @@ -215,4 +209,22 @@ // not stubbed } +void VideoListWidget::renameDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + +void VideoListWidget::deleteItemDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + +void VideoListWidget::removeCollectionDialogFinished(HbAction *action) +{ + Q_UNUSED(action); + // not stubbed +} + // end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videoservicebrowse.cpp --- a/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 5 % #include @@ -30,8 +30,8 @@ Constructor. \param parent, Pointer to the video services. */ -VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent) - : XQServiceProvider( "TestListView" ) +VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service) + : XQServiceProvider( service, parent ) , mRequestIndex( 0 ) , mServiceApp( parent ) { @@ -94,4 +94,18 @@ // not stubbed } +/*! + Browse videos. + \param category, Category which type of videos are browsed. + \return None. +*/ +void VideoServiceBrowse::browseVideos(int category, + int sortRole) +{ + Q_UNUSED(category); + Q_UNUSED(sortRole); + + // not stubbed +} + // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videoservices.cpp --- a/videocollection/tsrc/stubs/src/videoservices.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videoservices.cpp Thu May 27 12:53:14 2010 +0300 @@ -70,8 +70,8 @@ mCurrentService(VideoServices::ENoService), mSortRole(0) { - mServiceUriFetch = new VideoServiceUriFetch(this); - mServiceBrowse = new VideoServiceBrowse(this); + mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("TestListView")); + mServiceBrowse = new VideoServiceBrowse(this, QLatin1String("TestListView")); } VideoServices::~VideoServices() diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/src/videoserviceurifetch.cpp --- a/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/src/videoserviceurifetch.cpp Thu May 27 12:53:14 2010 +0300 @@ -18,8 +18,8 @@ #include "videoserviceurifetch.h" #include "videoservices.h" -VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent): - XQServiceProvider("TestListView"), +VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service): + XQServiceProvider( service, parent ), mRequestIndex(0), mServiceApp(parent) { @@ -61,6 +61,11 @@ return QString(); } +void VideoServiceUriFetch::fetch() +{ + mServiceApp->setCurrentService(VideoServices::EUriFetcher); +} + void VideoServiceUriFetch::fetch(const QString& title) { Q_UNUSED(title); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/stubs/stubs.pro --- a/videocollection/tsrc/stubs/stubs.pro Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/tsrc/stubs/stubs.pro Thu May 27 12:53:14 2010 +0300 @@ -28,6 +28,7 @@ -lxqservice.dll HEADERS_TEMP = \ + inc/testobjectstore.h \ inc/hbabstractitemview.h \ inc/hbdocumentloader.h \ inc/hbaction.h \ @@ -86,6 +87,7 @@ ../../../videoplayerapp/videoplayerengine/inc/videoservicebrowse.h SOURCES_TEMP = \ + src/testobjectstore.cpp \ src/hbdocumentloader.cpp \ src/hbaction.cpp \ src/hbcheckbox.cpp \ diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.der Binary file videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.der has changed diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.key --- a/videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.key Fri May 14 15:53:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn -uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO -vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB -AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo -REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss -/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J -s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut -sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/ -pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp -VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ -P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK -1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT -1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x ------END RSA PRIVATE KEY----- diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.sisx Binary file videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.sisx has changed diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/data/images/qtg_mono_video_all.svg --- a/videocollection/videocollectionview/data/images/qtg_mono_video_all.svg Fri May 14 15:53:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - -]> - - - - - - diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/data/videocollectionview.qrc --- a/videocollection/videocollectionview/data/videocollectionview.qrc Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/data/videocollectionview.qrc Thu May 27 12:53:14 2010 +0300 @@ -3,9 +3,6 @@ collectionview.docml videolistselectiondialog.docml - - images/qtg_mono_video_all.svg - hbdialog.css diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/inc/videocollectionuiloader.h --- a/videocollection/videocollectionview/inc/videocollectionuiloader.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/inc/videocollectionuiloader.h Thu May 27 12:53:14 2010 +0300 @@ -78,24 +78,26 @@ * Returns the requested widget casted to correct type * * @param name Name of the widget + * @param loadIfNotFound Should the widget be loaded if not found in cache. * @return Pointer to the widget */ template - T* findWidget(const QString &name) + T* findWidget(const QString &name, bool loadIfNotFound = true) { - return qobject_cast(doFindWidget(name)); + return qobject_cast(doFindWidget(name, loadIfNotFound)); } /** * Returns the requested object casted to correct type * * @param name Name of the object + * @param loadIfNotFound Should the widget be loaded if not found in cache. * @return Pointer to the object */ template - T* findObject(const QString &name) + T* findObject(const QString &name, bool loadIfNotFound = true) { - return qobject_cast(doFindObject(name)); + return qobject_cast(doFindObject(name, loadIfNotFound)); } /** @@ -141,9 +143,10 @@ * Loads widget from document. * * @param name, Widget name. + * @param loadIfNotFound Should the widget be loaded if not found in cache. * @return QGraphicsWidget*. */ - QGraphicsWidget* doFindWidget(const QString &name); + QGraphicsWidget* doFindWidget(const QString &name, bool loadIfNotFound); /** * Loads object from document. @@ -151,7 +154,7 @@ * @param name, Object name. * @return QObject*. */ - QObject* doFindObject(const QString &name); + QObject* doFindObject(const QString &name, bool loadIfNotFound); /** * Adds a ui section to async loading queue. diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/inc/videolistview.h --- a/videocollection/videocollectionview/inc/videolistview.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/inc/videolistview.h Thu May 27 12:53:14 2010 +0300 @@ -380,6 +380,11 @@ * Boolean for knowing when the model is ready. */ bool mModelReady; + + /** + * Boolean for knowing when the view is ready. + */ + bool mViewReady; /** * Hint level for the hint widget. diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/inc/videolistwidget.h --- a/videocollection/videocollectionview/inc/videolistwidget.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/inc/videolistwidget.h Thu May 27 12:53:14 2010 +0300 @@ -174,12 +174,6 @@ * Saves current selected item's index to mCurrentIndex */ void longPressedSlot(HbAbstractViewItem *item, const QPointF &point); - - /** - * Re-implemented in case context menu is visible, the below list shoud not - * be panned. - */ - void panGesture(const QPointF &point); private slots: diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/src/videocollectionuiloader.cpp --- a/videocollection/videocollectionview/src/videocollectionuiloader.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/src/videocollectionuiloader.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 21 % +// Version : %version: 22 % // INCLUDE FILES #include @@ -199,7 +199,7 @@ // doFindWidget // --------------------------------------------------------------------------- // -QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name) +QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name, bool loadIfNotFound) { FUNC_LOG; QGraphicsWidget *widget = 0; @@ -211,7 +211,7 @@ } // 2. load from document and initialize - else + else if (loadIfNotFound) { // find object from queue int index = indexInQueue(name); @@ -238,7 +238,7 @@ // doFindObject // --------------------------------------------------------------------------- // -QObject* VideoCollectionUiLoader::doFindObject(const QString &name) +QObject* VideoCollectionUiLoader::doFindObject(const QString &name, bool loadIfNotFound) { FUNC_LOG; QObject *object = 0; @@ -250,7 +250,7 @@ } // 2. load from document and initialize - else + else if (loadIfNotFound) { // find object from queue int index = indexInQueue(name); @@ -373,10 +373,8 @@ wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); if(model) { - // open and sort model - model->open(VideoCollectionCommon::ELevelVideos); - VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos); - + VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos); + // init widget VideoServices *videoServices = 0; if (mIsService) @@ -393,9 +391,8 @@ VideoCollectionCommon::EModelTypeCollections); if (model) { - model->open(VideoCollectionCommon::ELevelCategory); VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelCategory); - + // initialize video collection widget VideoListWidget *videoList = qobject_cast(object); @@ -417,6 +414,10 @@ VideoCollectionCommon::EModelTypeCollectionContent); if (model) { + // collection content contains always a list of videos so we use + // ELevelVideos as target for sorting + VideoCollectionViewUtils::sortModel(model, false, VideoCollectionCommon::ELevelVideos); + VideoListWidget *videoList = qobject_cast(object); if (videoList) { diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/src/videocollectionviewutils.cpp --- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 37 % +// Version : %version: 39 % // INCLUDE FILES #include @@ -32,6 +32,11 @@ #include "videosortfilterproxymodel.h" #include "videocollectiontrace.h" +// Object names. +const char* const VIEW_UTILS_OBJECT_NAME_STATUS_MSG = "vc:ViewUtilsStatusMessage"; +const char* const VIEW_UTILS_OBJECT_NAME_MESSAGE_BOX_WARNING = "vc:ViewUtilsMessageBoxWarning"; + +// Cenrep constants. const int KVideoCollectionViewCenrepUid(0x2002BC63); const int KVideoCollectionViewCenrepServiceIconKey(0x2); const int KVideoCollectionViewCenrepServiceIconPressedKey(0x3); @@ -40,15 +45,19 @@ const int KVideoCollectionViewCenrepCollectionsSortingRoleKey(0x7); const int KVideoCollectionViewCenrepCollectionsSortingOrderKey(0x8); +const int KAddToCollectionDataCount(2); +const int KAddToCollectionCountIndex(0); +const int KAddToCollectionNameIndex(1); + // --------------------------------------------------------------------------- // instance // --------------------------------------------------------------------------- // VideoCollectionViewUtils& VideoCollectionViewUtils::instance() { - FUNC_LOG; - static VideoCollectionViewUtils _popupInstance; - return _popupInstance; + FUNC_LOG; + static VideoCollectionViewUtils _popupInstance; + return _popupInstance; } // --------------------------------------------------------------------------- @@ -62,7 +71,6 @@ mCollectionsSortOrder(Qt::AscendingOrder) { FUNC_LOG; - } // --------------------------------------------------------------------------- @@ -72,7 +80,6 @@ VideoCollectionViewUtils::~VideoCollectionViewUtils() { FUNC_LOG; - } // --------------------------------------------------------------------------- @@ -335,11 +342,16 @@ case VideoCollectionCommon::statusMultiRemoveFail: msg = hbTrId("txt_videos_info_unable_to_remove_some_collections"); break; - case VideoCollectionCommon::statusVideosAddedToCollection: - format = hbTrId("txt_videos_dpopinfo_videos_added_to_1"); - if(additional.isValid()) + case VideoCollectionCommon::statusVideosAddedToCollection: + // videos added to collection - status should containg both count and collection name + if(additional.isValid() && additional.toList().count() == KAddToCollectionDataCount) { - msg = format.arg(additional.toString()); + int count = additional.toList().at(KAddToCollectionCountIndex).toInt(); + QString name = additional.toList().at(KAddToCollectionNameIndex).toString(); + if(count && name.length()) + { + msg = hbTrId("txt_videos_dpopinfo_ln_videos_added_to_1", count).arg(name); + } } error = false; break; @@ -347,10 +359,9 @@ msg = hbTrId("txt_videos_info_all_videos_already_added_to_this_c"); break; case VideoCollectionCommon::statusDeleteInProgress: - format = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted"); if(additional.isValid()) { - msg = format.arg(additional.toString()); + msg = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted", additional.toInt()); } error = false; break; @@ -362,7 +373,10 @@ { if(error) { - HbMessageBox::warning(msg); + HbMessageBox *messageBox = new HbMessageBox(msg, HbMessageBox::MessageTypeWarning); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(VIEW_UTILS_OBJECT_NAME_MESSAGE_BOX_WARNING); + messageBox->show(); } else { @@ -371,8 +385,10 @@ // only title can be two rows for HbNotificationDialog infoNote->setTitleTextWrapping(Hb::TextWordWrap); infoNote->setTitle(msg); + infoNote->setObjectName(VIEW_UTILS_OBJECT_NAME_STATUS_MSG); infoNote->show(); } } } +// End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/src/videolistselectiondialog.cpp --- a/videocollection/videocollectionview/src/videolistselectiondialog.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/src/videolistselectiondialog.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 25 % +// Version : %version: 29 % // INCLUDE FILES #include @@ -37,6 +37,12 @@ #include "videocollectionclient.h" #include "videocollectiontrace.h" +// Object names. +const char* const SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET = "vc:SelectionDialogListWidget"; +const char* const SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION = "vc:SelectionDialogNewCollection"; +const char* const SELECTION_DIALOG_OBJECT_NAME_BUTTON_OK = "vc:SelectionDialogButtonOk"; +const char* const SELECTION_DIALOG_OBJECT_NAME_BUTTON_CANCEL = "vc:SelectionDialogButtonCancel"; + /** * global qHash function required fo creating hash values for TMPXItemId -keys */ @@ -91,6 +97,7 @@ } // disable list related animations to make dialog faster mListWidget->setEnabledAnimations(HbAbstractItemView::None); + mListWidget->setObjectName(SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET); } } @@ -175,6 +182,7 @@ if(!mListWidget) { mListWidget = new VideoListWidget(mUiLoader); + mListWidget->setObjectName(SELECTION_DIALOG_OBJECT_NAME_LIST_WIDGET); if(mListWidget->initialize(*mModel) < 0) { ERROR(-1, "VideoListSelectionDialog::initDialog() failed to setup VideoListWidget."); @@ -217,11 +225,13 @@ if(!mPrimaryAction) { mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok")); + mPrimaryAction->setObjectName(SELECTION_DIALOG_OBJECT_NAME_BUTTON_OK); addAction(mPrimaryAction); } if(!mSecondaryAction) { mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); + mSecondaryAction->setObjectName(SELECTION_DIALOG_OBJECT_NAME_BUTTON_CANCEL); addAction(mSecondaryAction); } @@ -277,10 +287,8 @@ mCheckboxContainer->setVisible(false); mListWidget->setSelectionMode(-1); mListWidget->activate(VideoCollectionCommon::ELevelCategory); - // need to set primaryaction disabled here in order for it - // get correctly updated at modelReady(), where it will be enabled - // if state would be same, no update will happen - mPrimaryAction->setDisabled(true); + // New collection button is always enabled for collection selection. + mPrimaryAction->setDisabled(false); } else { @@ -290,10 +298,8 @@ mCheckboxContainer->setVisible(true); mItemCount->setPlainText(tr("0/%1").arg(mModel->rowCount())); mCheckBox->setChecked(false); - // need to set primaryaction enabled here in order for it - // get correctly updated at modelReady(), where it will be disabled - // if state would be same, no update will happen - mPrimaryAction->setDisabled(false); + // Add button will be enabled when videos are selected from the list. + mPrimaryAction->setDisabled(true); } mHeading->setPlainText(headingTxt); // sort to make sure dialog has correctly filtered content @@ -345,16 +351,18 @@ return; } QString albumName(""); - if( mTypeOfSelection == ESelectCollection ) + if(mTypeOfSelection == ESelectCollection) { mTypeOfSelection = EAddToCollection; - if( mSelectedAlbumId == TMPXItemId::InvalidId()) + if(mSelectedAlbumId == TMPXItemId::InvalidId()) { QString label(hbTrId("txt_videos_title_enter_name")); HbInputDialog *dialog = new HbInputDialog(); + dialog->setObjectName(SELECTION_DIALOG_OBJECT_NAME_NEW_COLLECTION); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->getText(label, this, SLOT(newAlbumNameDialogFinished(HbAction *)), - hbTrId("txt_videos_dialog_entry_new_collection")); + dialog->setPromptText(label); + dialog->setValue(hbTrId("txt_videos_dialog_entry_new_collection")); + dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *))); } else { @@ -408,7 +416,10 @@ { albumName = getSelectedName(); } - QVariant data = albumName; + QList dataList; + dataList.append(QVariant(mSelectedVideos.count())); + dataList.append(QVariant(albumName)); + QVariant data = dataList; VideoCollectionViewUtils::instance().showStatusMsgSlot( VideoCollectionCommon::statusVideosAddedToCollection, data); @@ -522,7 +533,6 @@ FUNC_LOG; if(mTypeOfSelection == ESelectCollection) { - mPrimaryAction->setDisabled(false); if(!mModel->rowCount()) { // in case there are no user defined albums, @@ -532,10 +542,6 @@ return; } } - if(mTypeOfSelection != ESelectCollection) - { - mPrimaryAction->setDisabled(true); - } updateCounterSlot(); } @@ -676,7 +682,7 @@ name = model->data(index, VideoCollectionCommon::KeyTitle).toString(); } } - return name; } +// End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/src/videolistview.cpp --- a/videocollection/videocollectionview/src/videolistview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/src/videolistview.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 101 % +// Version : %version: 106 % // INCLUDE FILES #include @@ -47,6 +47,10 @@ #include "mpxhbvideocommondefs.h" #include "videocollectiontrace.h" +// Object names. +const char* const LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION = "vc::ListViewInputDialogCreateCollection"; +const char* const LIST_VIEW_OBJECT_NAME_OPTIONS_MENU = "vc::ListViewOptionsMenu"; + // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- @@ -58,6 +62,7 @@ , mUiLoader( uiLoader ) , mIsService( false ) , mModelReady( false ) + , mViewReady( false ) , mHintLevel( VideoHintWidget::AllVideos ) , mVideoServices( 0 ) , mCurrentList( 0 ) @@ -302,8 +307,9 @@ // if mModelReady is false, then it means that this is the first time modelReady // signal fires. Signaling that view is ready. - if(!mModelReady) + if(!mViewReady) { + mViewReady = true; emit viewReady(); } @@ -322,12 +328,10 @@ void VideoListView::layoutChangedSlot() { FUNC_LOG; + // Note that showHint should be executed before updateSubLabel as it + // can modify the mModelReady flag. + showHint(); updateSubLabel(); - - if(mModelReady) - { - showHint(); - } } // --------------------------------------------------------------------------- @@ -351,8 +355,9 @@ this, SLOT(handleAsyncStatusSlot(int, QVariant&))); HbMenu *menu = mUiLoader->findWidget(DOCML_NAME_OPTIONS_MENU); - if (menu) + if(menu) { + menu->setObjectName(LIST_VIEW_OBJECT_NAME_OPTIONS_MENU); menu->hide(); } @@ -407,9 +412,9 @@ int VideoListView::createToolbar() { FUNC_LOG; - // Create actiongroup and add all actions to it. This ensures that only one is + + // Create actiongroup and add all actions to it. This ensures that only one is // active at certain moment. - if(!mToolbarViewsActionGroup && !mToolbarCollectionActionGroup) { mToolbarViewsActionGroup = new QActionGroup(this); @@ -418,7 +423,7 @@ // create toolbar item actions // All Videos tab - mToolbarActions[ETBActionAllVideos] = createAction(":/images/qtg_mono_video_all.svg", + mToolbarActions[ETBActionAllVideos] = createAction("qtg_mono_video", mToolbarViewsActionGroup, SLOT(openAllVideosViewSlot())); // Collections tab @@ -514,30 +519,34 @@ VideoSortFilterProxyModel &model = mCurrentList->getModel(); - // prepare hint widget + if(!mModelReady && model.rowCount() == 0) + { + return; + } + + mModelReady = true; + + // decide if the hintwidget needs to be shown or not. + show = show && model.rowCount() == 0; + + // If show is false, then hint widget is fetched only if it exists. If + // show is true then hint widget is also created and prepared if it does not exists. VideoHintWidget *hintWidget = mUiLoader->findWidget( - DOCML_NAME_VC_VIDEOHINTWIDGET); + DOCML_NAME_VC_VIDEOHINTWIDGET, show); + if (hintWidget) { hintWidget->setLevel(mHintLevel); - if (mModelReady && - model.rowCount() == 0) + if (show) { - show ? hintWidget->activate() : hintWidget->deactivate(); - } - else - { - show = false; - hintWidget->deactivate(); - } - if(show) - { + hintWidget->activate(); bool showHintBtns = (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl); hintWidget->setButtonShown(showHintBtns); } else { + hintWidget->deactivate(); hintWidget->setButtonShown(true); } } @@ -595,7 +604,7 @@ model = &mCurrentList->getModel(); } - if (model) + if (model && mModelReady) { int itemCount = model->rowCount(); @@ -823,11 +832,10 @@ mCurrentList = videoListWidget; mCurrentList->activate(VideoCollectionCommon::ELevelVideos); - // since collection is not to be opened at this point, - // we do not receive lauoutChanged for updating the hind -widget - // if needed, need to show it here is needed setHintLevel(VideoHintWidget::AllVideos); - showHint(); + + // update the sublabel, as in most cases the data is already up to date. + updateSubLabel(); } } @@ -854,10 +862,11 @@ VideoSortFilterProxyModel &model = mCurrentList->getModel(); - VideoCollectionViewUtils::sortModel(&model, false, mCurrentList->getLevel()); - - // the collection view is not empty, so we can hide the hint in advance. + // the collection view is not empty, so we should hide the hint in advance. showHint(false); + + // also update the sublabel immediatelly, as the data is up to date almost always. + updateSubLabel(); } } @@ -1023,7 +1032,10 @@ HbInputDialog *dialog = new HbInputDialog(); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->getText(label, this, SLOT(createCollectionDialogFinished(HbAction *)), text); + dialog->setObjectName(LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION); + dialog->setPromptText(label); + dialog->setValue(text); + dialog->open(this, SLOT(createCollectionDialogFinished(HbAction *))); } // ------------------------------------------------------------------------------------------------- @@ -1033,7 +1045,6 @@ void VideoListView::createCollectionDialogFinished(HbAction *action) { FUNC_LOG; - Q_UNUSED(action); HbInputDialog *dialog = static_cast(sender()); @@ -1362,7 +1373,8 @@ } // Start fetching content before changing. - collectionContentWidget->getModel().openItem(itemId); + VideoSortFilterProxyModel &model = collectionContentWidget->getModel(); + model.openItem(itemId); // deactivat current widget. mCurrentList->deactivate(); @@ -1373,14 +1385,11 @@ updateSubLabel(); - // setup correct sorting, collection content contains always a list of videos so we use - // ELevelVideos as target for sorting - VideoCollectionViewUtils::sortModel(&mCurrentList->getModel(), false, VideoCollectionCommon::ELevelVideos); - mCurrentList->getModel().invalidate(); + model.invalidate(); // update hint widget for correct content + mModelReady = model.rowCount() > 0; setHintLevel(VideoHintWidget::Collection); - showHint(); // update toolbar for albums, default categories don't have one. if(level == VideoCollectionCommon::ELevelAlbum && @@ -1404,7 +1413,6 @@ } // restore animations for collection content widget collectionContentWidget->setEnabledAnimations(animationState); - } // ------------------------------------------------------------------------------------------------- @@ -1514,5 +1522,4 @@ HbMessageBox::information(tr("Not implemented yet")); } -// end of file - +// End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/src/videolistwidget.cpp --- a/videocollection/videocollectionview/src/videolistwidget.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/src/videolistwidget.cpp Thu May 27 12:53:14 2010 +0300 @@ -40,6 +40,23 @@ #include "videocollectioncommon.h" #include "mpxhbvideocommondefs.h" +// Object names. +const char* const LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU = "vc:ListWidgetContextMenu"; +const char* const LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO = "vc:ListWidgetMessageBoxDeleteVideo"; +const char* const LIST_WIDGET_OBJECT_NAME_RENAME_VIDEO = "vc:ListWidgetInputDialogRenameVideo"; +const char* const LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION = "vc:ListWidgetMessageBoxRemoveCollection"; +const char* const LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK = "vc:ListWidgetNavKeyBack"; +const char* const LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT = "vc:ListWidgetNavKeyQuit"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH = "vc:ListWidgetActionAttach"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_PLAY = "vc:ListWidgetActionPlay"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS = "vc:ListWidgetActionDetails"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_DELETE = "vc:ListWidgetActionDelete"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_OPEN = "vc:ListWidgetActionOpen"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_ADD_TO = "vc:ListWidgetActionAddToCollection"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_FROM = "vc:ListWidgetActionRemoveFromCollection"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_RENAME = "vc:ListWidgetActionRename"; +const char* const LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_COLLECTION = "vc:ListWidgetActionRemoveCollection"; + // Interval in ms to report the scroll position. const int SCROLL_POSITION_TIMER_TIMEOUT = 100; @@ -313,7 +330,6 @@ } return isBrowsingService; - } // --------------------------------------------------------------------------- @@ -330,22 +346,21 @@ if (isBrowsingService()) { mNavKeyAction = new HbAction(Hb::QuitNaviAction); - if (mNavKeyAction) - { - connect( - mNavKeyAction, SIGNAL(triggered()), - mVideoServices, SLOT(browsingEnded())); - } + mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT); + connect(mNavKeyAction, SIGNAL(triggered()), + mVideoServices, SLOT(browsingEnded())); } else if (mModel) { if (VideoCollectionCommon::EModelTypeCollectionContent == mModel->getType()) { mNavKeyAction = new HbAction(Hb::BackNaviAction); + mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_BACK); } else { mNavKeyAction = new HbAction(Hb::QuitNaviAction); + mNavKeyAction->setObjectName(LIST_WIDGET_OBJECT_NAME_NAV_KEY_QUIT); } } } @@ -384,6 +399,7 @@ HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion); messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_DELETE_VIDEO); messageBox->open(this, SLOT(deleteItemDialogFinished(HbAction *))); } } @@ -420,54 +436,77 @@ } mContextMenu = new HbMenu(); - if (mContextMenu) + mContextMenu->setDismissPolicy(HbPopup::TapAnywhere); + mContextMenu->setObjectName(LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU); + + VideoServices::TVideoService service = VideoServices::ENoService; + if (mIsService && + mVideoServices) { - mContextMenu->setDismissPolicy(HbPopup::TapAnywhere); + service = mVideoServices->currentService(); + } + + if (service == VideoServices::EUriFetcher) + { + mContextMenuActions[EActionAttach] = + mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot())); + mContextMenuActions[EActionAttach]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH); - VideoServices::TVideoService service = VideoServices::ENoService; - if (mIsService && - mVideoServices) - { - service = mVideoServices->currentService(); - } + mContextMenuActions[EActionPlay] = + mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); + mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); + + mContextMenuActions[EActionDetails] = + mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); + mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); + } + else if (service == VideoServices::EBrowse) + { + mContextMenuActions[EActionPlay] = + mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); + mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); + + mContextMenuActions[EActionDelete] = + mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); + mContextMenuActions[EActionDelete]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DELETE); - if (service == VideoServices::EUriFetcher) - { - mContextMenuActions[EActionAttach] = - mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot())); - mContextMenuActions[EActionPlay] = - mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); - mContextMenuActions[EActionDetails] = - mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); - } - else if (service == VideoServices::EBrowse) - { - mContextMenuActions[EActionPlay] = - mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); - mContextMenuActions[EActionDelete] = - mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); - mContextMenuActions[EActionDetails] = - mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); - } - else - { - mContextMenuActions[EActionPlay] = - mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); - mContextMenuActions[EActionOpen] = - mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot())); - mContextMenuActions[EActionAddToCollection] = - mContextMenu->addAction(hbTrId("txt_videos_menu_add_to_collection"), this, SLOT(addToCollectionSlot())); - mContextMenuActions[EActionRemove] = - mContextMenu->addAction(hbTrId("txt_videos_menu_remove_from_collection"), this, SLOT(removeFromCollectionSlot())); - mContextMenuActions[EActionRename] = - mContextMenu->addAction(hbTrId("txt_common_menu_rename_item"), this, SLOT(renameSlot())); - mContextMenuActions[EActionRemoveCollection] = - mContextMenu->addAction(hbTrId("txt_videos_menu_remove_collection"), this, SLOT(removeCollectionSlot())); - mContextMenuActions[EActionDelete] = - mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); - mContextMenuActions[EActionDetails] = - mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); - } + mContextMenuActions[EActionDetails] = + mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); + mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); + } + else + { + mContextMenuActions[EActionPlay] = + mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); + mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); + + mContextMenuActions[EActionOpen] = + mContextMenu->addAction(hbTrId("txt_common_menu_open"), this, SLOT(openItemSlot())); + mContextMenuActions[EActionOpen]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_OPEN); + + mContextMenuActions[EActionAddToCollection] = + mContextMenu->addAction(hbTrId("txt_videos_menu_add_to_collection"), this, SLOT(addToCollectionSlot())); + mContextMenuActions[EActionAddToCollection]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ADD_TO); + + mContextMenuActions[EActionRemove] = + mContextMenu->addAction(hbTrId("txt_videos_menu_remove_from_collection"), this, SLOT(removeFromCollectionSlot())); + mContextMenuActions[EActionRemove]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_FROM); + + mContextMenuActions[EActionRename] = + mContextMenu->addAction(hbTrId("txt_common_menu_rename_item"), this, SLOT(renameSlot())); + mContextMenuActions[EActionRename]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_RENAME); + + mContextMenuActions[EActionRemoveCollection] = + mContextMenu->addAction(hbTrId("txt_videos_menu_remove_collection"), this, SLOT(removeCollectionSlot())); + mContextMenuActions[EActionRemoveCollection]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_REMOVE_COLLECTION); + + mContextMenuActions[EActionDelete] = + mContextMenu->addAction(hbTrId("txt_common_menu_delete"), this, SLOT(deleteItemSlot())); + mContextMenuActions[EActionDelete]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DELETE); + + mContextMenuActions[EActionDetails] = + mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); + mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); } } @@ -705,26 +744,6 @@ } // --------------------------------------------------------------------------- -// panGesture -// --------------------------------------------------------------------------- -// -void VideoListWidget::panGesture(const QPointF &point) -{ - FUNC_LOG_ADDR(this); - if (mContextMenu) - { - if (!mContextMenu->isVisible()) - { - HbListView::panGesture(point); - } - } - else - { - HbListView::panGesture(point); - } -} - -// --------------------------------------------------------------------------- // doDelayedsSlot // --------------------------------------------------------------------------- // @@ -793,7 +812,10 @@ HbInputDialog *dialog = new HbInputDialog(); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->getText(label, this, SLOT(renameDialogFinished(HbAction *)), albumName); + dialog->setObjectName(LIST_WIDGET_OBJECT_NAME_RENAME_VIDEO); + dialog->setPromptText(label); + dialog->setValue(albumName); + dialog->open(this, SLOT(renameDialogFinished(HbAction *))); } } @@ -893,6 +915,7 @@ variant.toString()); HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion); messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(LIST_WIDGET_OBJECT_NAME_REMOVE_COLLECTION); messageBox->open(this, SLOT(removeCollectionDialogFinished(HbAction *))); } } diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp --- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 38 % +// Version : %version: 41 % #define private public #include "videoservices.h" @@ -406,7 +406,7 @@ HbAction* allVideos = static_cast(actions.at(0)); QVERIFY( allVideos->isCheckable() ); - QCOMPARE( allVideos->icon().iconName(), QString(":/images/qtg_mono_video_all.svg") ); + QCOMPARE( allVideos->icon().iconName(), QString("qtg_mono_video") ); QVERIFY( allVideos->isChecked() ); HbAction* collections = static_cast(actions.at(1)); @@ -940,9 +940,18 @@ { init(); mTestView->mModelReady = false; + mTestView->mViewReady = false; connect( this, SIGNAL(testSignal()), mTestView, SLOT(modelReadySlot()) ); + QSignalSpy spy(mTestView, SIGNAL(viewReady())); emit testSignal(); QVERIFY(mTestView->mModelReady); + QVERIFY(mTestView->mViewReady); + QCOMPARE(spy.count(), 1); + spy.clear(); + + emit testSignal(); + QCOMPARE(spy.count(), 0); + cleanup(); } @@ -1246,6 +1255,7 @@ { init(true); setRowCount(1); + mTestView->mModelReady = true; connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot())); connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); @@ -1300,18 +1310,23 @@ ///// // hint widget showing - // model not ready (need to use another slot for this) + // model not ready, row count zero. mTestView->mModelReady = false; + setRowCount(0); mTestView->mCurrentList = mUiLoader->findWidget(DOCML_NAME_VC_COLLECTIONWIDGET); - connect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot())); - emit testSignal(); + emit testLayoutChangedSignal(); QVERIFY(hintWidget->isVisible() == false ); QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); - disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot())); + + // model not ready, row count not zero. + setRowCount(1); + emit testLayoutChangedSignal(); + QVERIFY(hintWidget->isVisible() == false ); + QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); + QVERIFY(mTestView->mModelReady); // model ready, row count not zero mTestView->mModelReady = true; - setRowCount(1); emit testLayoutChangedSignal(); QVERIFY(hintWidget->isVisible() == false ); QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); @@ -1322,7 +1337,7 @@ QVERIFY(hintWidget->isVisible() == true ); QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel); - // model ready, row count is zero show to be false + // model ready, row count is zero, show to be false connect(this, SIGNAL(testSignal()), mTestView, SLOT(openCollectionViewSlot())); emit testSignal(); QVERIFY(hintWidget->isVisible() == false ); @@ -1519,6 +1534,8 @@ init(false); QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot()))); + HbInputDialog *dialog = new HbInputDialog(); + // not initialized, no mCurrentList emit testSignal(); QCOMPARE(HbInputDialog::mGetTextCallCount, 0); @@ -1528,28 +1545,36 @@ mTestView->activateView(TMPXItemId::InvalidId()); // dialog canceled - HbInputDialog::mGetTextFails = true; + HbInputDialog::mValueCallCount = 0; emit testSignal(); + dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 1); QCOMPARE(HbInputDialog::mGetTextCallCount, 1); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == ""); + QVERIFY(HbInputDialog::mValueCallCount == 1); // empty name - HbInputDialog::mGetTextFails = false; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mValueReturnValue = ""; HbInputDialog::mGetTextCallCount = 0; - HbInputDialog::mGetTextReturnValue = ""; emit testSignal(); + dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 0); QCOMPARE(HbInputDialog::mGetTextCallCount, 1); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == ""); + QVERIFY(HbInputDialog::mValueCallCount == 1); // Good case. - HbInputDialog::mGetTextReturnValue = "testAlbum"; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mValueReturnValue = "testAlbum"; HbInputDialog::mGetTextCallCount = 0; emit testSignal(); + dialog->emitDialogFinished(mTestView, SLOT(createCollectionDialogFinished(HbAction *)), 0); QCOMPARE(HbInputDialog::mGetTextCallCount, 1); QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "testAlbum"); + QVERIFY(HbInputDialog::mValueCallCount == 1); + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mValueReturnValue = ""; HbInputDialog::mGetTextCallCount = 0; - HbInputDialog::mGetTextReturnValue = QString(); VideoSortFilterProxyModelData::mLastAddedAlbumName = ""; disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot())); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h --- a/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 25 % +// Version : %version: 26 % #ifndef __TESTLISTWIDGET_H__ #define __TESTLISTWIDGET_H__ @@ -106,11 +106,6 @@ void testLongPressedSlot(); /** - * verifies panGesture - */ - void testPanGesture(); - - /** * verifies setContextMenu */ void testSetContextMenu(); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp --- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 47 % +// Version : %version: 49 % #include #include @@ -86,14 +86,6 @@ { VideoListWidget::longPressedSlot(item, point); } - - /** - * calls pangesture - */ - void callPanGesture(const QPointF &point) - { - VideoListWidget::panGesture(point); - } }; // --------------------------------------------------------------------------- @@ -653,38 +645,6 @@ } // --------------------------------------------------------------------------- -// testPanGesture -// --------------------------------------------------------------------------- -// -void TestListWidget::testPanGesture() -{ - QPointF point(1,1); - // no context menu - mTestWidget->callPanGesture(point); - QVERIFY(HbListView::mPanGesturePoint == point); - - // create context menu - VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance(); - VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); - mTestWidget->initialize(*model); - connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot())); - emit testSignal(); - disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot())); - - HbListView::mPanGesturePoint = QPointF(); - - // context menu visible - mTestWidget->mContextMenu->setVisible(true); - mTestWidget->callPanGesture(point); - QVERIFY(HbListView::mPanGesturePoint != point); - - // context menu not visible - mTestWidget->mContextMenu->setVisible(false); - mTestWidget->callPanGesture(point); - QVERIFY(HbListView::mPanGesturePoint == point); -} - -// --------------------------------------------------------------------------- // testSetContextMenu // --------------------------------------------------------------------------- // @@ -901,7 +861,10 @@ mTestWidget->initialize(*model); connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(deleteItemSlot())); + HbMessageBox *box = new HbMessageBox(); + // no model + VideoListDataModelData::mDataAccessCount = 0; VideoSortFilterProxyModel *tmp = mTestWidget->mModel; mTestWidget->mModel = 0; emit testSignal(); @@ -912,6 +875,7 @@ mTestWidget->mModel = tmp; // data fetched from item is invalid + VideoListDataModelData::mDataAccessCount = 0; setRowCount(1); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); @@ -921,6 +885,7 @@ setRowCount(0); // data is valid + VideoListDataModelData::mDataAccessCount = 0; setRowCount(1); QVariant data = QString("test"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); @@ -929,7 +894,8 @@ // messagebox question returns false HbMessageBoxData::mQuestionReturnValue = false; emit testSignal(); - QVERIFY(VideoListDataModelData::dataAccessCount() == 2); + box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 1); + QVERIFY(VideoListDataModelData::dataAccessCount() == 1); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid()); HbMessageBoxData::mLatestTxt = ""; @@ -938,10 +904,12 @@ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); // messagebox question returns true + VideoListDataModelData::mDataAccessCount = 0; VideoSortFilterProxyModelData::mDeleteItemsFails = false; HbMessageBoxData::mQuestionReturnValue = true; emit testSignal(); - QVERIFY(VideoListDataModelData::dataAccessCount() == 3); + box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(HbAction *)), 0); + QVERIFY(VideoListDataModelData::dataAccessCount() == 1); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0); @@ -957,6 +925,8 @@ VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance(); VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos); + HbInputDialog *dialog = new HbInputDialog(); + connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot())); VideoSortFilterProxyModelData::reset(); @@ -965,7 +935,8 @@ // Good case VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = "renamedVideo"; + HbInputDialog::mValueReturnValue = "renamedVideo"; + HbInputDialog::mValueCallCount = 0; HbInputDialog::mGetTextCallCount = 0; setRowCount(1); VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum)); @@ -973,61 +944,72 @@ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo"); QCOMPARE(HbInputDialog::mGetTextCallCount, 1); - + QVERIFY(HbInputDialog::mValueCallCount == 1); + // New name is same as previous - HbInputDialog::mGetTextReturnValue = QString(); + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; HbInputDialog::mGetTextCallCount = 0; VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; data = QString("albumName"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0); + QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); + QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); + + // Dialog canceled + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mGetTextCallCount = 0; + VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; + data = QString("albumName"); + VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); + mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); + emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); - // Getting name from input dialog fails - HbInputDialog::mGetTextFails = true; + // New name is empty. VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = QString(); + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; + HbInputDialog::mGetTextCallCount = 0; + data = QString("albumName"); + VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); + mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); + emit testSignal(); + dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0); + QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); + QCOMPARE(HbInputDialog::mGetTextCallCount, 1); + QVERIFY(HbInputDialog::mValueCallCount == 1); + + // Item is video + VideoSortFilterProxyModelData::mItemIds.clear(); + VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo)); + VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; + HbInputDialog::mValueReturnValue = ""; + HbInputDialog::mValueCallCount = 0; HbInputDialog::mGetTextCallCount = 0; data = QString("albumName"); VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); - - // New name is empty. - HbInputDialog::mGetTextFails = false; - VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = ""; - HbInputDialog::mGetTextCallCount = 0; - data = QString("albumName"); - VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); - mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); - emit testSignal(); - QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 1); - - // Item is video - VideoSortFilterProxyModelData::mItemIds.clear(); - VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo)); - HbInputDialog::mGetTextFails = false; - VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = ""; - HbInputDialog::mGetTextCallCount = 0; - data = QString("albumName"); - VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data); - mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); - emit testSignal(); - QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QVERIFY(HbInputDialog::mValueCallCount == 0); // No model VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = "renamedVideo"; + HbInputDialog::mValueReturnValue = "renamedVideo"; + HbInputDialog::mValueCallCount = 0; HbInputDialog::mGetTextCallCount = 0; VideoSortFilterProxyModelData::mItemIds.clear(); VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum)); @@ -1043,7 +1025,8 @@ // Variant data is invalid VideoSortFilterProxyModelData::mLastAlbumNameInRename = ""; - HbInputDialog::mGetTextReturnValue = "renamedVideo"; + HbInputDialog::mValueReturnValue = "renamedVideo"; + HbInputDialog::mValueCallCount = 0; HbInputDialog::mGetTextCallCount = 0; VideoSortFilterProxyModelData::mItemIds.clear(); VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum)); @@ -1052,7 +1035,7 @@ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex()); emit testSignal(); QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == ""); - QCOMPARE(HbInputDialog::mGetTextCallCount, 0); + QCOMPARE(HbInputDialog::mGetTextCallCount, 0); disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot())); } @@ -1233,6 +1216,7 @@ HbListView::mCurrentIndex = model->index(0, 0, QModelIndex()); connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeCollectionSlot())); + HbMessageBox *box = new HbMessageBox(); setRowCount(2); TMPXItemId savedId = TMPXItemId(1,1); @@ -1258,6 +1242,7 @@ // valid data VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, "test"); emit testSignal(); + box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 0); QVERIFY(VideoSortFilterProxyModelData::mLastIndex.isValid()); QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 1); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); @@ -1267,6 +1252,7 @@ HbMessageBoxData::mLatestTxt = ""; HbMessageBoxData::mQuestionReturnValue = false; emit testSignal(); + box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(HbAction *)), 1); QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid()); QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty()); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp --- a/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Thu May 27 12:53:14 2010 +0300 @@ -211,6 +211,15 @@ mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&))); + + // first test the findWidget with loadIfNotFound == false. + bannerWidget = + mTestObject->findWidget( + DOCML_NAME_VC_HEADINGBANNER, false); + QVERIFY(!bannerWidget); + QVERIFY(!mObjects.contains(DOCML_NAME_VC_HEADINGBANNER)); + + // then with default value. bannerWidget = mTestObject->findWidget( DOCML_NAME_VC_HEADINGBANNER); @@ -295,6 +304,13 @@ // -object added in loading queue params.append(addToCollectionParam); mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&))); + + // first test with loadIfNotFound == false + addToCollection = mTestObject->findObject(DOCML_NAME_ADD_TO_COLLECTION, false); + QVERIFY(!addToCollection); + QVERIFY(!mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION)); + + // then with default value. addToCollection = mTestObject->findObject(DOCML_NAME_ADD_TO_COLLECTION); QVERIFY(addToCollection); QVERIFY(mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION)); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp --- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Thu May 27 12:53:14 2010 +0300 @@ -22,10 +22,11 @@ #include "hbdocumentloader.h" #include "hbstackedwidget.h" #include "hbcheckbox.h" +#include "hbinputdialog.h" #include "hbdialog.h" #include "hbwidget.h" #include "hblistview.h" -#include "hbinputdialog.h" +#include "hbmessagebox.h" #include "testvideolistselectiondialog.h" @@ -590,33 +591,35 @@ QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(0) == TMPXItemId(1,0)); QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(1) == TMPXItemId(2,0)); + HbInputDialog *dialog = new HbInputDialog(); VideoCollectionViewUtilsData::mLastError = -1; // mSelectedAlbumId == TMPXItemId::InvalidId()) mpxId = TMPXItemId::InvalidId(); - // queryNewAlbumSelected does not set selected - HbInputDialog::mGetTextFails = true; + // query for new album name does not set selected mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId); mTestObject->mSelectedVideos.insert(TMPXItemId(1,0)); mTestObject->mSelectedVideos.insert(TMPXItemId(2,0)); VideoSortFilterProxyModelData::reset(); VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId::InvalidId(); - mTestObject->exec(); + mTestObject->exec(); + dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 1); // No selected. // type of selection does not change - QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::ESelectCollection); + QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection); // since there's no selected videos, status code does not change QVERIFY(VideoCollectionViewUtilsData::mLastError == -1); QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId()); QVERIFY(!VideoSortFilterProxyModelData::mItemIds.count()); - // queryNewAlbumSelected sets selected - HbInputDialog::mGetTextFails = false; + // query for new album name sets selected mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId); mTestObject->mSelectedVideos.insert(TMPXItemId(1,0)); mTestObject->mSelectedVideos.insert(TMPXItemId(2,0)); VideoSortFilterProxyModelData::reset(); VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId(1,2); + HbInputDialog::mValueReturnValue = QVariant(QString("testname")); mTestObject->exec(); + dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 0); // Yes selected. // type of selection has changed QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection); // videos added into collection @@ -679,13 +682,13 @@ VideoCollectionViewUtilsData::mLastError = -1; // selected album exist, selected videos exists, name for selected album exist // (using ESelectCollection type to fetch albumname) - HbInputDialog::mGetTextFails = false; mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, mpxId); mTestObject->mSelectedVideos.insert(TMPXItemId(1,0)); mTestObject->mSelectedVideos.insert(TMPXItemId(2,0)); VideoSortFilterProxyModelData::reset(); VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId(1,2); - mTestObject->exec(); + mTestObject->exec(); + dialog->emitDialogFinished(mTestObject, SLOT(newAlbumNameDialogFinished(HbAction *)), 0); // Yes selected. // type of selection has changed QVERIFY(mTestObject->mTypeOfSelection == VideoListSelectionDialog::EAddToCollection); // videos added into collection diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/data/icons/pri_large_video.svg --- a/videocollection/videocollectionwrapper/data/icons/pri_large_video.svg Fri May 14 15:53:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc --- a/videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc Fri May 14 15:53:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - icons/pri_large_video.svg - - diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h --- a/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Thu May 27 12:53:14 2010 +0300 @@ -112,6 +112,11 @@ * @param itemId, item that has been modified. */ virtual void itemModifiedSlot(const TMPXItemId &itemId) = 0; + + /** + * Signalled when list is complete. + */ + virtual void listCompleteSlot() = 0; }; #endif // __VIDEOMODELOBSERVER_H diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h --- a/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Thu May 27 12:53:14 2010 +0300 @@ -183,6 +183,11 @@ * @param itemId, item that has been modified. */ void itemModifiedSlot(const TMPXItemId &itemId); + + /** + * Signalled when list is complete. + */ + void listCompleteSlot(); public: // services diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h --- a/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/inc/videothumbnaildata_p.h Thu May 27 12:53:14 2010 +0300 @@ -179,6 +179,17 @@ * */ const QIcon* defaultThumbnail(TMPXItemId mediaId); + + /** + * Loads icon from file or resource, the icon is scaled to size of the + * video list view thumbnail. + * + * @param iconName name of the file or resource. + * + * @return HbIcon the icon load from resource or file. + * + */ + HbIcon loadIcon(QString iconName); /** * Starts timer that continues the background thumbnail fetching at timeout. @@ -258,11 +269,6 @@ * - data is the actual thumbnail data. */ QHash mDefaultThumbnails; - - /** - * Default thumbnail for a category. - */ - QIcon *mDefaultTnCategory; /** * Current model, set at call to startBackgroundFetching. diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/src/videocollectionlistener.cpp --- a/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 32 % +// Version : %version: 33 % // INCLUDE FILES #include @@ -120,19 +120,25 @@ if(categoryOrAlbumVideoList) { + // checks if there are new videos in the list that are not yet in our data model. + mSignalReceiver.newVideoListSlot(array); + mSignalReceiver.albumListAvailableSlot(pathId, array); - - // Update also all video list in case this is a default category. - if(pathId.iId2 == KVcxMvcMediaTypeCategory) - { - mSignalReceiver.newVideoListSlot(array); - } } else { mSignalReceiver.newVideoListSlot(array); } - } + + int listCompleted(-1); + if(mVideoUtils.mediaValue(&aEntries, KVcxMediaMyVideosInt32Value, listCompleted)) + { + if(listCompleted == EVcxMyVideosVideoListComplete) + { + mSignalReceiver.listCompleteSlot(); + } + } +} // ----------------------------------------------------------------------------- // HandleOpenL diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp --- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 37 % +// Version : %version: 38 % // INCLUDE FILES #include @@ -451,8 +451,8 @@ // signal that album has been updated emit q_ptr->albumChanged(); - // signal that model is ready - emit q_ptr->modelReady(); + // signal that model has changed. + emit q_ptr->modelChanged(); } @@ -497,9 +497,8 @@ { q_ptr->beginInsertRows(QModelIndex(), startIndex, endIndex); q_ptr->endInsertRows(); + emit q_ptr->modelChanged(); } - - emit q_ptr->modelReady(); } // ----------------------------------------------------------------------------- @@ -890,4 +889,13 @@ } } +// ----------------------------------------------------------------------------- +// listCompleteSlot +// ----------------------------------------------------------------------------- +// +void VideoListDataModelPrivate::listCompleteSlot() +{ + emit q_ptr->modelReady(); +} + // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp --- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,12 +15,13 @@ * */ -// Version : %version: 21 % +// Version : %version: 24 % // INCLUDE FILES #include #include #include +#include #include #include @@ -45,12 +46,16 @@ // Priority for background thumbnail fetches. const int BACKGROUND_FETCH_PRIORITY = 3000; +// Size for default thumbnail, these match with large thumbnail in lists. +const int DEFAULT_THUMBNAIL_WIDTH = 114; +const int DEFAULT_THUMBNAIL_HEIGHT = 64; + /** * global qHash function required fo creating hash values for TMPXItemId -keys */ inline uint qHash(TMPXItemId key) -{ - QPair keyPair(key.iId1, key.iId2); +{ + QPair keyPair(key.iId1, key.iId2); return qHash(keyPair); } @@ -430,7 +435,7 @@ { if(!mDefaultThumbnails.contains(defaultIdVideo)) { - mDefaultThumbnails[defaultIdVideo] = HbIcon(":/icons/default_thumbnail_video.svg"); + mDefaultThumbnails[defaultIdVideo] = loadIcon("qtg_large_video"); } return &mDefaultThumbnails[defaultIdVideo].qicon(); } @@ -441,7 +446,7 @@ { if(!mDefaultThumbnails.contains(defaultIdAlbum)) { - mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection"); + mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection"); } return &mDefaultThumbnails[defaultIdAlbum].qicon(); } @@ -453,7 +458,7 @@ { if(!mDefaultThumbnails.contains(defaultIdDownloads)) { - mDefaultThumbnails[defaultIdDownloads] = HbIcon("qtg_large_video_download"); + mDefaultThumbnails[defaultIdDownloads] = loadIcon("qtg_large_video_download"); } return &mDefaultThumbnails[defaultIdDownloads].qicon(); } @@ -462,7 +467,7 @@ { if(!mDefaultThumbnails.contains(defaultIdCaptured)) { - mDefaultThumbnails[defaultIdCaptured] = HbIcon("qtg_large_video_capture"); + mDefaultThumbnails[defaultIdCaptured] = loadIcon("qtg_large_video_capture"); } return &mDefaultThumbnails[defaultIdCaptured].qicon(); } @@ -471,7 +476,7 @@ { if(!mDefaultThumbnails.contains(defaultIdAlbum)) { - mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection"); + mDefaultThumbnails[defaultIdAlbum] = loadIcon("qtg_large_video_collection"); } return &mDefaultThumbnails[defaultIdAlbum].qicon(); } @@ -480,6 +485,56 @@ } // ----------------------------------------------------------------------------- +// VideoThumbnailDataPrivate::loadIcon() +// ----------------------------------------------------------------------------- +// +HbIcon VideoThumbnailDataPrivate::loadIcon(QString iconName) +{ + HbIcon icon(iconName); + + if(!icon.isNull()) + { + QPixmap dest = QPixmap(DEFAULT_THUMBNAIL_WIDTH, DEFAULT_THUMBNAIL_HEIGHT); + + // Scale the icon into the thumbnail area. + QPixmap source = icon.pixmap(); + // Smooth scaling is very expensive (size^2). Therefore we reduce the size + // to 2x of the destination size and using fast transformation before doing final smooth scaling. + if(source.size().width() > (6*dest.width()) || source.size().height() > (6*dest.height())) + { + QSize intermediate_size = QSize( dest.width() * 2, dest.height() * 2 ); + source = source.scaled(intermediate_size, Qt::KeepAspectRatio, Qt::FastTransformation ); + } + QPixmap scaled = source.scaled(dest.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + + // Center the icon. + int xDiff = 0; + int yDiff = 0; + if(dest.width() > scaled.width()) + { + xDiff = (dest.width() - scaled.width()) / 2; + } + if(dest.height() > scaled.height()) + { + yDiff = (dest.height() - scaled.height()) / 2; + } + + // Paint it. + QPainter painter(&dest); + painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.fillRect(dest.rect(), Qt::transparent); + painter.drawPixmap(xDiff, yDiff, scaled.width(), scaled.height(), scaled); + painter.end(); + + return HbIcon(dest); + } + else + { + return HbIcon(); + } +} + +// ----------------------------------------------------------------------------- // VideoThumbnailDataPrivate::removeThumbnail() // ----------------------------------------------------------------------------- // diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Thu May 27 12:53:14 2010 +0300 @@ -123,10 +123,18 @@ /** * No implementation needed for these tests */ - virtual void itemModifiedSlot(const TMPXItemId &itemId) + void itemModifiedSlot(const TMPXItemId &itemId) { Q_UNUSED(itemId); } + + /** + * No implementation needed for these tests + */ + void listCompleteSlot() + { + + } }; diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/mediaobjectfactory.h Thu May 27 12:53:14 2010 +0300 @@ -52,7 +52,7 @@ * * @return CMPXMedia */ - CMPXMedia* newMedia(int id = -1, int id2 = 0 ); + CMPXMedia* newMedia(int id = -1, int id2 = 0); /** * appends media object to mediaarray diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Thu May 27 12:53:14 2010 +0300 @@ -58,7 +58,7 @@ // newMedia // ----------------------------------------------------------------------------- // -CMPXMedia* MediaObjectFactory::newMedia(int id1, int id2 ) +CMPXMedia* MediaObjectFactory::newMedia(int id1, int id2) { CMPXMedia *media = NULL; TRAP_IGNORE(media = CMPXMedia::NewL()); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Thu May 27 12:53:14 2010 +0300 @@ -187,7 +187,8 @@ CMPXCollectionPath* collectionPath = 0; TRAP_IGNORE( collectionPath = CMPXCollectionPath::NewL(); - collectionPath->AppendL( KVcxUidMyVideosMpxCollection );); + collectionPath->AppendL( KVcxUidMyVideosMpxCollection ); + ); // empty array, path exists level incorrect (new video list, not category neither album level) mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); @@ -204,7 +205,8 @@ collectionPath->AppendL( KVcxUidMyVideosMpxCollection ); collectionPath->AppendL( KVcxMvcCategoryIdAll);); - // array of items from different levels, everything is reported + // array of items from different levels, everything is reported + // first call does not contain the KVcxMediaMyVideosInt32Value. mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelCategory); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(1, 2)); mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); @@ -213,15 +215,19 @@ arrayToTest = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(arrayToTest != 0); QVERIFY(arrayToTest->Count() == array->Count()); + QVERIFY(mSignalReceiver->getListComplete() == false); - mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelVideos); delete array; - array = mMediaFactory->newMediaArray(); + array = mMediaFactory->newMediaArray(); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(1)); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(2)); mMediaFactory->putArrayContent(array, mMediaFactory->newMedia(3)); + // second call contains the KVcxMediaMyVideosInt32Value, but it's not equal to EVcxMyVideosVideoListComplete + int invalid(-100); + mMediaFactory->putTValue(media, KVcxMediaMyVideosInt32Value, invalid); + mMediaFactory->putValuePtr(media, KMPXMediaArrayContents, array); mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 ); @@ -229,6 +235,7 @@ arrayToTest = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(arrayToTest != 0); QVERIFY(arrayToTest->Count() == array->Count()); + QVERIFY(mSignalReceiver->getListComplete() == false); delete collectionPath; collectionPath = 0; @@ -238,12 +245,16 @@ collectionPath->AppendL( KVcxMvcMediaTypeCategory);); mMediaFactory->putValuePtr(media, KMPXMediaGeneralContainerPath, collectionPath); + // third call contains KVcxMediaMyVideosInt32Value with value EVcxMyVideosVideoListComplete. + int listComplete(EVcxMyVideosVideoListComplete); + mMediaFactory->putTValue(media, KVcxMediaMyVideosInt32Value, listComplete); + mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 ); arrayToTest = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(arrayToTest != 0); QVERIFY(arrayToTest->Count() == array->Count()); - + QVERIFY(mSignalReceiver->getListComplete()); CMPXMediaArray *gottenArray = static_cast(mSignalReceiver->getLatestPointerAddr()); QVERIFY(gottenArray->Count() == 3); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Thu May 27 12:53:14 2010 +0300 @@ -74,6 +74,11 @@ */ int getLatestIntegerData(); + /** + * return mListComplete + */ + bool getListComplete(); + public slots: /** @@ -133,6 +138,11 @@ */ virtual void itemModifiedSlot(const TMPXItemId &itemId); + /** + * Sets boolean mListComplete to true; + */ + void listCompleteSlot(); + private: /** * Contains address of latest pointer passed to object @@ -158,6 +168,11 @@ * contains contents of list received from signal */ QList mLatesListData; + + /** + * True if listCompleteSlot has been called. + */ + bool mListComplete; }; #endif diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Thu May 27 12:53:14 2010 +0300 @@ -25,7 +25,8 @@ mLatestPtr(0), mLatestItemId(TMPXItemId::InvalidId()), mLatestModifiedItemId(TMPXItemId::InvalidId()), -mLatestInteger(-1) +mLatestInteger(-1), +mListComplete(false) { } @@ -50,6 +51,7 @@ mLatestModifiedItemId = TMPXItemId::InvalidId(); mLatesListData.clear(); mLatestInteger = -1; + mListComplete = false; } // ----------------------------------------------------------------------------- @@ -99,6 +101,15 @@ } // ----------------------------------------------------------------------------- +// getListComplete +// ----------------------------------------------------------------------------- +// +bool StubSignalReceiver::getListComplete() +{ + return mListComplete; +} + +// ----------------------------------------------------------------------------- // newVideoListSlot // ----------------------------------------------------------------------------- // @@ -204,6 +215,15 @@ } // ----------------------------------------------------------------------------- +// listCompleteSlot +// ----------------------------------------------------------------------------- +// +void StubSignalReceiver::listCompleteSlot() +{ + mListComplete = true; +} + +// ----------------------------------------------------------------------------- // albumRemoveFailureSlot // ----------------------------------------------------------------------------- // diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Thu May 27 12:53:14 2010 +0300 @@ -315,7 +315,12 @@ * not used in stub */ void itemDeletedSlot(TMPXItemId id); - + + /** + * not used in stub + */ + void listCompleteSlot(); + public: /** diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Thu May 27 12:53:14 2010 +0300 @@ -515,4 +515,12 @@ Q_UNUSED(id); } +// ----------------------------------------------------------------------------- +// listCompleteSlot +// ----------------------------------------------------------------------------- +// +void VideoListDataModelPrivate::listCompleteSlot() +{ +} + // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Thu May 27 12:53:14 2010 +0300 @@ -88,6 +88,11 @@ */ void signalVideoDetailsCompleted(CMPXMedia*); + /** + * emitted to get listCompleteSlot to be called. + */ + void signalListCompleteSlot(); + // test functions for the test framework private slots: /** @@ -248,6 +253,11 @@ * verifies getMediaIdFromIndex when fetching collections */ void testGetCollectionIdFromIndex(); + + /** + * verifies listCompleteSlot + */ + void testListCompleteSlot(); private: diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Thu May 27 12:53:14 2010 +0300 @@ -397,7 +397,7 @@ TDateTime dateTime; - dateTime.Set(date.date().year(), TMonth(date.date().month() - 1), date.date().day(), + dateTime.Set(date.date().year(), TMonth(date.date().month() - 1), date.date().day() - 1, date.time().hour(), date.time().minute(), date.time().second(), date.time().msec()); TTime ttimeDate(dateTime); diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Thu May 27 12:53:14 2010 +0300 @@ -717,7 +717,7 @@ VideoListDataModel::mFirstRemoved = -1; VideoListDataModel::mLastRemoved = -1; - QSignalSpy spyModelReady(mStubModel, SIGNAL(modelReady())); + QSignalSpy spyModelChanged(mStubModel, SIGNAL(modelChanged())); mMediaFactory->removeArray(); mMediaFactory->createMediaItems(MEDIA_COUNT); @@ -728,8 +728,8 @@ QVERIFY(VideoListDataModel::mLastInserted == MEDIA_COUNT - 1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 1); - spyModelReady.clear(); + QCOMPARE(spyModelChanged.count(), 1); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -743,7 +743,7 @@ QVERIFY(VideoListDataModel::mLastInserted == -1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 0); + QCOMPARE(spyModelChanged.count(), 0); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -758,8 +758,8 @@ QVERIFY(VideoListDataModel::mLastInserted == -1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 1); - spyModelReady.clear(); + QCOMPARE(spyModelChanged.count(), 0); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -773,8 +773,8 @@ QVERIFY(VideoListDataModel::mLastInserted == -1); QVERIFY(VideoListDataModel::mFirstRemoved == -1); QVERIFY(VideoListDataModel::mLastRemoved == -1); - QCOMPARE(spyModelReady.count(), 1); - spyModelReady.clear(); + QCOMPARE(spyModelChanged.count(), 0); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; VideoListDataModel::mFirstRemoved = -1; @@ -818,6 +818,7 @@ // send 10 videos mMediaFactory->createMediaItems(10); emit signalNewVideoList(mMediaFactory->copyOfMediaArray()); + spyModelChanged.clear(); VideoListDataModel::mFirstInserted = -1; VideoListDataModel::mLastInserted = -1; @@ -1413,6 +1414,18 @@ disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))); } +// ----------------------------------------------------------------------------- +// testListCompleteSlot +// ----------------------------------------------------------------------------- +// +void TestVideoModel_p::testListCompleteSlot() +{ + QVERIFY(connect(this, SIGNAL(signalListCompleteSlot()), mTestObject, SLOT(listCompleteSlot()))); + QSignalSpy spy(mStubModel, SIGNAL(modelReady())); + emit signalListCompleteSlot(); + QCOMPARE(spy.count(), 1); +} + // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videocollectionwrapper/videocollectionwrapper.pro --- a/videocollection/videocollectionwrapper/videocollectionwrapper.pro Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videocollectionwrapper/videocollectionwrapper.pro Thu May 27 12:53:14 2010 +0300 @@ -75,5 +75,3 @@ -lestor.dll \ -lcentralrepository.dll \ -lflogger.dll - -RESOURCES += data/videocollectionwrapper.qrc diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/data/pri_large_video.svg --- a/videocollection/videofiledetailsview/data/pri_large_video.svg Fri May 14 15:53:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/data/videofiledetails.qrc --- a/videocollection/videofiledetailsview/data/videofiledetails.qrc Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videofiledetailsview/data/videofiledetails.qrc Thu May 27 12:53:14 2010 +0300 @@ -2,7 +2,4 @@ videofiledetails.xml - - pri_large_video.svg - diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/data/videofiledetails.xml --- a/videocollection/videofiledetailsview/data/videofiledetails.xml Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videofiledetailsview/data/videofiledetails.xml Thu May 27 12:53:14 2010 +0300 @@ -1,5 +1,5 @@ - + @@ -20,7 +20,7 @@ - + @@ -34,32 +34,22 @@ + + +
- - - - - - - - - - - - - - - + - + + - + @@ -67,16 +57,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - -
@@ -84,55 +98,54 @@ - + + + - + - + + - + - - - - - - - - - - - + + + - - + - - + - + + + + + + - - - - - - - + + + + + + + + + + + - - - diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp --- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 73 % +// Version : %version: 76 % // INCLUDE FILES #include @@ -46,10 +46,18 @@ #include "videodetailslabel.h" #include "videocollectiontrace.h" +// Object names. +const char* const VIDEO_DETAILS_OBJECT_NAME_THUMBLABEL = "vc:FileDetailsThumbnailLabel"; +const char* const VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO = "vc:FileDetailsMessageBoxDeleteVideo"; +const char* const VIDEO_DETAILS_OBJECT_NAME_MESSAGE_BOX_WARNING = "vc:FileDetailsMessageBoxWarning"; +const char* const VIDEO_DETAILS_OBJECT_NAME_DELETE_ACTION = "vc:FileDetailsDelete"; +const char* const VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK = "vc:FileDetailsNavKeyBack"; +const char* const VIDEO_DETAILS_OBJECT_NAME_TITLE_ANIM = "vc:FileDetailsTitleAnim"; + +// Docml constants. const char* const VIDEO_DETAILS_DOCML = ":/xml/videofiledetails.docml"; const char* const VIDEO_DETAILS_PORTRAIT = "portrait"; const char* const VIDEO_DETAILS_LANDSCAPE = "landscape"; -const char* const VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg"; const char* const VIDEO_DETAILS_VIEW = "videofiledetailsview"; const char* const VIDEO_DETAILS_TITLE = "mLblTitle"; const char* const VIDEO_DETAILS_THUMBNAIL = "mDetailsLabel"; @@ -57,6 +65,11 @@ const char* const VIDEO_DETAILS_MENUACTION_DELETE = "mOptionsDelete"; const char* const VIDEO_DETAILS_LISTWIDGET = "mDetailsList"; +// Default thumbnail. +const char* const VIDEO_DETAILS_GFX_DEFAULT = "qtg_large_video"; + +const int VIDEO_DETAILS_SECONDARY_TEXT_ROW_COUNT = 255; + // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- @@ -136,6 +149,7 @@ spec.setRole( HbFontSpec::Primary ); mTitleAnim->setFontSpec( spec ); mTitleAnim->setLoopCount(-1); + mTitleAnim->setObjectName(VIDEO_DETAILS_OBJECT_NAME_TITLE_ANIM); connect(mModel->sourceModel(), SIGNAL(shortDetailsReady(TMPXItemId)), @@ -160,9 +174,9 @@ // no deallocation needed for this since // stackedwidget takes ownership mThumbLabel = new VideoDetailsLabel; - mThumbLabel->setAlignment(Qt::AlignCenter); - + mThumbLabel->setObjectName(VIDEO_DETAILS_OBJECT_NAME_THUMBLABEL); + connect(mThumbLabel, SIGNAL(clicked(bool)), this, SLOT(startPlaybackSlot())); thumbWidget->addWidget(mThumbLabel); @@ -183,6 +197,7 @@ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to delete action."); return; } + deleteAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_ACTION); if (mIsService) { @@ -195,7 +210,8 @@ // Create navigation keys. mNavKeyBackAction = new HbAction(Hb::BackNaviAction); - + mNavKeyBackAction->setObjectName(VIDEO_DETAILS_OBJECT_NAME_NAVKEY_BACK); + if (!mThumbnailManager) { mThumbnailManager = new ThumbnailManager(); @@ -212,7 +228,6 @@ } list->setEnabledAnimations(HbAbstractItemView::None); - } // --------------------------------------------------------------------------- @@ -484,19 +499,17 @@ list->clear(); } - //TODO: define maximum line count once >3 supported HbListViewItem *prototype = list->listItemPrototype(); - prototype->setSecondaryTextRowCount(1, 3); + prototype->setSecondaryTextRowCount(1, VIDEO_DETAILS_SECONDARY_TEXT_ROW_COUNT); for(int i = 0; i< detailCount; i++) { if (metadata.contains(VideoDetailLabelKeys[i])) { HbListWidgetItem* listWidgetItem = new HbListWidgetItem(); listWidgetItem->setEnabled(false); - - listWidgetItem->setText( hbTrId(VideoDetailLabels[i]) ); - listWidgetItem->setSecondaryText( metadata[VideoDetailLabelKeys[i]].toString() ); - list->addItem( listWidgetItem ); + listWidgetItem->setText( hbTrId(VideoDetailLabels[i])); + listWidgetItem->setSecondaryText(metadata[VideoDetailLabelKeys[i]].toString()); + list->addItem(listWidgetItem); } } @@ -578,8 +591,8 @@ HbMessageBox *messageBox = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion); messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_DELETE_VIDEO); messageBox->open(this, SLOT(deleteVideoDialogFinished(HbAction *))); - } } } @@ -613,7 +626,6 @@ mModel->deleteItems(list); } - // --------------------------------------------------------------------------- // Slot: rowsRemovedSlot // --------------------------------------------------------------------------- @@ -643,7 +655,7 @@ QString msg(""); if(errorCode == VideoCollectionCommon::statusSingleDeleteFail) { - QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current"); + QString format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current"); if(additional.isValid()) { msg = format.arg(additional.toString()); @@ -652,7 +664,10 @@ if(msg.count() > 0) { // show msg box if there's something to show - HbMessageBox::warning(msg); + HbMessageBox *messageBox = new HbMessageBox(msg, HbMessageBox::MessageTypeWarning); + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->setObjectName(VIDEO_DETAILS_OBJECT_NAME_MESSAGE_BOX_WARNING); + messageBox->show(); } } @@ -854,4 +869,4 @@ XQ_EXPORT_PLUGIN2( videofiledetailsview, VideoFileDetailsViewPlugin ); -// end of file +// End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp --- a/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -47,7 +47,7 @@ #include "videofiledetailsviewplugin.h" #undef private -const char *TEST_VIDEO_DETAILS_GFX_DEFAULT = ":/gfx/pri_large_video.svg"; +const char *TEST_VIDEO_DETAILS_GFX_DEFAULT = "qtg_large_video"; const char *TEST_VIDEO_DETAILS_VIEW = "videofiledetailsview"; const char *TEST_VIDEO_DETAILS_WIDGET = "mContent"; const char *TEST_VIDEO_DETAILS_TITLE = "mLblTitle"; @@ -595,7 +595,7 @@ QVERIFY( deleteAction != 0 ); deleteAction->trigger(); - QCOMPARE( mDummyModel->dataAccessCount(), 0 ); + QCOMPARE( mDummyModel->dataAccessCount(), 0 ); mPlugin->mVideoId = (0,0); mDummyModel->setDataReturnInvalid(true); @@ -612,6 +612,8 @@ QCOMPARE( mDummyModel->dataAccessCount(), 2 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted. + + HbMessageBox *msgBox = new HbMessageBox(); QStringList display; display.append("first row"); @@ -620,16 +622,15 @@ QString expectedText = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg( display.first()); - - HbMessageBox::mQuestionReturnValue = true; deleteAction->trigger(); + msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 0); // Yes selected QCOMPARE( mDummyModel->dataAccessCount(), 3 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() ); QCOMPARE( HbMessageBox::mLatestTxt, expectedText ); - HbMessageBox::mQuestionReturnValue = false; deleteAction->trigger(); + msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected QCOMPARE( mDummyModel->dataAccessCount(), 4 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), expected.row() ); @@ -637,13 +638,14 @@ mDummyModel->reset(); - HbMessageBox::mQuestionReturnValue = false; deleteAction->trigger(); + msgBox->emitDialogFinished(mPlugin, SLOT(deleteVideoDialogFinished(HbAction *)), 1); // No selected QCOMPARE( mDummyModel->dataAccessCount(), 1 ); QVERIFY( mDummyModel->lastIndex() == expected ); QCOMPARE( mDummyModel->deleteFileIndex(), -1 ); // verify that no file was deleted. QCOMPARE( HbMessageBox::mLatestTxt, expectedText ); + delete msgBox; cleanup(); } diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h --- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/hbmessagebox.h Thu May 27 12:53:14 2010 +0300 @@ -19,23 +19,37 @@ #ifndef HBMESSAGEBOX_H #define HBMESSAGEBOX_H +#include #include +#include +#include + +class HbMessageBox : public QObject +{ + Q_OBJECT +public: -class HbMessageBox -{ - -public: + enum MessageBoxType { + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + + HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0); + ~HbMessageBox(); + + void show(); /** - * saves provided text to mLatestTxt - * returns mQuestionReturnValue + * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence. */ - static bool question(QString text) - { - mLatestTxt = text; - return mQuestionReturnValue; - } + void open( QObject* receiver = 0, const char* member = 0 ); + + void emitDialogFinished( QObject* receiver, const char* member, int actionNum ); + + void setAttribute(int attribute); /** * saves provided text to mLatestTxt @@ -53,18 +67,26 @@ mLatestTxt = text; } - /** - * returned from question - */ - static bool mQuestionReturnValue; + QList actions() const + { + return mActions; + } /** * saved text */ static QString mLatestTxt; + static int mType; + static int mAttribute; + static int mOpenCallCount; + static int mShowCallCount; + + QList mActions; + +signals: + + void finished(HbAction *action); }; - - #endif // HBMESSAGEBOX_H diff -r b9e04db066d4 -r 7d93ee07fb27 videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp --- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp Thu May 27 12:53:14 2010 +0300 @@ -17,10 +17,65 @@ #include "hbmessagebox.h" -bool HbMessageBox::mQuestionReturnValue = false; +QString HbMessageBox::mLatestTxt = ""; +int HbMessageBox::mType = -1; +int HbMessageBox::mAttribute = -1; +int HbMessageBox::mOpenCallCount = 0; +int HbMessageBox::mShowCallCount = 0; -QString HbMessageBox::mLatestTxt = ""; +HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + HbMessageBox::mType = type; + + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); +} + +HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + HbMessageBox::mLatestTxt = text; + HbMessageBox::mType = type; + + HbAction *action = new HbAction(); + mActions.append(action); + action = new HbAction(); + mActions.append(action); +} +HbMessageBox::~HbMessageBox() +{ + while(!mActions.isEmpty()) + { + delete mActions.takeFirst(); + } +} +void HbMessageBox::show() +{ + HbMessageBox::mShowCallCount++; +} +void HbMessageBox::open( QObject* receiver, const char* member ) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); + HbMessageBox::mOpenCallCount++; +} +void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum ) +{ + if(connect(this, SIGNAL(finished(HbAction *)), receiver, member)) + { + emit finished(mActions.value(actionNum)); + disconnect(this, SIGNAL(finished(HbAction *)), receiver, member); + } +} + +void HbMessageBox::setAttribute(int attribute) +{ + HbMessageBox::mAttribute = attribute; +} diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 10 % +// Version : %version: 11 % @@ -37,7 +37,6 @@ public: QMPXVideoPlaybackFileDetailsWidget( QMPXVideoPlaybackControlsController* controller ); virtual ~QMPXVideoPlaybackFileDetailsWidget(); - void initialize(); public: void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#11 % +// Version : %version: da1mmcf#12 % @@ -26,7 +26,6 @@ #include class QTimer; -class HbFrameItem; class HbProgressSlider; class QMPXVideoPlaybackViewFileDetails; class QMPXVideoPlaybackControlsController; @@ -59,7 +58,6 @@ private: QMPXVideoPlaybackControlsController *mController; HbProgressSlider *mProgressSlider; - HbFrameItem *mFrameItem; int mDuration; int mDraggingPosition; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h --- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackstatuspanecontrol.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 9 % +// Version : %version: 10 % @@ -28,7 +28,8 @@ class HbLabel; class HbAction; -class HbFrameItem; +class HbGroupBox; +class QGraphicsWidget; class QMPXVideoPlaybackViewFileDetails; class QMPXVideoPlaybackControlsController; @@ -73,7 +74,8 @@ bool mVisible; HbAction *mActionBack; HbLabel *mTitleLabel; - HbFrameItem *mFrameItem; + HbGroupBox *mTitleGroupBox; + QGraphicsWidget *mTitleLayout; }; #endif /*MPXVIDEOPLAYBACKSTATUSPANECONTROL_H_*/ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#37 % +// Version : %version: da1mmcf#39 % @@ -26,18 +26,15 @@ #include #include -#include #include #include #include -#include -#include -#include #include #include #include #include +#include #include "mpxvideoviewwrapper.h" #include "hbvideobaseplaybackview.h" @@ -93,12 +90,22 @@ { MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()")); + mOrientation = hbInstance->allMainWindows()[0]->orientation(); + bool ok = connect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ), + this, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); + + MPX_DEBUG( + _L("QMPXVideoPlaybackControlsController::initializeController() orientation = %d, ok =%d"), + mOrientation, ok ); + setParent( mView ); + mView->hideItems( Hb::AllItems ); + // // Create layout loader // - bool ok = false; + ok = false; mLoader = new QMPXVideoPlaybackDocumentLoader( this ); mLoader->load( KMPXPLAYBACKVIEW_XML, &ok ); @@ -180,9 +187,10 @@ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()")); disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) ); - disconnect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) ); disconnect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) ); + disconnect( hbInstance->allMainWindows()[0], SIGNAL( orientationChanged( Qt::Orientation ) ), + this, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); mView->setWidget( NULL ); @@ -280,21 +288,6 @@ mVolumeControl->setValue( 0 ); mVolumeControl->setEnabled( false ); } - - // - // If title is not available, show clip name - // - QString title = mFileDetails->mTitle; - - if ( title.count() == 0 ) - { - QFileInfo fileInfo( mFileDetails->mClipName ); - title = fileInfo.baseName (); - } - - QGraphicsWidget *widget = mLoader->findWidget( QString( "title" ) ); - HbLabel *titleLabel = qobject_cast( widget ); - titleLabel->setPlainText( title ); } // ------------------------------------------------------------------------------------------------- @@ -578,7 +571,6 @@ QGraphicsWidget *widget = mLoader->findWidget( QString( "fileDetailsLayout" ) ); QMPXVideoPlaybackFileDetailsWidget *fileDetails = qobject_cast( widget ); - fileDetails->initialize(); control = new QMPXVideoPlaybackFullScreenControl( this, controlIndex, @@ -713,7 +705,7 @@ resetDisappearingTimers( EMPXTimerReset ); - if ( ! mViewTransitionIsGoingOn ) + if ( ! mViewTransitionIsGoingOn && mOrientation == Qt::Horizontal ) { for ( int i = 0 ; i < mControls.count() ; i++ ) { @@ -728,7 +720,7 @@ // bool QMPXVideoPlaybackControlsController::isVisible() { - bool visible = EFalse; + bool visible = false; for ( int i = 0 ; i < mControls.count() ; i++ ) { @@ -736,7 +728,7 @@ { if ( mControls[i]->isVisible() ) { - visible = ETrue; + visible = true; } break; @@ -877,7 +869,7 @@ // bool QMPXVideoPlaybackControlsController::realFormat( QString filename ) { - bool realFormat = EFalse; + bool realFormat = false; if ( !filename.isNull() && !filename.isEmpty() ) { @@ -904,7 +896,7 @@ // bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des ) { - bool realFormat = EFalse; + bool realFormat = false; TParse filePath; _LIT(KMPXRMEXT, ".R" ); @@ -967,7 +959,7 @@ // RealMedia Branding if ( ! buf.Compare( KMPXRMEXT ) ) { - realFormat = ETrue; + realFormat = true; } } @@ -992,7 +984,7 @@ { realFormat = true; } - + MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::realFormatForLocal() [%d]"), realFormat); return realFormat; @@ -1048,7 +1040,7 @@ // bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ ) { - bool visible = EFalse; + bool visible = false; for ( int i = 0 ; i < mControls.count() ; i++ ) { @@ -1056,7 +1048,7 @@ { if ( mControls[i]->isVisible() ) { - visible = ETrue; + visible = true; } break; @@ -1345,18 +1337,6 @@ } // ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackControlsController::isAttachOperation -// ------------------------------------------------------------------------------------------------- -// -bool QMPXVideoPlaybackControlsController::isAttachOperation() -{ - MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"), - mIsAttachOperation ); - - return mIsAttachOperation; -} - -// ------------------------------------------------------------------------------------------------- // QMPXVideoPlaybackControlsController::attachVideo() // ------------------------------------------------------------------------------------------------- // @@ -1400,4 +1380,22 @@ dlg.send( fileList, true ); } +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::handleOrientationChanged() +// ------------------------------------------------------------------------------------------------- +// +void QMPXVideoPlaybackControlsController::handleOrientationChanged( Qt::Orientation orientation ) +{ + MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::handleOrientationChanged()"), + _L("old orientation %d, new orientation = %d"), mOrientation, orientation ); + + Qt::Orientation oldOrientaiton = mOrientation; + mOrientation = orientation; + + if ( oldOrientaiton == Qt::Vertical && orientation == Qt::Horizontal ) + { + showControls(); + } +} + // End of File diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 23 % +// Version : %version: 25 % #include @@ -28,6 +28,7 @@ #include #include #include +#include #include "mpxvideo_debug.h" #include "mpxvideoplaybackdocumentloader.h" @@ -57,22 +58,6 @@ QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget() { MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::~QMPXVideoPlaybackFileDetailsWidget()")); - - if ( mListWidget ) - { - delete mListWidget; - } -} - -// ------------------------------------------------------------------------------------------------- -// QMPXVideoPlaybackFileDetailsWidget::initialize -// ------------------------------------------------------------------------------------------------- -// -void QMPXVideoPlaybackFileDetailsWidget::initialize() -{ - MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::initialize")); - - updateWithFileDetails( mController->fileDetails() ); } // ------------------------------------------------------------------------------------------------- @@ -101,25 +86,24 @@ // HbListViewItem *prototype = mListWidget->listItemPrototype(); prototype->setSecondaryTextRowCount( 1, 30 ); - + + // + // Title + // + makeTitleItem( details ); + if ( ! mFileDetailsUpdated ) { HbExtendedLocale locale = HbExtendedLocale::system(); mFileDetailsUpdated = true; - - // - // Title - // - makeTitleItem( details ); - + // // Description // addItemToListWidget( hbTrId( "txt_videos_list_description" ), details->mDescription ); - // // Duration // @@ -132,11 +116,11 @@ value = value % 60; QString sec = locale.toString( value ); - addItemToListWidget( + addItemToListWidget( hbTrId( "txt_videos_list_duration" ), - hbTrId( "txt_videos_list_l1_l2_l3" ).arg( hour ).arg( min ).arg( sec ) ); + hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) ); } - + // // Date/Time // @@ -146,27 +130,27 @@ // Location // addItemToListWidget( hbTrId( "txt_videos_list_location" ), details->mLocation ); - + // // Author // addItemToListWidget( hbTrId( "txt_videos_list_author" ), details->mArtist ); - + // // Copyright // addItemToListWidget( hbTrId( "txt_videos_list_copyright" ), details->mCopyright ); - + // // Language // addItemToListWidget( hbTrId( "txt_videos_list_language" ), details->mLanguage ); - + // // Keywords // addItemToListWidget( hbTrId( "txt_videos_list_keywords" ), details->mKeywords ); - + // // Size // @@ -182,17 +166,17 @@ .arg( locale.toString( details->mVideoHeight ) ); addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution ); } - + // // Format // addItemToListWidget( hbTrId( "txt_videos_list_format" ), details->mMimeType ); - + // // Bitrate // makeBitRateItem( details ); - + // // Folder // @@ -203,29 +187,44 @@ QString folder = fileInfo.dir().dirName(); addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder ); } - } // // Set the rect size dynamically based on the view mode // - QString sectionName; + QGraphicsWidget *content = loader->findWidget( QString( "content" ) ); + HbAnchorLayout *layout = static_cast( content->layout() ); - if ( mController->viewMode() == EDetailsView ) - { - sectionName = "detailsView"; - } - else if ( mController->viewMode() == EAudioOnlyView ) + if ( layout ) { - sectionName = "audioOnlyView"; - } + QGraphicsWidget *titleLayout = loader->findWidget( QString( "titleLayout" ) ); + QRectF titleRect = titleLayout->geometry(); + + switch ( mController->viewMode() ) + { + case EDetailsView: + { + layout->setAnchor( titleLayout, Hb::BottomEdge, this, Hb::TopEdge, 0 ); + layout->setAnchor( layout, Hb::BottomEdge, this, Hb::BottomEdge, 0 ); - bool ok = false; - loader->load( KMPXPLAYBACKVIEW_XML, sectionName, &ok ); + break; + } + case EAudioOnlyView: + { + QGraphicsWidget *controlLayout = loader->findWidget( QString( "controlBarLayout" ) ); + QRectF controlRect = controlLayout->geometry(); - if ( ! ok ) - { - MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget failed to load section")); + layout->setAnchor( + this, Hb::TopEdge, titleLayout, + Hb::BottomEdge, titleRect.bottom() - titleRect.top() ); + + layout->setAnchor( + this, Hb::BottomEdge, + layout, Hb::BottomEdge, layout->geometry().height() - controlRect.top() ); + + break; + } + } } } } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#21 % +// Version : %version: da1mmcf#22 % @@ -44,7 +44,6 @@ QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar( QMPXVideoPlaybackControlsController* controller ) : mController( controller ) - , mFrameItem( NULL ) , mDuration( -1 ) , mDraggingPosition( 0 ) , mSetPosition( -1 ) @@ -133,12 +132,11 @@ // // Set framedrawer for semi transparent background // - mFrameItem = new HbFrameItem ( parentItem() ); - mFrameItem->setGeometry( boundingRect() ); - mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); - mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); - mFrameItem->frameDrawer().setFillWholeRect( true ); - mFrameItem->setVisible( false ); + HbFrameItem *frameItem = new HbFrameItem(); + frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); + frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); + frameItem->frameDrawer().setFillWholeRect( true ); + setBackgroundItem( frameItem ); } } @@ -375,7 +373,7 @@ mProgressSlider->setEnabled( true ); } - mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse ); + backgroundItem()->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse ); } // ------------------------------------------------------------------------------------------------- diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,12 +15,16 @@ * */ -// Version : %version: 15 % +// Version : %version: 16 % + +#include + #include #include #include +#include #include #include #include @@ -45,10 +49,14 @@ TUint controlproperties ) : QMPXVideoPlaybackFullScreenControl( controller, index, widget, controlproperties ) , mActionBack( NULL ) - , mFrameItem( NULL ) + , mTitleLabel( NULL ) + , mTitleGroupBox( NULL ) + , mTitleLayout( NULL ) { MPX_ENTER_EXIT(_L("QMPXVideoPlaybackStatusPaneControl::QMPXVideoPlaybackStatusPaneControl()")); + Q_UNUSED( widget ); + mActionBack = new HbAction( Hb::BackNaviAction ); // @@ -59,9 +67,6 @@ connect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) ); connect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) ); - - QGraphicsWidget *widget1 = mController->layoutLoader()->findWidget( QString( "title" ) ); - mTitleLabel = qobject_cast( widget1 ); } // ------------------------------------------------------------------------------------------------- @@ -104,7 +109,7 @@ if ( mController->viewMode() == EFullScreenView || mController->viewMode() == EDetailsView ) { - mTitleLabel->setVisible( true ); + mTitleLayout->setVisible( true ); } } else @@ -113,7 +118,7 @@ mController->view()->setTitleBarVisible( false ); mController->view()->setStatusBarVisible( false ); - mTitleLabel->setVisible( false ); + mTitleLayout->setVisible( false ); } } @@ -164,6 +169,39 @@ { MPX_DEBUG(_L("QMPXVideoPlaybackStatusPaneControl::updateControlsWithFileDetails()")); + if ( ! mTitleLabel ) + { + // + // If title is not available, show clip name + // + QString title = mController->fileDetails()->mTitle; + + if ( title.count() == 0 ) + { + QFileInfo fileInfo( mController->fileDetails()->mClipName ); + title = fileInfo.baseName (); + } + + QGraphicsWidget *qWidget = mController->layoutLoader()->findWidget( QString( "title" ) ); + mTitleLabel = qobject_cast( qWidget ); + mTitleLabel->setPlainText( title ); + + qWidget = mController->layoutLoader()->findWidget( QString( "titleGroupBox" ) ); + mTitleGroupBox = qobject_cast( qWidget ); + mTitleGroupBox->setHeading( title ); + + mTitleLayout = mController->layoutLoader()->findWidget( QString( "titleLayout" ) ); + + // + // Set framedrawer for semi transparent background + // + HbFrameItem *frameItem = new HbFrameItem(); + frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); + frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); + frameItem->frameDrawer().setFillWholeRect( true ); + mTitleLabel->setBackgroundItem( frameItem ); + } + switch( mController->viewMode() ) { case EFullScreenView: @@ -176,6 +214,10 @@ mController->view()->setViewFlags( HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ) ); + + mTitleLabel->setVisible( true ); + mTitleGroupBox->setVisible( false ); + break; } case EDetailsView: @@ -188,6 +230,9 @@ mController->view()->setViewFlags( HbView::ViewFlagNone ); + mTitleGroupBox->setVisible( true ); + mTitleLabel->setVisible( false ); + break; } case EAudioOnlyView: @@ -204,20 +249,6 @@ } setMenu( details ); - - // - // Set framedrawer for semi transparent background - // - if ( ! mFrameItem ) - { - mFrameItem = new HbFrameItem ( mTitleLabel ); - mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" ); - mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces ); - mFrameItem->frameDrawer().setFillWholeRect( true ); - } - - mFrameItem->setGeometry( mTitleLabel->boundingRect() ); - mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse ); } // ------------------------------------------------------------------------------------------------- diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp --- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacktoolbar.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % @@ -500,7 +500,7 @@ if ( mButtons.count() ) { - disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) ); + disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 ); connect( mButtons[EMPX1stButton], SIGNAL( released() ), mController, SLOT( attachVideo() ) ); } @@ -539,7 +539,7 @@ if ( mButtons.count() ) { - disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) ); + disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 ); connect( mButtons[EMPX1stButton], SIGNAL( released() ), this, SLOT( changeAspectRatio() ) ); } @@ -569,7 +569,7 @@ if ( mButtons.count() ) { - disconnect( mButtons[EMPX1stButton], SIGNAL( released() ) ); + disconnect( mButtons[EMPX1stButton], SIGNAL( released() ), 0, 0 ); connect( mButtons[EMPX1stButton], SIGNAL( released() ), mController, SLOT( sendVideo() ) ); } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h --- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#17 % +// Version : %version: da1mmcf#18 % @@ -146,7 +146,7 @@ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true ); - bool isAttachOperation(); + inline bool isAttachOperation(); private: /** @@ -266,6 +266,7 @@ void controlsListUpdated(); void attachVideo(); void sendVideo(); + void handleOrientationChanged( Qt::Orientation orientation ); private: HbVideoBasePlaybackView *mView; @@ -292,6 +293,7 @@ TMPXPlaybackState mState; TPlaybackViewMode mViewMode; + Qt::Orientation mOrientation; }; // INLINE METHODS @@ -358,6 +360,19 @@ return mViewMode; } +// ------------------------------------------------------------------------------------------------- +// QMPXVideoPlaybackControlsController::isAttachOperation +// ------------------------------------------------------------------------------------------------- +// +inline +bool QMPXVideoPlaybackControlsController::isAttachOperation() +{ + MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"), + mIsAttachOperation ); + + return mIsAttachOperation; +} + #endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/ // End of File diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml --- a/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/resources/hbvideoplaybackview.docml Thu May 27 12:53:14 2010 +0300 @@ -4,17 +4,69 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + @@ -39,7 +91,7 @@ - + @@ -62,7 +114,7 @@ - + @@ -83,61 +135,20 @@ - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -145,22 +156,10 @@ - - - - - - - - - - - - - - - - + + + + @@ -169,34 +168,20 @@ + + + + + + + + + + + + -
- - - - - - - - - - - -
-
- - - - - - - - - - - -
diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackfiledetailswidget.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -65,7 +65,7 @@ void QMPXVideoPlaybackFileDetailsWidget::updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details ) { - + Q_UNUSED( details ); } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -100,6 +100,7 @@ MPX_DEBUG(_L("HbEffect::effectRunning")); Q_UNUSED( item ); + Q_UNUSED( effectEvent ); return false; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/stub/src/mpxvideoplaybackcontrolscontroller.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,6 +67,7 @@ { MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()")); + Q_UNUSED( transitionEffect ); mViewMode = viewMode; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -89,7 +89,7 @@ { loc = "Bitrate"; } - else if ( string == "txt_videos_list_l1_l2_l3" ) + else if ( string == "txt_videos_list_l1l2l3" ) { loc = "%L1 hr %L2 min %L3 sec"; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackdocumentloader.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -88,6 +88,12 @@ object->setObjectName( name ); mWidgets.append( object ); } + else if ( name == "content" ) + { + object = new QGraphicsWidget(); + object->setObjectName( name ); + mWidgets.append( object ); + } return object; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/src/testmpxvideoplaybacktoolbar.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % #include @@ -418,7 +418,6 @@ details->mVideoHeight = 1; details->mVideoWidth = 1; details->mTvOutConnected = false; - details->mTvOutPlayAllowed = true; details->mSeekable = true; details->mPausableStream = true; mController->mViewMode = EFullScreenView; @@ -455,7 +454,6 @@ details->mVideoHeight = 0; details->mVideoWidth = 1; details->mTvOutConnected = true; - details->mTvOutPlayAllowed = true; details->mSeekable = false; details->mPausableStream = false; @@ -474,7 +472,6 @@ details->mVideoHeight = 0; details->mVideoWidth = 1; details->mTvOutConnected = true; - details->mTvOutPlayAllowed = true; details->mSeekable = false; details->mPausableStream = false; mController->mViewMode = EAudioOnlyView; @@ -516,7 +513,6 @@ details->mVideoHeight = 1; details->mVideoWidth = 1; details->mTvOutConnected = false; - details->mTvOutPlayAllowed = true; details->mSeekable = true; details->mPausableStream = true; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybacktoolbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/src/testmpxvideoviewwrapper.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,6 +15,8 @@ * */ +// Version : %version: % + #include #include @@ -187,7 +189,6 @@ message->SetTObjectValueL ( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent ); message->SetTObjectValueL( KMPXMediaVideoTvOutConnected, ETrue ); - message->SetTObjectValueL( KMPXMediaVideoTvOutPlayAllowed, EFalse ); ); mVideoViewWrapper->HandlePlaybackMessage( message, KErrNone ); QVERIFY( mVideoViewWrapper->iFileDetails->mTvOutConnected ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxplaybackutilityimpl.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ - +// Version : %version: 3 % #ifndef CMPXPLAYBACKUTILITY_H #define CMPXPLAYBACKUTILITY_H @@ -42,7 +42,8 @@ * this interface: */ NONSHARABLE_CLASS(CMPXPlaybackUtility) : public MMPXPlaybackUtility, - public MMPXSource + public MMPXSource, + public MMPXPlayerManager { public: /** diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxplaybackutilityimpl.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 4 % #include #include @@ -258,6 +258,7 @@ // MMPXPlayerManager& CMPXPlaybackUtility::PlayerManager() { + return *this; } // ---------------------------------------------------------------------------- @@ -534,6 +535,7 @@ // TUid CMPXPlaybackUtility::UidL() const { + return TUid::Uid( 0 ); } // ---------------------------------------------------------------------------- diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % @@ -64,7 +64,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mMultiItemPlaylist = false; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #include @@ -255,9 +255,8 @@ // test for tv-out mController->mFileDetails->mPlaybackMode = EMPXVideoLocal; mController->mFileDetails->mTvOutConnected = true; - mController->mFileDetails->mTvOutPlayAllowed = false; mProgBar->updateWithFileDetails( mController->mFileDetails ); - QVERIFY( ! mProgBar->mProgressSlider->isEnabled() ); + QVERIFY( mProgBar->mProgressSlider->isEnabled() ); // live streaming mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 100; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 6 % #include @@ -34,6 +34,7 @@ #include "hbvideobaseplaybackview.h" #include "mpxvideoplaybackdocumentloader.h" #include "hblabel.h" +#include "hbgroupbox.h" #define private public #define protected public @@ -88,12 +89,11 @@ mControlsController = new QMPXVideoPlaybackControlsController( mBaseVideoView, mFileDetails ); - + mStatusPane = new QMPXVideoPlaybackStatusPaneControl( mControlsController, EMPXStatusPane, NULL, - 0 ); - + 0 ); } // --------------------------------------------------------------------------- @@ -104,6 +104,12 @@ { MPX_ENTER_EXIT(_L("TestStatusPaneControl::cleanup()")); + if ( mStatusPane ) + { + delete mStatusPane; + mStatusPane = NULL; + } + if ( mBaseVideoView ) { delete mBaseVideoView; @@ -121,12 +127,6 @@ delete mControlsController; mControlsController = NULL; } - - if ( mStatusPane ) - { - delete mStatusPane; - mStatusPane = NULL; - } } // --------------------------------------------------------------------------- @@ -145,6 +145,8 @@ mStatusPane->setMenu( mFileDetails ); QVERIFY( mControlsController->view()->menu()->isEmpty() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -156,17 +158,22 @@ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisible()")); setup(); - + mStatusPane->updateControlsWithFileDetails( mFileDetails ); + // 1. Set visible mStatusPane->setVisible( true ); - QVERIFY( mStatusPane->isVisible() ); - QVERIFY( mStatusPane->mTitleLabel->isVisible() ); - + QVERIFY( mControlsController->view()->mStatusBarVisible ); + QVERIFY( mControlsController->view()->mTitleBarVisible ); + QVERIFY( mStatusPane->mTitleLayout->isVisible() ); + // 2. Set invisible - mStatusPane->setVisible( false ); - QVERIFY( ! mStatusPane->isVisible() ); - QVERIFY( ! mStatusPane->mTitleLabel->isVisible() ); - + mStatusPane->setVisible( false ); + QVERIFY( mControlsController->view()->menu()->isEmpty() ); + QVERIFY( ! mControlsController->view()->mStatusBarVisible ); + QVERIFY( ! mControlsController->view()->mTitleBarVisible ); + QVERIFY( ! mStatusPane->mTitleLayout->isVisible() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -178,34 +185,36 @@ MPX_ENTER_EXIT(_L("TestStatusPaneControl::testUpdateControlsWithFileDetails()")); setup(); - + + QString title = "Title"; + // 1. test for full creen mode mControlsController->mViewMode = EFullScreenView; - - mFileDetails->mTvOutConnected = true; - + mControlsController->mFileDetails->mTitle = title; mStatusPane->updateControlsWithFileDetails( mFileDetails ); - + + QVERIFY( mStatusPane->mTitleLabel->mString == title ); + QVERIFY( mStatusPane->mTitleGroupBox->mString == title ); + QVERIFY( mStatusPane->mTitleLabel->isVisible() ); + QVERIFY( ! mStatusPane->mTitleGroupBox->isVisible() ); QVERIFY( mControlsController->view()->viewFlags() == HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent )); - + // 2. test for detial view mode - mControlsController->mViewMode = EDetailsView; - - mFileDetails->mTvOutConnected = true; - + mControlsController->mViewMode = EDetailsView; + mStatusPane->updateControlsWithFileDetails( mFileDetails ); + + QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone ); + QVERIFY( ! mStatusPane->mTitleLabel->isVisible() ); + QVERIFY( mStatusPane->mTitleGroupBox->isVisible() ); + + // 3. test for audio only mode + mControlsController->mViewMode = EAudioOnlyView; mStatusPane->updateControlsWithFileDetails( mFileDetails ); QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone ); - // 3. test for audio only mode - mControlsController->mViewMode = EAudioOnlyView; - - mFileDetails->mTvOutConnected = true; - - mStatusPane->updateControlsWithFileDetails( mFileDetails ); - - QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone ); + cleanup(); } // --------------------------------------------------------------------------- @@ -225,6 +234,8 @@ // 2. test for second block of cases: mStatusPane->setVisibility( EPbStateInitialising ); QVERIFY( mControlsController->view()->menu()->isEmpty() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -240,6 +251,8 @@ mStatusPane->controlListUpdated( mFileDetails ); QVERIFY( mControlsController->view()->menu()->isEmpty() ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -259,6 +272,8 @@ QVERIFY( mControlsController->mTimerAction == EMPXTimerCancel ); disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -277,7 +292,9 @@ QVERIFY( mControlsController->mTimerAction == EMPXTimerReset ); - disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) ); + disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) ); + + cleanup(); } // --------------------------------------------------------------------------- @@ -297,6 +314,8 @@ QVERIFY( mControlsController->mViewMode == EFullScreenView ); disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) ); + + cleanup(); } // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbgroupbox.h Thu May 27 12:53:14 2010 +0300 @@ -0,0 +1,47 @@ +/* +* 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: Stub Implementation of HbGroupBox +* +*/ + +// Version : %version: 1 % + + + +#ifndef HBGROUPBOX_H_ +#define HBGROUPBOX_H_ + +#include + + +class HbGroupBox : public HbWidget +{ + Q_OBJECT + + public: + HbGroupBox(); + virtual ~HbGroupBox(); + + public: + void setVisible( bool visible ); + bool isVisible(); + void setHeading( QString string ); + + public: + bool mVisible; + QString mString; +}; + +#endif /*HBGROUPBOX_H_*/ + diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hblabel.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -34,13 +34,14 @@ virtual ~HbLabel(); public: - void setVisible( bool visible ); - + void setVisible( bool visible ); bool isVisible(); + void setPlainText( QString string ); public: bool mVisible; + QString mString; }; -#endif /*HBPUSHBUTTON_H*/ +#endif /*HBLABEL_H_*/ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 6 % @@ -25,16 +25,18 @@ #define __HBVIDEOBASEPLAYBACKVIEW_H__ // Include Files +#include #include - // Constants // Forward Declarations // Class Definitions +class HbAction; +class HbMenu; -class HbVideoBasePlaybackView : public HbView +class HbVideoBasePlaybackView : public HbWidget { Q_OBJECT @@ -55,14 +57,21 @@ void setViewFlags( HbView::HbViewFlags flags ); HbView::HbViewFlags viewFlags(); - protected slots: + void setTitleBarVisible( bool visible ); + void setStatusBarVisible( bool visible ); + void setNavigationAction(HbAction *action); + HbMenu *menu(); + public slots: virtual void closePlaybackView(); public: bool mViewActive; + bool mTitleBarVisible; + bool mStatusBarVisible; + + HbMenu *mMenu; HbView::HbViewFlags mFlag; - }; #endif // __HBVIDEOBASEPLAYBACKVIEW_H__ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbgroupbox.cpp Thu May 27 12:53:14 2010 +0300 @@ -0,0 +1,66 @@ +/* +* 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: Implementation of HbGroupBox +* +*/ + +// Version : %version: 1 % + + +#include "hbgroupbox.h" + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::HbGroupBox +// ------------------------------------------------------------------------------------------------- +// +HbGroupBox::HbGroupBox() +{ +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::~HbGroupBox +// ------------------------------------------------------------------------------------------------- +// +HbGroupBox::~HbGroupBox() +{ +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::setVisible +// ------------------------------------------------------------------------------------------------- +// +void HbGroupBox::setVisible( bool visible ) +{ + mVisible = visible; +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::isVisible +// ------------------------------------------------------------------------------------------------- +// +bool HbGroupBox::isVisible() +{ + return mVisible; +} + +// ------------------------------------------------------------------------------------------------- +// HbGroupBox::setHeading +// ------------------------------------------------------------------------------------------------- +// +void HbGroupBox::setHeading( QString string ) +{ + mString = string; +} + +// End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hblabel.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,13 +15,13 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % #include "hblabel.h" // ------------------------------------------------------------------------------------------------- -// HbPushButton::HbPushButton +// HbLabel::HbLabel // ------------------------------------------------------------------------------------------------- // HbLabel::HbLabel() @@ -54,5 +54,13 @@ return mVisible; } +// ------------------------------------------------------------------------------------------------- +// HbLabel::setPlainText +// ------------------------------------------------------------------------------------------------- +// +void HbLabel::setPlainText( QString string ) +{ + mString = string; +} // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,12 +15,14 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % // Include Files #include +#include +#include #include "../inc/hbvideobaseplaybackview.h" @@ -33,6 +35,7 @@ // HbVideoBasePlaybackView::HbVideoBasePlaybackView() { + mMenu = new HbMenu(); mViewActive = false; } @@ -42,6 +45,11 @@ // HbVideoBasePlaybackView::~HbVideoBasePlaybackView() { + if ( mMenu ) + { + delete mMenu; + mMenu = NULL; + } } // ------------------------------------------------------------------------------------------------- @@ -116,4 +124,39 @@ return mFlag; } +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::setTitleBarVisible() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::setTitleBarVisible( bool visible ) +{ + mTitleBarVisible = visible; +} + +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::setStatusBarVisible() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::setStatusBarVisible( bool visible ) +{ + mStatusBarVisible = visible; +} + +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::setNavigationAction() +// ------------------------------------------------------------------------------------------------- +// +void HbVideoBasePlaybackView::setNavigationAction( HbAction *action ) +{ +} + +// ------------------------------------------------------------------------------------------------- +// HbVideoBasePlaybackView::menu() +// ------------------------------------------------------------------------------------------------- +// +HbMenu* HbVideoBasePlaybackView::menu() +{ + return mMenu; +} + // EOF diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackdocumentloader.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,12 +15,13 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % -#include -#include -#include +#include + +#include "hblabel.h" +#include "hbgroupbox.h" #include "mpxvideo_debug.h" #include "mpxvideoplaybackdocumentloader.h" @@ -83,14 +84,11 @@ QGraphicsWidget *object = NULL; - if ( name == "transparentWindow" ) - { - MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating transparentWindow") ); - - object = new HbTransparentWindow(); + if ( name == "titleLayout" ) + { + object = new QGraphicsWidget(); object->setObjectName( name ); - MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending to object list") ); mWidgets.append( object ); } else if ( name == "title" ) @@ -99,6 +97,12 @@ object->setObjectName( name ); mWidgets.append( object ); } + else if ( name == "titleGroupBox" ) + { + object = new HbGroupBox(); + object->setObjectName( name ); + mWidgets.append( object ); + } return object; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro --- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/teststatuspanecontrol.pro Thu May 27 12:53:14 2010 +0300 @@ -14,7 +14,7 @@ # Description: Project file for building teststatuspanecontrol # # -# Version : %version: 2 % +# Version : %version: 3 % TEMPLATE = app @@ -41,7 +41,8 @@ hbvideobaseplaybackview.h \ mpxvideoplaybackdocumentloader.h \ mpxvideoplaybackfullscreencontrol.h \ - hblabel.h + hblabel.h \ + hbgroupbox.h SOURCES += ../../../controlsrc/mpxvideoplaybackstatuspanecontrol.cpp \ src/teststatuspanecontrol.cpp \ @@ -50,5 +51,6 @@ hbvideobaseplaybackview.cpp \ mpxvideoplaybackdocumentloader.cpp \ mpxvideoplaybackfullscreencontrol.cpp \ - hblabel.cpp + hblabel.cpp \ + hbgroupbox.cpp \ No newline at end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -65,7 +65,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/centralrepository.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -25,7 +25,7 @@ #include "centralrepository.h" -CRepository* CRepository::NewLC( TUid aRepositoryUid ) +CRepository* CRepository::NewLC( TUid /* aRepositoryUid */ ) { CRepository* self = new (ELeave) CRepository(); @@ -35,9 +35,9 @@ } -TInt CRepository::Get(TUint32 aKey, TInt& aValue) +TInt CRepository::Get( TUint32 /* aKey */, TInt& aValue ) { - aValue = 10; + aValue = 10; return KErrNone; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -58,7 +58,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mMultiItemPlaylist = false; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testuserinputhandler/stub/src/mpxvideoviewwrapper.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -202,7 +202,6 @@ iFileDetails->mRNFormat = false; iFileDetails->mDuration = 100; iFileDetails->mTvOutConnected = false; - iFileDetails->mTvOutPlayAllowed = true; iFileDetails->mDrmProtected = false; iFileDetails->mMultiItemPlaylist = false; iFileDetails->mVideoHeight = 320; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -64,7 +64,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mMultiItemPlaylist = false; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/stub/src/mpxvideoviewwrapper.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % @@ -228,7 +228,6 @@ iFileDetails->mRNFormat = false; iFileDetails->mDuration = 100; iFileDetails->mTvOutConnected = false; - iFileDetails->mTvOutPlayAllowed = true; iFileDetails->mDrmProtected = false; iFileDetails->mMultiItemPlaylist = false; iFileDetails->mVideoHeight = 320; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #ifndef __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__ #define __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__ @@ -56,14 +56,7 @@ private slots: - // - // test addFileDetails() - // void testAddFileDetails(); - - // - // test handleEvent() - // void testHandleEventSetPosition(); void testHandleEventSetDuration(); void testHandleEventStateChanged(); @@ -117,11 +110,16 @@ // // test private slot attachVideo() // - void testslot_sendVideo(); + void testslot_sendVideo(); + + // + // test private slot handleOrientationChanged() + // + void testslot_handleOrientationChanged(); signals: - void commandSignal(); + void commandSignal( Qt::Orientation ); private: diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: 8 % #include #include @@ -339,6 +339,8 @@ { MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult()")); + mController->mOrientation = Qt::Horizontal; + if ( value == EPbStateInitialised && ( mController->mFileDetails->mPlaybackMode == EMPXVideoStreaming || mController->mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) ) @@ -578,7 +580,6 @@ QVERIFY( ( mController->mFileDetails->mPlaybackMode == EMPXVideoLocal )? mController->mThumbNailState == EThumbNailRequsted : mController->mThumbNailState == EThumbNailNotAvailable ); - QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == value ); QVERIFY( mController->mViewMode == EAudioOnlyView ); QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected ); QVERIFY( mController->mThumbnailManager->mThumbSize == ThumbnailManager::ThumbnailLarge ); @@ -588,13 +589,11 @@ else if ( mController->mFileDetails->mVideoEnabled ) { QVERIFY( mController->mViewTransitionIsGoingOn == true ); - QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == true ); QVERIFY( mController->mViewMode == EFullScreenView ); } else if ( ! mController->mFileDetails->mVideoEnabled ) { QVERIFY( mController->mViewTransitionIsGoingOn == false ); - QVERIFY( mController->mFileDetails->mTvOutPlayAllowed == true ); QVERIFY( mController->mViewMode == EAudioOnlyView ); } @@ -782,7 +781,8 @@ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()") ); init(); - + mController->mOrientation = Qt::Horizontal; + // // preset variables // @@ -792,23 +792,23 @@ // // playing state // - mController->mState = EPbStatePlaying; - mBaseVideoView->mouseReleaseEvent(0); + mController->mState = EPbStatePlaying; + mBaseVideoView->mouseReleaseEvent(0); QVERIFY( mController->mControlsTimer->isActive() == true ); for ( int i = 0 ; i < mController->mControls.count() ; i++ ) { - QVERIFY( mController->mControls[i]->mVisibilityState == EPbStatePlaying ); + QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState ); } // // pause state // mController->mState = EPbStatePaused; - mBaseVideoView->mouseReleaseEvent(0); + mBaseVideoView->mouseReleaseEvent(0); QVERIFY( mController->mControlsTimer->isActive() == false ); for ( int i = 0 ; i < mController->mControls.count() ; i++ ) { - QVERIFY( mController->mControls[i]->mVisibilityState == EPbStatePaused ); + QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState ); } cleanup(); @@ -1049,8 +1049,54 @@ cleanup(); } +// ------------------------------------------------------------------------------------------------- +// TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged +// ------------------------------------------------------------------------------------------------- +// +void TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged() +{ + MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged()") ); + + // + // initialize controlscontroller + // + init(); + + // + // connect signal with controller handleOrientationChanged() slot + // + bool res = connect( this, SIGNAL( commandSignal( Qt::Orientation ) ), + mController, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); + + // + // emit signal, this will in turns invoke mController handleOrientationChanged() slot + // + mController->mOrientation = Qt::Vertical; + + emit commandSignal( Qt::Horizontal ); + + // + // verify command EMPXPbvCmdClose has been issued + // + QVERIFY( mController->mOrientation == Qt::Horizontal ); + + mController->mState = EPbStatePlaying; + + for ( int i = 0 ; i < mController->mControls.count() ; i++ ) + { + QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState ); + } + + // + // disconnect signal + // + disconnect( this, SIGNAL( commandSignal( Qt::Orientation ) ), + mController, SLOT( handleOrientationChanged( Qt::Orientation ) ) ); + + // + // clean up + // + cleanup(); +} // End of file - - - diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackviewfiledetails.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -70,7 +70,6 @@ bool mPartialPlayback; bool mRNFormat; bool mTvOutConnected; - bool mTvOutPlayAllowed; bool mDrmProtected; bool mMultiItemPlaylist; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackfullscreencontrol.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 2 % +// Version : %version: 3 % @@ -62,7 +62,6 @@ // void QMPXVideoPlaybackFullScreenControl::setVisible( bool visible ) { - //mControl->setVisible( visible ); mVisible = visible; } @@ -72,7 +71,6 @@ // bool QMPXVideoPlaybackFullScreenControl::isVisible() { - //return mControl->isVisible(); return mVisible; } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackviewfiledetails.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % @@ -67,7 +67,6 @@ mDuration = 0; mTvOutConnected = false; - mTvOutPlayAllowed = true; mDrmProtected = false; mVideoHeight = 0; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/inc/testvideoplaybackview.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 6 % #ifndef __TESTVIDEOPLAYBACKVIEW_H__ #define __TESTVIDEOPLAYBACKVIEW_H__ @@ -60,7 +60,7 @@ void testShowDialog(); void testGetWindow(); void testIssuePlayCommand(); - void testEvent(); + void testEventFilter(); void testClosePlaybackView(); void testMousePressEvent(); void testMouseReleaseEvent(); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 9 % #include #include @@ -134,13 +134,11 @@ verifyHandlePluginError( KErrMMDRMNotAuthorized ); verifyHandlePluginError( KErrCANoRights ); verifyHandlePluginError( KErrCANoPermission ); - verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowedClose ); // // playback view remains open after displaying these error notes // verifyHandlePluginError( KMPXVideoCallOngoingError, false ); - verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowed, false ); verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false ); // @@ -211,7 +209,7 @@ cleanup(); } -void TestVideoPlaybackView::testEvent() +void TestVideoPlaybackView::testEventFilter() { setup(); @@ -223,14 +221,14 @@ // // declare foreground/background event // - QEvent* windowActivate = new QEvent( QEvent::WindowActivate ); - QEvent* windowDeactivate = new QEvent( QEvent::WindowDeactivate ); + QEvent* appActivate = new QEvent( QEvent::ApplicationActivate ); + QEvent* appDeactivate = new QEvent( QEvent::ApplicationDeactivate ); // // verify the returned value (consumed) of HbVideoBasePlaybackView::event() - // for QEvent::WindowActivate is false + // for QEvent::ApplicationActivate is false // - QVERIFY( ! mVideoView->event( windowActivate ) ); + QVERIFY( ! mVideoView->eventFilter( NULL, appActivate ) ); // // verify view is in foreground @@ -239,9 +237,9 @@ // // verify the returned value (consumed) of HbVideoBasePlaybackView::event() - // for QEvent::WindowDeactivate is false + // for QEvent::ApplicationDeactivate is false // - QVERIFY( ! mVideoView->event( windowDeactivate ) ); + QVERIFY( ! mVideoView->eventFilter( NULL, appDeactivate ) ); // // verify view is in background @@ -251,10 +249,18 @@ // // clean up // - delete windowActivate; - windowActivate = NULL; - delete windowDeactivate; - windowDeactivate = NULL; + if ( appActivate ) + { + delete appActivate; + appActivate = NULL; + } + + if ( appDeactivate ) + { + delete appDeactivate; + appDeactivate = NULL; + } + cleanup(); } diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp --- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 5 % +// Version : %version: 6 % @@ -228,7 +228,6 @@ iFileDetails->mRNFormat = false; iFileDetails->mDuration = 100; iFileDetails->mTvOutConnected = false; - iFileDetails->mTvOutPlayAllowed = true; iFileDetails->mDrmProtected = false; iFileDetails->mMultiItemPlaylist = false; iFileDetails->mVideoHeight = 320; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp --- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#38 % +// Version : %version: da1mmcf#40 % @@ -116,9 +116,11 @@ void HbVideoBasePlaybackView::handleActivateView() { MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleActivateView()")); - + TRAP_IGNORE( mVideoMpxWrapper = CMPXVideoViewWrapper::NewL( this ) ); - + + QCoreApplication::instance()->installEventFilter( this ); + // // Request the needed Media from the Playback Plugin // @@ -128,11 +130,12 @@ // // Landscape orientation - // - hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal ); + // Workaround: Disable orientation transition effect + // since orbit couldn't emit the orientationChanged signal with transition effect + // + hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal, false ); mActivated = true; - } // ------------------------------------------------------------------------------------------------- @@ -143,6 +146,8 @@ { MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::handleDeactivateView()")); + QCoreApplication::instance()->removeEventFilter( this ); + mActivated = false; // @@ -306,7 +311,11 @@ void HbVideoBasePlaybackView::issuePlayCommand() { MPX_ENTER_EXIT(_L("HbVideoBasePlaybackView::issuePlayCommand()")); - TRAPD(err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay )); + + int err = KErrNone; + + TRAP( err, mVideoMpxWrapper->CreateGeneralPlaybackCommandL( EPbCmdPlay )); + MPX_DEBUG(_L("HbVideoBasePlaybackView::issuePlayCommand() error = %d"), err); } @@ -326,7 +335,6 @@ void HbVideoBasePlaybackView::handleBufferingState() { MPX_DEBUG(_L("HbVideoBasePlaybackView::handleBufferingState()")); - } // ------------------------------------------------------------------------------------------------- @@ -340,28 +348,37 @@ mTimerForClosingView->start( 0 ); } -// ------------------------------------------------------------------------------------------------- -// HbVideoBasePlaybackView::event() -// ------------------------------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// HbVideoBasePlaybackView::eventFilter +// --------------------------------------------------------------------------- // -bool HbVideoBasePlaybackView::event( QEvent *event ) +bool HbVideoBasePlaybackView::eventFilter( QObject *object, QEvent *event ) { - bool consumed = false; + Q_UNUSED( object ); - if ( event->type() == QEvent::WindowActivate && mActivated ) + switch ( event->type() ) { - TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) ); - } - else if ( event->type() == QEvent::WindowDeactivate && mActivated ) - { - TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) ); - } - else - { - consumed = QGraphicsWidget::event( event ); + case QEvent::ApplicationActivate: + { + if ( mActivated ) + { + MPX_DEBUG(_L("HbVideoBasePlaybackView::eventFilter foreground()") ); + TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( true ) ); + } + break; + } + case QEvent::ApplicationDeactivate: + { + if ( mActivated ) + { + MPX_DEBUG(_L("HbVideoBasePlaybackView::eventFilter background()") ); + TRAP_IGNORE( mVideoMpxWrapper->IssueVideoAppForegroundCmdL( false ) ); + } + break; + } } - return consumed; + return QObject::eventFilter( object, event ); } // ------------------------------------------------------------------------------------------------- @@ -409,5 +426,4 @@ handleClosePlaybackView(); } - // EOF diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp --- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 20 % +// Version : %version: 21 % #include #include @@ -132,7 +132,9 @@ MPX_DEBUG(_L("VideoWindow ordinal position is: %d"), videoWindow->OrdinalPosition()); MPX_DEBUG(_L("UiWindow ordinal position is: %d"), (&aWin)->OrdinalPosition()); - TRAPD + int status = KErrNone; + + TRAP ( status, { CAlfCompositionSource* me = CAlfCompositionSource::NewL( aWin ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/inc/hbvideobaseplaybackview.h --- a/videoplayback/inc/hbvideobaseplaybackview.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/inc/hbvideobaseplaybackview.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: da1mmcf#14 % +// Version : %version: da1mmcf#15 % @@ -92,11 +92,11 @@ void showDialog( const QString& qString, bool closeView = true ); virtual void handleClosePlaybackView(); - - bool event( QEvent *event ); RWindow *getWindow(); + bool eventFilter( QObject *object, QEvent *event ); + protected: void mousePressEvent( QGraphicsSceneMouseEvent *event ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/conf/mpxvideopbplugins.confml Binary file videoplayback/videohelix/conf/mpxvideopbplugins.confml has changed diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/group/mpxvideohelixplayback.mmp --- a/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#14 % +// Version : %version: 15 % @@ -43,6 +43,7 @@ SOURCE mpxvideoaccessoryobserver.cpp SOURCE mpxvideoplayerutility.cpp SOURCE mpxvideodrmhelper.cpp +SOURCE mpxvideoposterframesetter.cpp START RESOURCE ../data/10282550.rss TARGET mpxvideohelixplayback.rsc @@ -76,6 +77,8 @@ LIBRARY mmcommon.lib LIBRARY hwrmlightclient.lib // Lights control LIBRARY centralrepository.lib // For display backlight timeout value +LIBRARY fbscli.lib +LIBRARY thumbnailmanager.lib #ifdef __ACCESSORY_FW LIBRARY accclient.lib diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Thu May 27 12:53:14 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 25 % +// Version : %version: 28 % #ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_ @@ -126,6 +126,8 @@ TBool IsVideoCall(); TBool IsVoiceCall(); + TBool IsViewActivated(); + void HandleTvOutEventL( TBool aConnected ); void HandleError(TInt error); @@ -133,6 +135,8 @@ void HandleVolumeL( TBool aIncrease ); void SendHideControlsEventL(); + + void HandleFrameReady(TInt aError); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API @@ -220,7 +224,6 @@ TBool iAppInForeground; CMediaRecognizer::TMediaType iMediaType; TInt iAccessPointId; - TBool iForegroundPause; TBool iAllowAutoPlay; TBool iHelixLoadingStarted; TInt iPBPluginError; @@ -264,6 +267,7 @@ CHWRMLight* iLight; TInt iLightStatus; TInt iSavedPosition; + TBool iViewActivated; public: // Friend classes @@ -289,6 +293,7 @@ friend class CMPXVideoDlMgrIf; friend class CMPXVideoAccessoryObserver; friend class CMpxVideoPlayerUtility; + friend class CMPXVideoPosterFrameSetter; }; // INLINE METHODS diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/inc/mpxvideoplaybackmode.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackmode.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackmode.h Thu May 27 12:53:14 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 15 % +// Version : %version: 16 % #ifndef _CMPXVIDEOPLAYBACKMODE_H_ @@ -37,6 +37,7 @@ // class CMPXVideoPlaybackController; class CMPXVideoDlMgrIf; +class CMPXVideoPosterFrameSetter; // @@ -71,6 +72,8 @@ virtual TBool CanPlayNow(); virtual void OpenFileL( const TDesC& aMediaFile ); virtual void OpenFileL( const RFile& aMediaFile ); + virtual void HandleSetPosterFrame(); + virtual void HandleFrameReady(TInt aError); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API virtual void OpenFile64L( const RFile64& aMediaFile ); @@ -95,6 +98,8 @@ // Data // CMPXVideoPlaybackController* iVideoPlaybackCtlr; // not owned + + CMPXVideoPosterFrameSetter* iPosterFrameSetter; }; @@ -113,6 +118,8 @@ // Methods where video plabkack behavior varies for local media inline virtual TInt GetMode(); + virtual void HandleSetPosterFrame(); + virtual void HandleFrameReady(TInt aError); }; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/inc/mpxvideoplaybackstate.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Thu May 27 12:53:14 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 18 % +// Version : %version: 19 % #ifndef _CMPXVIDEOPLAYBACKSTATE_H_ @@ -72,6 +72,7 @@ virtual void HandleStartSeekL( TBool aForward ); virtual void HandleStopSeekL(); virtual void HandleClose(); + virtual void HandleSetPosterFrame(); virtual void HandleForeground(); virtual void HandleBackground(); @@ -246,6 +247,7 @@ virtual void HandlePause(); virtual void HandleStop(); virtual void HandleStartSeekL( TBool aForward ); + virtual void HandleSetPosterFrame(); virtual void HandlePlayPause(); virtual void HandleBackground(); @@ -310,7 +312,8 @@ virtual void HandlePlay(); virtual void HandleStop(); virtual void HandleStartSeekL( TBool aForward ); - virtual void HandlePlayPause(); + virtual void HandlePlayPause(); + virtual void HandleSetPosterFrame(); virtual void HandleForeground(); virtual void HandleCustomPlay(); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/inc/mpxvideoplayerutility.h --- a/videoplayback/videohelix/inc/mpxvideoplayerutility.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 11 % +// Version : %version: 13 % #ifndef __MPXVIDEOPLAYERUTILITY__ @@ -25,6 +25,7 @@ // INCLUDES // #include +#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include @@ -42,12 +43,13 @@ // FORWARD DECLARATIONS // class CMPXVideoPlaybackController; +class CFbsBitmap; // // CLASS DECLARATION // -NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CBase, +NONSHARABLE_CLASS( CMpxVideoPlayerUtility ) : public CActive, public MMMFControllerEventMonitorObserver { public: @@ -101,11 +103,18 @@ 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 ); @@ -124,6 +133,8 @@ const TRect& aCropRect, TVideoAspectRatio aAspectRatio ); + void SendSurfaceCreatedCommand(); + #endif private: @@ -150,11 +161,15 @@ RMMFVideoPlaySurfaceSupportCustomCommands iVideoPlaySurfaceSupportCustomCommands; TSurfaceId iSurfaceId; + TRect iCropRect; + TVideoAspectRatio iAspectRatio; #endif CMMFControllerEventMonitor* iControllerEventMonitor; TBool iDirectScreenAccessAbort; + + CFbsBitmap* iPosterFrameBitmap; }; #endif /* __MPXVIDEOPLAYERUTILITY__ */ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/inc/mpxvideoposterframesetter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/inc/mpxvideoposterframesetter.h Thu May 27 12:53:14 2010 +0300 @@ -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 +#include +#include +#include + + +// 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 diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Thu May 27 12:53:14 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 58 % +// Version : %version: 62 % // @@ -168,6 +168,7 @@ iDrmHelper = CMpxVideoDrmHelper::NewL(); iSavedPosition = 0; + iViewActivated = EFalse; } // ---------------------------------------------------------------------------- @@ -264,7 +265,6 @@ // CMPXVideoPlaybackController::CMPXVideoPlaybackController() : iAppInForeground(ETrue) - , iForegroundPause(EFalse) , iAllowAutoPlay(ETrue) , iHelixLoadingStarted(EFalse) , iLightStatus(CHWRMLight::ELightStatusUnknown) @@ -371,6 +371,7 @@ #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + iViewActivated = EFalse; } // ---------------------------------------------------------------------------- @@ -540,6 +541,11 @@ break; } + case EPbCmdSetPosterFrame: + { + iState->HandleSetPosterFrame(); + break; + } } } } @@ -879,26 +885,19 @@ 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 ); - if ( volume > 0 ) - { - // - // Media player's CenRep volume range : 0 - number of volume steps - // MPX framework volume range : 0-100 - // - iVolumeWatcher->SetValueL( volume / iVolumeNormalizer ); - SetMuteCenRepL( EFalse ); - } - else - { - // - // save both mute and current volume values in CenRep - // - iVolumeWatcher->SetValueL( 0 ); - SetMuteCenRepL( ETrue ); - } + iVolumeWatcher->SetValueL( volume ); + + SetMuteCenRepL( volume > 0? EFalse: ETrue ); } else { @@ -939,7 +938,8 @@ TInt volume = iVolumeWatcher->CurrentValueL(); TBool mute = iMuteWatcher->CurrentValueL(); - MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d") + MPX_DEBUG( + _L("CMPXVideoPlaybackController::SetVolumeMMFL() volume = %d, mute = %d") , volume, mute ); TInt newVolume = 0; @@ -947,15 +947,14 @@ if ( ! mute ) { // - // If it was muted and previous volume level was 0, set the volume to 1 + // If it was muted and previous volume level was KPbPlaybackVolumeLevelMin, set the volume to next level // - if ( volume == 0 ) + if ( volume == KPbPlaybackVolumeLevelMin ) { - volume++; + volume = KPbPlaybackVolumeLevelMin + iVolumeNormalizer; } - newVolume = - volume * iVolumeNormalizer * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax; + newVolume = volume * iFileDetails->iMaxVolume / KPbPlaybackVolumeLevelMax; } MPX_DEBUG(_L("CMPXVideoPlaybackController::SetVolumeMMFL() new volume = %d"), newVolume ); @@ -1101,7 +1100,7 @@ if ( ! iMuteWatcher->CurrentValueL() ) { - volume = iVolumeWatcher->CurrentValueL() * iVolumeNormalizer; + volume = iVolumeWatcher->CurrentValueL(); } value = volume; @@ -1154,6 +1153,10 @@ TInt retError = KErrNone; + iViewActivated = ETrue; + + iPlayer->SendSurfaceCreatedCommand(); + RArray suppIds; CleanupClosePushL( suppIds ); @@ -2307,10 +2310,6 @@ // // MPX framework volume range : 0-100 - // Media player volume range : 0-10 - // MPX video player volume range : 0 - volume steps (defined in PlaybackHelper) - // For IAD, need to manipulate volume to save in cenrep - // MPX Framework volume / iVolumeNormalizer => CenRep // CDevSoundIf* devSoundIf = CDevSoundIf::NewL(); TInt volumeSteps = devSoundIf->GetNumberOfVolumeSteps(); @@ -2401,6 +2400,8 @@ iHelixLoadingStarted = EFalse; iSavedPosition = 0; + + iViewActivated = EFalse; } // ------------------------------------------------------------------------------------------------ @@ -2412,31 +2413,20 @@ MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleVolumeL()"), _L("aIncrease = %d"), aIncrease ); - // - // Media player's CenRep volume range : 0 - number of volume steps - // MPX framework volume range : 0-100 - // TInt volume = iVolumeWatcher->CurrentValueL(); + TInt diff = iVolumeNormalizer; - if ( aIncrease ) + if ( ! aIncrease ) { - // - // increase the current volume - // - volume++; + diff *= -1; } - else if ( volume > 0 ) - { - // - // decrease the current volume - // - volume--; - } + + volume += diff; // // save the current volume level in CenRep // - SetVolumeCenRepL( volume * iVolumeNormalizer ); + SetVolumeCenRepL( volume ); } // ------------------------------------------------------------------------------------------------ @@ -2532,4 +2522,24 @@ #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackController::IsViewActivated() +// ------------------------------------------------------------------------------------------------ +// +TBool CMPXVideoPlaybackController::IsViewActivated() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated")); + return iViewActivated; +} + +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackController::HandleFrameReady() +// ------------------------------------------------------------------------------------------------ +// +void CMPXVideoPlaybackController::HandleFrameReady(TInt aError) +{ + MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady")); + + iPlaybackMode->HandleFrameReady(aError); +} // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/src/mpxvideoplaybackmode.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Thu May 27 12:53:14 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 25 % +// Version : %version: 29 % // @@ -35,6 +35,7 @@ #include "mpxvideofiledetails.h" #include #include "mpxvideodrmhelper.h" +#include "mpxvideoposterframesetter.h" // Constants const TUid KUidInterfaceMMFHelixController = {0x101F855D}; @@ -69,6 +70,12 @@ CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode() { MPX_DEBUG(_L("CMPXVideoPlaybackMode::~CMPXVideoPlaybackMode()")); + + if ( iPosterFrameSetter ) + { + delete iPosterFrameSetter; + iPosterFrameSetter = NULL; + } } // ---------------------------------------------------------------------------- @@ -177,31 +184,26 @@ { MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()")); - // - // Pause in all cases to remove the different behavior based on the decoder - // - iVideoPlaybackCtlr->iState->HandlePause(); - if ( iVideoPlaybackCtlr->iAppInForeground ) { if ( iVideoPlaybackCtlr->IsAlarm() ) { - iVideoPlaybackCtlr->iForegroundPause = ETrue; + iVideoPlaybackCtlr->iState->HandlePause(); } else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) { - iVideoPlaybackCtlr->iForegroundPause = ETrue; - iVideoPlaybackCtlr->SendHideControlsEventL(); + iVideoPlaybackCtlr->iState->HandlePause(); + TRAP_IGNORE( iVideoPlaybackCtlr->SendHideControlsEventL() ); } else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; + iVideoPlaybackCtlr->iState->HandlePause(); } } else { - iVideoPlaybackCtlr->iForegroundPause = EFalse; + iVideoPlaybackCtlr->iState->HandlePause(); } } @@ -221,11 +223,6 @@ MPX_TRAPD( err, iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError ) ); } - else if ( iVideoPlaybackCtlr->IsKeyLocked() && - iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) - { - iVideoPlaybackCtlr->iForegroundPause = ETrue; - } else { playAllowed = ETrue; @@ -276,6 +273,22 @@ return networkMode2g; } + +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackMode::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXVideoPlaybackMode::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleSetPosterFrame()")); +} + +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackMode::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXVideoPlaybackMode::HandleFrameReady(TInt /*aError*/) +{ + MPX_DEBUG(_L("CMPXLocalPlaybackMode::HandleFrameReady()")); +} //************************************************************************************************// // CMPXLocalPlaybackMode //************************************************************************************************// @@ -295,6 +308,30 @@ 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 //************************************************************************************************// @@ -386,10 +423,6 @@ MPX_TRAPD(err, iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoCallOngoingError )); } - else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) - { - //exit for live streaming - } else { MPX_TRAPD( err, @@ -489,10 +522,20 @@ { MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::HandleBackground()")); - // - // Pause in all cases to remove the different behavior based on the decoder - // - iVideoPlaybackCtlr->iState->HandlePause(); + if ( iVideoPlaybackCtlr->iAppInForeground ) + { + if ( iVideoPlaybackCtlr->IsPhoneCall() || + iVideoPlaybackCtlr->IsVideoCall() || + ( iVideoPlaybackCtlr->IsKeyLocked() && + iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) ) + { + iVideoPlaybackCtlr->iState->HandlePause(); + } + } + else + { + iVideoPlaybackCtlr->iState->HandlePause(); + } } //************************************************************************************************// diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/src/mpxvideoplaybackstate.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Thu May 27 12:53:14 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 41 % +// Version : %version: 43 % // @@ -173,6 +173,14 @@ } // ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackState::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXVideoPlaybackState::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()")); +} + +// ------------------------------------------------------------------------------------------------ // CMPXVideoPlaybackState::HandleForeground() // ------------------------------------------------------------------------------------------------ void CMPXVideoPlaybackState::HandleForeground() @@ -1195,8 +1203,6 @@ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; - IssuePlayCommand( EMPXVideoBuffering, MMPXPlaybackPluginObserver::EPBufferingStarted ); } else @@ -1365,6 +1371,18 @@ HandlePause(); } + +// ------------------------------------------------------------------------------------------------ +// CMPXPlayingState::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXPlayingState::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()")); + + iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); +} + + // ------------------------------------------------------------------------------------------------ // CMPXPlayingState::HandleStartSeekL() // ------------------------------------------------------------------------------------------------ @@ -1507,8 +1525,6 @@ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; - IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying ); } } @@ -1523,6 +1539,16 @@ } // ------------------------------------------------------------------------------------------------ +// CMPXPausedState::HandleSetPosterFrame() +// ------------------------------------------------------------------------------------------------ +void CMPXPausedState::HandleSetPosterFrame() +{ + MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()")); + + iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); +} + +// ------------------------------------------------------------------------------------------------ // CMPXPausedState::HandleSetPositionL() // ------------------------------------------------------------------------------------------------ void CMPXPausedState::HandleSetPositionL( TInt aPosition ) @@ -1595,17 +1621,9 @@ // ------------------------------------------------------------------------------------------------ void CMPXPausedState::HandleForeground() { - MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"), - _L("foreground pause = %d"), iVideoPlaybackCtlr->iForegroundPause ); + MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()")); - if ( iVideoPlaybackCtlr->iForegroundPause ) - { - iVideoPlaybackCtlr->iState->HandlePlay(); - } - else - { - MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() ); - } + MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() ); } // ------------------------------------------------------------------------------------------------ @@ -1619,8 +1637,6 @@ if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() ) { - iVideoPlaybackCtlr->iForegroundPause = EFalse; - IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse ); } } @@ -1779,7 +1795,7 @@ if ( aError == KErrNone ) { - if ( iVideoPlaybackCtlr->iAppInForeground && !iVideoPlaybackCtlr->iForegroundPause ) + if ( iVideoPlaybackCtlr->iAppInForeground ) { iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/src/mpxvideoplayerutility.cpp --- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Thu May 27 12:53:14 2010 +0300 @@ -16,13 +16,14 @@ */ -// Version : %version: 20 % +// Version : %version: 22 % #include #include #include #include +#include #include "mpxvideoplayerutility.h" #include "mpxvideoplaybackcontroller.h" @@ -45,7 +46,8 @@ } CMpxVideoPlayerUtility::CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl ) - : iVideoPlaybackController( aVideoPlaybackCtrl ) + : CActive( EPriorityStandard ) + , iVideoPlaybackController( aVideoPlaybackCtrl ) , iVideoControllerCustomCommands( iController ) , iVideoPlayControllerCustomCommands( iController ) , iAudioPlayDeviceCustomCommands( iController ) @@ -60,6 +62,8 @@ void CMpxVideoPlayerUtility::ConstructL() { OpenControllerL(); + + CActiveScheduler::Add( this ); } CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility() @@ -84,6 +88,17 @@ iController.Close(); iDirectScreenAccessAbort = EFalse; + + if ( IsActive() ) + { + Cancel(); + + if ( iPosterFrameBitmap ) + { + delete iPosterFrameBitmap; + iPosterFrameBitmap = NULL; + } + } } void CMpxVideoPlayerUtility::Reset() @@ -308,6 +323,55 @@ 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()")); @@ -485,22 +549,23 @@ if ( iSurfaceId.IsNull() ) { TSurfaceId surfaceId; - TRect cropRect; - TVideoAspectRatio aspectRatio; error = iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId, - cropRect, - aspectRatio ); + iCropRect, + iAspectRatio ); if ( error == KErrNone ) { - // - // Send data to the display handler to remove old surface and add new surface - // - MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated, - surfaceId, - cropRect, - aspectRatio ) ); + 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; } @@ -634,6 +699,23 @@ } } +// ------------------------------------------------------------------------------------------------- +// 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 diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/src/mpxvideoposterframesetter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/src/mpxvideoposterframesetter.cpp Thu May 27 12:53:14 2010 +0300 @@ -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 +#include + +#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 diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Thu May 27 12:53:14 2010 +0300 @@ -25,6 +25,7 @@ EPbCmdStretchAspectRatio 11 EPbCmdHandleIncreaseVolume 17 EPbCmdHandleDecreaseVolume 18 +EPbCmdSetPosterFrame 24 EMMFNatural 2 EMMFZoom 3 @@ -526,20 +527,7 @@ [Endtest] [Test] -title 33. Alarm: Auto resume -create videohelixtest test -test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone -waittestclass test -test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering -waittestclass test -test AlarmAutoResume EPbCmdHandleBackground EPbCmdHandleForeground -waittestclass test -delete test -pause 1000 -[Endtest] - -[Test] -title 34. Incoming Phone Call: Rejected +title 33. Incoming Phone Call: Rejected create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -552,7 +540,7 @@ [Endtest] [Test] -title 35. Incoming Voice Call: Accepted +title 34. Incoming Voice Call: Accepted create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -566,7 +554,7 @@ [Endtest] [Test] -title 36. Incoming Video Call: Accepted +title 35. Incoming Video Call: Accepted create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -580,7 +568,7 @@ [Endtest] [Test] -title 37. Play During Video Call +title 36. Play During Video Call create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -594,7 +582,7 @@ [Endtest] [Test] -title 38. Play During voice Call +title 37. Play During voice Call create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -608,7 +596,7 @@ [Endtest] [Test] -title 39. Initialise with SDP file via 32-bit file handle +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 @@ -617,7 +605,7 @@ [Endtest] [Test] -title 40. Tv-Out before Initialization - Playback Allowed +title 39. Tv-Out before Initialization - Playback Allowed create videohelixtest test test SetTvOutConnected ETvOutPlaybackAllowed test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone @@ -630,7 +618,7 @@ [Endtest] [Test] -title 41. Tv-Out after Initialization - Playback Allowed +title 40. Tv-Out after Initialization - Playback Allowed create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -644,7 +632,7 @@ [Endtest] [Test] -title 42. Tv-Out before Initialization - DRM Playback Allowed +title 41. Tv-Out before Initialization - DRM Playback Allowed create videohelixtest test test SetTvOutConnected ETvOutPlaybackAllowed test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone @@ -657,7 +645,7 @@ [Endtest] [Test] -title 43. Tv-Out after Initialization - DRM Playback Allowed +title 42. Tv-Out after Initialization - DRM Playback Allowed create videohelixtest test test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone waittestclass test @@ -670,7 +658,7 @@ [Endtest] [Test] -title 44. DRM Protected file with Rights +title 43. DRM Protected file with Rights create videohelixtest test test SetDrmProtected 0 test Initialize 0 10 dcf.odf KErrNone KErrNone KErrNone @@ -682,7 +670,7 @@ [Endtest] [Test] -title 45. DRM Protected file without rights +title 44. DRM Protected file without rights create videohelixtest test test SetDrmProtected -17452 test Initialize 0 10 vhpp_test.3gp KErrNone KErrNone -17452 @@ -695,7 +683,7 @@ [Endtest] [Test] -title 46. EndOfClip Custom Commands +title 45. EndOfClip Custom Commands create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -705,7 +693,7 @@ [Endtest] [Test] -title 47. PDL - Not enough Data +title 46. PDL - Not enough Data create videohelixtest test test ConnectToDownload 2 vhpp_test.3gp waittestclass test @@ -719,7 +707,7 @@ [Endtest] [Test] -title 48. Handle volume increase (10-steps) +title 47. Handle volume increase (10-steps) create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -739,7 +727,7 @@ [Endtest] [Test] -title 49. Handle volume decrease (10-steps) +title 48. Handle volume decrease (10-steps) create videohelixtest test test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -759,7 +747,7 @@ [Endtest] [Test] -title 50. Handle volume increase (20-steps) +title 49. Handle volume increase (20-steps) create videohelixtest test test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -779,7 +767,7 @@ [Endtest] [Test] -title 51. Handle volume decrease (20-steps) +title 50. Handle volume decrease (20-steps) create videohelixtest test test Initialize 60000 20 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -799,7 +787,7 @@ [Endtest] [Test] -title 52. InitialiseL with 64-bit file handle +title 51. InitialiseL with 64-bit file handle create videohelixtest test test InitializeHandle ERFile64 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone waittestclass test @@ -808,7 +796,7 @@ [Endtest] [Test] -title 53. Initialise with SDP file via 64-bit file handle +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 @@ -817,7 +805,7 @@ [Endtest] [Test] -title 54. InitialiseWithPositionL with file missing +title 53. InitialiseWithPositionL with file missing create videohelixtest test test InitializeWithPositionL 0 10 6575 vhpp_nofile.3gp KErrNotFound KErrNone KErrNone waittestclass test @@ -828,7 +816,7 @@ [Endtest] [Test] -title 55. InitialiseL with 32-bit file handle +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 @@ -837,7 +825,7 @@ [Endtest] [Test] -title 56. Initialise with rtsp link & AP +title 55. Initialise with rtsp link & AP create videohelixtest test test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone waittestclass test @@ -846,7 +834,7 @@ [Endtest] [Test] -title 57. Play rtsp link (forces buffering state) +title 56. Play rtsp link (forces buffering state) create videohelixtest test test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone waittestclass test @@ -857,7 +845,7 @@ [Endtest] [Test] -title 58. Initialise with SDP file via 32-bit file handle +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 @@ -866,7 +854,7 @@ [Endtest] [Test] -title 59. InitialiseL with 64-bit file handle +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 @@ -875,7 +863,7 @@ [Endtest] [Test] -title 60. Initialise with SDP file via 64-bit file handle +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 @@ -883,3 +871,15 @@ 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] diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#8 % +// Version : %version: 9 % @@ -51,6 +51,7 @@ SOURCE mediarecognizer_stub.cpp SOURCE mpxvideoaccessoryobserver_stub.cpp SOURCE mpxvideodrmhelper_stub.cpp +SOURCE tnmgr_stub.cpp SOURCEPATH ../../../src SOURCE mpxvideodlmgrif.cpp @@ -60,6 +61,7 @@ SOURCE mpxvideoplaybackmode.cpp SOURCE mpxvideoplaybackstate.cpp SOURCE mpxvideoseeker.cpp +SOURCE mpxvideoposterframesetter.cpp LIBRARY euser.lib @@ -89,5 +91,6 @@ LIBRARY flogger.lib LIBRARY playbackhelper.lib LIBRARY hwrmlightclient.lib // Lights control +LIBRARY fbscli.lib // End of File diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 12 % +// Version : %version: 14 % #ifndef __MPXVIDEOPLAYERUTILITY__ @@ -42,6 +42,7 @@ // FORWARD DECLARATIONS // class CMPXVideoPlaybackController; +class CFbsBitmap; // // CLASS DECLARATION @@ -112,6 +113,9 @@ void SetVolumeSteps( TInt aVolumeSteps ); void SurfaceRemovedFromView(); + + void GetFrameL(); + CFbsBitmap& GetBitmap(); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API void OpenFile64L( const RFile64& aFile ); @@ -122,6 +126,7 @@ TInt VideoSurfaceCreated(); TInt SurfaceParametersChanged(); TInt RemoveSurface(); + void SendSurfaceCreatedCommand(); #endif @@ -179,6 +184,8 @@ TTimeIntervalMicroSeconds iPosition; TTimeIntervalMicroSeconds iDuration; + + CFbsBitmap* iPosterFrameBitmap; }; #endif /* __MPXVIDEOPLAYERUTILITY__ */ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/tnmgr_stub.h Thu May 27 12:53:14 2010 +0300 @@ -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_ */ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 13 % +// Version : %version: 14 % #ifndef __VHPPTESTCASE_H__ @@ -155,7 +155,6 @@ virtual TInt ChangeAspectRatioL( CStifItemParser& aItem ); virtual TInt AlarmOn( CStifItemParser& aItem ); - virtual TInt AlarmAutoResume( CStifItemParser& aItem ); virtual TInt PhoneCallRejected( CStifItemParser& aItem ); virtual TInt VoiceCallAccepted( CStifItemParser& aItem ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 15 % +// Version : %version: 17 % #include #include @@ -425,6 +425,29 @@ 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() { @@ -753,6 +776,11 @@ return KErrNone; } +void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand() +{ + MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()")); +} + #endif #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/tnmgr_stub.cpp Thu May 27 12:53:14 2010 +0300 @@ -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: 1 % + +#include +#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 ) +{ +} + + diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtest.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: 7 % // INCLUDE FILES @@ -129,10 +129,10 @@ // // CenRep volume range is 0 - number of steps (either 10 or 20). - // Set default CenRep values as volume(4), mute(0) + // Set default CenRep values as volume(40), mute(0) // CRepository* volCenRep = CRepository::NewL( KCRUidMPXVideoSettings ); - volCenRep->Set( KMPXVideoPlaybackVolume, 4 ); + volCenRep->Set( KMPXVideoPlaybackVolume, 40 ); volCenRep->Set( KMPXVideoPlaybackMute, 0 ); delete volCenRep; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 21 % +// Version : %version: 23 % // [INCLUDE FILES] - do not remove @@ -99,7 +99,6 @@ ENTRY( "ChangeAspectRatioL", CVHPPTestClass::ChangeAspectRatioL), ENTRY( "AlarmOn", CVHPPTestClass::AlarmOn), - ENTRY( "AlarmAutoResume", CVHPPTestClass::AlarmAutoResume), ENTRY( "PhoneCallRejected", CVHPPTestClass::PhoneCallRejected), ENTRY( "VoiceCallAccepted", CVHPPTestClass::VoiceCallAccepted), ENTRY( "VideoCallAccepted", CVHPPTestClass::VideoCallAccepted), @@ -1724,51 +1723,6 @@ } // ----------------------------------------------------------------------------- -// CVHPPTestClass::AlarmOnAndOff -// ----------------------------------------------------------------------------- -// -TInt -CVHPPTestClass::AlarmAutoResume( CStifItemParser& aItem ) -{ - MPX_ENTER_EXIT(_L("CVHPPTestClass::AlarmOnAndOff()")); - iLog->Log(_L("CVHPPTestClass::AlarmOnAndOff()")); - - TInt backgroundCmd = 0; - TInt err = 0;//aItem.GetNextInt( backgroundCmd ); - - err = AlarmOn(aItem); - - if ( err == KErrNone ) - { - err = aItem.GetNextInt( backgroundCmd ); - - //reset alarm - RProperty::Set( KPSUidCoreApplicationUIs, KLightsAlarmLightActive, ELightsNotBlinking ); - - if ( err == KErrNone ) - { - TCallbackEvent* event = new TCallbackEvent; - event->iError = 0; - event->iData = 0; - event->iEvent = EPPlaying; - AddExpectedEvent( event ); - - //auto resume if alarm off - CMPXCommand* cmdPlay = CMPXCommand::NewL(); - CleanupStack::PushL( cmdPlay ); - cmdPlay->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); - cmdPlay->SetTObjectValueL( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback ); - cmdPlay->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, backgroundCmd ); - cmdPlay->SetTObjectValueL( KMPXMediaVideoAppForeground, ETrue ); - iPlaybackPlugin->CommandL( *cmdPlay ); - CleanupStack::PopAndDestroy( cmdPlay ); - } - } - - return err; -} - -// ----------------------------------------------------------------------------- // CVHPPTestClass::PhoneCallRejected // ----------------------------------------------------------------------------- // diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/bwins/videoplayerengineu.def --- a/videoplayerapp/bwins/videoplayerengineu.def Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/bwins/videoplayerengineu.def Thu May 27 12:53:14 2010 +0300 @@ -50,4 +50,5 @@ ?createPlayAndDetailsViews@QVideoPlayerEngine@@AAEXXZ @ 49 NONAME ; void QVideoPlayerEngine::createPlayAndDetailsViews(void) ?setCurrentView@QVideoPlayerEngine@@AAEXXZ @ 50 NONAME ; void QVideoPlayerEngine::setCurrentView(void) ?sortRole@VideoServices@@QBEHXZ @ 51 NONAME ; int VideoServices::sortRole(void) const + ?isPlayServiceInvoked@QVideoPlayerEngine@@AAE_NXZ @ 52 NONAME ; bool QVideoPlayerEngine::isPlayServiceInvoked(void) diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/eabi/videoplayerengineu.def --- a/videoplayerapp/eabi/videoplayerengineu.def Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/eabi/videoplayerengineu.def Thu May 27 12:53:14 2010 +0300 @@ -50,4 +50,5 @@ _ZN18QVideoPlayerEngine25createPlayAndDetailsViewsEv @ 49 NONAME _ZN18QVideoPlayerEngine14setCurrentViewEv @ 50 NONAME _ZNK13VideoServices8sortRoleEv @ 51 NONAME + _ZN18QVideoPlayerEngine20isPlayServiceInvokedEv @ 52 NONAME diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/hbvideoplayer/hbvideoplayer.pro --- a/videoplayerapp/hbvideoplayer/hbvideoplayer.pro Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/hbvideoplayer/hbvideoplayer.pro Thu May 27 12:53:14 2010 +0300 @@ -14,7 +14,7 @@ # Description: Project file for building Videoplayer components # # -# Version : %version: da1mmcf#16 % +# Version : %version: da1mmcf#17 % TARGET = videoplayer @@ -64,7 +64,6 @@ " DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; }, " \ " DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; }, " \ " DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; }, " \ -" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-matroska\"; }, " \ " DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-wmv\"; }, " \ " DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-ms-asf\"; }, " \ " DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gp\"; }, " \ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/hbvideoplayer/resources/service_conf.xml --- a/videoplayerapp/hbvideoplayer/resources/service_conf.xml Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/hbvideoplayer/resources/service_conf.xml Thu May 27 12:53:14 2010 +0300 @@ -1,26 +1,44 @@ - com.nokia.Videos + videoplayer No path Video services IVideoFetch 1.0 Interface to fetch video URI + Video Fetcher + + + com.nokia.symbian.IVideoFetch + 1.0 + Interface to fetch video URI + + + IVideoBrowse + 1.0 + Interface to browse categorized video content + Video Browse + + + com.nokia.symbian.IVideoBrowse + 1.0 + Interface to browse categorized video content IVideoView 1.0 Interface to play a video + Video View + com.nokia.symbian.IVideoView + 1.0 + Interface to play a video + + com.nokia.symbian.IFileView 1.0 Interface for playing video given a QFile - - IVideoBrowse - 1.0 - Interface to browse categorized video content - - + \ No newline at end of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/hbvideoplayer/src/main.cpp --- a/videoplayerapp/hbvideoplayer/src/main.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/hbvideoplayer/src/main.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 9 % +// Version : %version: 10 % #include @@ -48,6 +48,20 @@ // Install the translator app.installTranslator(&translator); + QTranslator translatorCommon; + + loaded = false; + + loaded = translatorCommon.load( "common_" + lang, QString("c:/resource/qt/translations") ); + + if (!loaded) + { + translatorCommon.load("common_" + lang, QString("z:/resource/qt/translations") ); + } + + // Install the common translator + app.installTranslator(&translatorCommon); + // has the application been launched via XQ Service Framework bool isService = XQServiceUtil::isService(); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/inc/videoplayerengine.h --- a/videoplayerapp/inc/videoplayerengine.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/inc/videoplayerengine.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 12 % +// Version : %version: 13 % #ifndef VIDEOPLAYERENGINE_H #define VIDEOPLAYERENGINE_H @@ -80,11 +80,14 @@ void createPlayAndDetailsViews(); void setCurrentView(); + + bool isPlayServiceInvoked(); private: bool mIsService; bool mEmbedded; bool mDelayedLoadDone; + bool mIsPlayService; MpxViewPlugin* mCurrentViewPlugin; MpxViewPlugin* mPlaybackViewPlugin; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/inc/videoservicebrowse.h --- a/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #ifndef VIDEOSERVICEBROWSE_H #define VIDEOSERVICEBROWSE_H @@ -25,13 +25,14 @@ // FORWARD DECLARATIONS class VideoServices; +class QLatin1String; class VideoServiceBrowse : public XQServiceProvider { Q_OBJECT public: - VideoServiceBrowse( VideoServices *parent = 0 ); + VideoServiceBrowse( VideoServices *parent, QLatin1String service ); ~VideoServiceBrowse(); public: @@ -68,6 +69,14 @@ */ int sortRole() const; + /** + * Returns service active status + * + * @return bool true if active, false if not active + * + */ + bool isActive(); + public slots: /** @@ -80,6 +89,15 @@ */ void browseVideos(const QString &title, int category, int sortRole); + /** + * Browse video + * + * @param category, Category which type of videos are browsed + * @param sort, Sort type. + * @return None + */ + void browseVideos(int category, int sortRole); + private: /** request index of the service */ int mRequestIndex; diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/inc/videoserviceplay.h --- a/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/inc/videoserviceplay.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: da1mmcf#2 % #ifndef __VIDEOSERVICEPLAY_H__ #define __VIDEOSERVICEPLAY_H__ @@ -26,6 +26,7 @@ // FORWARD DECLARATIONS class VideoServices; class QVideoPlayerEngine; +class QLatin1String; class VideoServicePlay : public XQServiceProvider { @@ -33,7 +34,7 @@ Q_OBJECT public: - VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine ); + VideoServicePlay( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service ); virtual ~VideoServicePlay(); void setEngine( QVideoPlayerEngine* engine ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h --- a/videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h Thu May 27 12:53:14 2010 +0300 @@ -24,6 +24,7 @@ // FORWARD DECLARATIONS class VideoServices; +class QLatin1String; class VideoServiceUriFetch : public XQServiceProvider { @@ -38,7 +39,7 @@ /** * contructor */ - VideoServiceUriFetch( VideoServices *parent = 0 ); + VideoServiceUriFetch( VideoServices *parent, QLatin1String service ); /** * destructor @@ -73,6 +74,12 @@ /* * Client can use this method launch video URI fetching * + */ + void fetch(); + + /* + * Client can use this method launch video URI fetching + * * @param title title to be set * */ diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/inc/videoserviceview.h --- a/videoplayerapp/videoplayerengine/inc/videoserviceview.h Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/inc/videoserviceview.h Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % #ifndef __VIDEOSERVICEVIEW_H__ #define __VIDEOSERVICEVIEW_H__ @@ -28,6 +28,7 @@ class VideoServices; class QVideoPlayerEngine; class QFile; +class QLatin1String; class VideoServiceView : public XQServiceProvider { @@ -35,7 +36,7 @@ Q_OBJECT public: - VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine ); + VideoServiceView( VideoServices *parent, QVideoPlayerEngine* engine, QLatin1String service ); virtual ~VideoServiceView(); void setEngine( QVideoPlayerEngine* engine ); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/src/videoplayerengine.cpp --- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 27 % +// Version : %version: da1mmcf#30 % #include @@ -39,6 +39,7 @@ : mIsService( isService ) , mEmbedded( false ) , mDelayedLoadDone( false ) + , mIsPlayService( false ) , mCurrentViewPlugin( 0 ) , mPlaybackViewPlugin( 0 ) , mCollectionViewPlugin( 0 ) @@ -120,25 +121,22 @@ QList impls; XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls); - - // - // Pre-load collection plugin and create collection view - // - loadPluginAndCreateView( MpxHbVideoCommon::CollectionView ); - - // - // if app is opened via serviceFW create remaining views - // otherwise activate default view i.e. the collection view. - // - if ( mIsService ) + + if ( isPlayServiceInvoked() ) { createPlayAndDetailsViews(); } else - { - activateView( MpxHbVideoCommon::CollectionView ); + { + loadPluginAndCreateView( MpxHbVideoCommon::CollectionView ); + + if((mIsService && !(XQServiceUtil::interfaceName().contains("IVideoBrowse"))) || !mIsService) + { + //Browse service will activate view once the category to be opened is informed from highway + activateView( MpxHbVideoCommon::CollectionView ); + } } - + } // ------------------------------------------------------------------------------------------------- @@ -224,7 +222,9 @@ loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView ); } - if ( ! mFileDetailsViewPlugin ) + // details view need not be created for playback via serviceFW + if ( ! mIsPlayService && + ! mFileDetailsViewPlugin ) { loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView ); } @@ -492,5 +492,29 @@ } } +// ------------------------------------------------------------------------------------------------- +// isPlayServiceInvoked() +// ------------------------------------------------------------------------------------------------- +// +bool QVideoPlayerEngine::isPlayServiceInvoked() +{ + MPX_ENTER_EXIT(_L("QVideoPlayerEngine::isPlayServiceInvoked()")); + + bool result = false; + + if ( mIsService ) + { + QString intface = XQServiceUtil::interfaceName(); + + if ( intface.contains("IVideoView") || + intface.contains("IFileView") ) + { + result = true; + mIsPlayService = true; + } + } + + return result; +} // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp --- a/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #include @@ -23,13 +23,14 @@ #include "videoservicebrowse.h" #include "mpxhbvideocommondefs.h" #include "mpxvideo_debug.h" +#include // ------------------------------------------------------------------------------------------------- // VideoServiceBrowse() // ------------------------------------------------------------------------------------------------- // -VideoServiceBrowse::VideoServiceBrowse( VideoServices* parent ) - : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoBrowse"), parent ) +VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service) + : XQServiceProvider( service, parent ) , mRequestIndex( 0 ) , mServiceApp( parent ) , mCategory( 0 ) @@ -128,14 +129,67 @@ mCategory = category; mSortRole = sortRole; + // store async request id + mRequestIndex = setCurrentRequestAsync(); + // start service mServiceApp->setCurrentService(VideoServices::EBrowse); emit mServiceApp->titleReady(appTitle); emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); - // store async request id - mRequestIndex = setCurrentRequestAsync(); MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); } +// ---------------------------------------------------------------------------- +// isActive() +// ---------------------------------------------------------------------------- +// +bool VideoServiceBrowse::isActive() +{ + MPX_DEBUG(_L("VideoServiceBrowse::isActive() ret %d"), mRequestIndex ); + + return (mRequestIndex > 0); +} + +// ------------------------------------------------------------------------------------------------- +// browseVideos() +// ------------------------------------------------------------------------------------------------- +// +void VideoServiceBrowse::browseVideos(int category, int sortRole) +{ + MPX_ENTER_EXIT(_L("VideoServiceBrowse::browseVideos()")); + + // set application title + XQRequestInfo info = requestInfo(); + + QVariant variant = info.info("WindowTitle"); + + QString appTitle; + + if(variant.isValid()) + { + appTitle = variant.toString(); + } + + if (appTitle.isEmpty()) + { + appTitle = hbTrId("txt_videos_title_videos"); + } + + mTitle = appTitle; + mCategory = category; + mSortRole = sortRole; + + // store async request id + mRequestIndex = setCurrentRequestAsync(); + + // start service + mServiceApp->setCurrentService(VideoServices::EBrowse); + emit mServiceApp->titleReady(appTitle); + emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); + + MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); +} + + // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/src/videoserviceplay.cpp --- a/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: da1mmcf#5 % #include "videoservices.h" #include "videoserviceplay.h" @@ -27,8 +27,10 @@ // VideoServicePlay() // ------------------------------------------------------------------------------------------------- // -VideoServicePlay::VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine ) - : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoView"), parent ) +VideoServicePlay::VideoServicePlay( VideoServices* parent, + QVideoPlayerEngine* engine, + QLatin1String service ) + : XQServiceProvider( service, parent ) , mEngine( engine ) , mServiceApp( parent ) { diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/src/videoservices.cpp --- a/videoplayerapp/videoplayerengine/src/videoservices.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 6 % +// Version : %version: da1mmcf#8 % #include "videoplayerengine.h" #include "videoservices.h" @@ -24,6 +24,8 @@ #include "videoserviceview.h" #include "videoservicebrowse.h" #include "mpxvideo_debug.h" +#include +#include VideoServices *VideoServices::mInstance = 0; @@ -110,11 +112,23 @@ , mFetchSelected( false ) { MPX_ENTER_EXIT(_L("VideoServices::VideoServices()")); + + mServicePlay = new VideoServicePlay(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IVideoView")); //New service, new interface + mServiceView = new VideoServiceView(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IFileView")); //New service, new interface + mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("videoplayer.com.nokia.symbian.IVideoFetch")); //New service, new interface + mServiceBrowse = new VideoServiceBrowse( this, QLatin1String("videoplayer.com.nokia.symbian.IVideoBrowse")); //New service, new interface + + mServicePlayDeprecatedNewService = new VideoServicePlay(this, engine, QLatin1String("videoplayer.IVideoView")); //New service, old interface + mServicePlayDeprecatedOldService = new VideoServicePlay(this, engine, QLatin1String("com.nokia.Videos.IVideoView")); //Old service, old interface - mServiceUriFetch = new VideoServiceUriFetch(this); - mServicePlay = new VideoServicePlay(this, engine); - mServiceView = new VideoServiceView(this, engine); - mServiceBrowse = new VideoServiceBrowse(this); + mServiceViewDeprecatedNewService = new VideoServiceView(this, engine, QLatin1String("videoplayer.IFileView")); //New service, old interface + mServiceViewDeprecatedOldService = new VideoServiceView(this, engine, QLatin1String("com.nokia.Videos.IFileView")); //Old service, old interface + + mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch(this, QLatin1String("videoplayer.IVideoFetch")); //New service, old interface + mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch(this, QLatin1String("com.nokia.Videos.IVideoFetch")); //Old service, old interface + + mServiceBrowseDeprecatedNewService = new VideoServiceBrowse(this, QLatin1String("videoplayer.IVideoBrowse")); //New service, old interface + mServiceBrowseDeprecatedOldService = new VideoServiceBrowse(this, QLatin1String("com.nokia.Videos.IVideoBrowse")); //Old service, old interface } // ---------------------------------------------------------------------------- @@ -129,6 +143,14 @@ delete mServicePlay; delete mServiceView; delete mServiceBrowse; + delete mServicePlayDeprecatedNewService; + delete mServicePlayDeprecatedOldService; + delete mServiceViewDeprecatedNewService; + delete mServiceViewDeprecatedOldService; + delete mServiceBrowseDeprecatedNewService; + delete mServiceUriFetchDeprecatedNewService; + delete mServiceBrowseDeprecatedOldService; + delete mServiceUriFetchDeprecatedOldService; } // ---------------------------------------------------------------------------- @@ -151,12 +173,23 @@ MPX_DEBUG(_L("VideoServices::getBrowseCategory()")); int category = 0; - - if ( mServiceBrowse ) + + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) { category = mServiceBrowse->getBrowseCategory(); } - + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + category = mServiceBrowseDeprecatedNewService->getBrowseCategory(); + } + else + { + category = mServiceBrowseDeprecatedOldService->getBrowseCategory(); + } + } + return category; } @@ -180,14 +213,42 @@ MPX_DEBUG(_L("VideoServices::contextTitle()") ); QString title; - - if (mCurrentService == VideoServices::EUriFetcher && mServiceUriFetch) + + if (mCurrentService == VideoServices::EUriFetcher) { - title = mServiceUriFetch->contextTitle(); + if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian"))) + { + title = mServiceUriFetch->contextTitle(); + } + else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if(mServiceUriFetchDeprecatedNewService->isActive()) + { + title = mServiceUriFetchDeprecatedNewService->contextTitle(); + } + else + { + title = mServiceUriFetchDeprecatedOldService->contextTitle(); + } + } } - else if (mCurrentService == VideoServices::EBrowse && mServiceBrowse) + else if (mCurrentService == VideoServices::EBrowse) { - title = mServiceBrowse->contextTitle(); + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) + { + title = mServiceBrowse->contextTitle(); + } + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + title = mServiceBrowseDeprecatedNewService->contextTitle(); + } + else + { + title = mServiceBrowseDeprecatedOldService->contextTitle(); + } + } } return title; @@ -202,10 +263,24 @@ MPX_ENTER_EXIT(_L("VideoServices::sortType()")); int sortRole = 0; - - if (mCurrentService == EBrowse && mServiceBrowse) + + if (mCurrentService == EBrowse) { - sortRole = mServiceBrowse->sortRole(); + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) + { + sortRole = mServiceBrowse->sortRole(); + } + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + sortRole = mServiceBrowseDeprecatedNewService->sortRole(); + } + else + { + sortRole = mServiceBrowseDeprecatedOldService->sortRole(); + } + } } return sortRole; @@ -222,7 +297,22 @@ QStringList list; list.append( item ); - mServiceUriFetch->complete( list ); + + if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian"))) + { + mServiceUriFetch->complete( list ); + } + else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService) + { + if (mServiceUriFetchDeprecatedNewService->isActive()) + { + mServiceUriFetchDeprecatedNewService->complete( list ); + } + else + { + mServiceUriFetchDeprecatedOldService->complete( list ); + } + } mFetchSelected = true; } @@ -233,11 +323,22 @@ void VideoServices::browsingEnded() { MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()")); - - if ( mServiceBrowse ) - { - mServiceBrowse->complete(); - } + + if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) + { + mServiceBrowse->complete(); + } + else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) + { + if (mServiceBrowseDeprecatedNewService->isActive()) + { + mServiceBrowseDeprecatedNewService->complete(); + } + else + { + mServiceBrowseDeprecatedOldService->complete(); + } + } } // End of file diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp --- a/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: 5 % #include @@ -23,14 +23,15 @@ #include "videoserviceurifetch.h" #include "mpxhbvideocommondefs.h" #include "mpxvideo_debug.h" +#include // ---------------------------------------------------------------------------- // VideoServiceUriFetch() // ---------------------------------------------------------------------------- // -VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent) - : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoFetch"), parent ) +VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent, QLatin1String service) + : XQServiceProvider( service, parent ) , mRequestIndex( 0 ) , mServiceApp( parent ) { @@ -125,14 +126,52 @@ // fetch() // ---------------------------------------------------------------------------- // +void VideoServiceUriFetch::fetch() +{ + MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()")); + + emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); + + XQRequestInfo info = requestInfo(); + + QVariant variant = info.info("WindowTitle"); + + if(variant.isValid()) + { + mTitle = variant.toString(); + } + + if (mTitle.isEmpty()) + { + mTitle = hbTrId("txt_videos_title_videos"); + } + + emit mServiceApp->titleReady(mTitle); + mServiceApp->setCurrentService(VideoServices::EUriFetcher); + + mRequestIndex = setCurrentRequestAsync(); + MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex ); +} + +// ---------------------------------------------------------------------------- +// fetch() +// ---------------------------------------------------------------------------- +// void VideoServiceUriFetch::fetch(const QString& title) { - MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"), + MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"), _L("title = %s"), title.data() ); + emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); + mTitle = title; - emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); - emit mServiceApp->titleReady(title); + + if (mTitle.isEmpty()) + { + mTitle = hbTrId("txt_videos_title_videos"); + } + + emit mServiceApp->titleReady(mTitle); mServiceApp->setCurrentService(VideoServices::EUriFetcher); diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/src/videoserviceview.cpp --- a/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #include "videoservices.h" #include "videoserviceview.h" @@ -26,8 +26,10 @@ // VideoServiceView() // ------------------------------------------------------------------------------------------------- // -VideoServiceView::VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine ) - : XQServiceProvider( QLatin1String("com.nokia.Videos.com.nokia.symbian.IFileView"), parent ) +VideoServiceView::VideoServiceView( VideoServices* parent, + QVideoPlayerEngine* engine, + QLatin1String service ) + : XQServiceProvider( service, parent ) , mEngine( engine ) , mServiceApp( parent ) { diff -r b9e04db066d4 -r 7d93ee07fb27 videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp --- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Fri May 14 15:53:50 2010 +0300 +++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Thu May 27 12:53:14 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: % +// Version : %version: da1mmcf#12 % // INCLUDES #include @@ -97,6 +97,13 @@ mVideoServices = 0; mTestObject = new QVideoPlayerEngine(isService); + + if ( isService ) + { + mTestObject->mIsPlayService = true; + } + + } void TestVideoPlayerEngine::cleanup() @@ -214,10 +221,10 @@ mTestObject->initialize(); - QVERIFY(mTestObject->mCurrentViewPlugin == 0); - QVERIFY(mTestObject->mPlaybackViewPlugin != 0); + QVERIFY(mTestObject->mCurrentViewPlugin != 0); + QVERIFY(mTestObject->mPlaybackViewPlugin == 0); QVERIFY(mTestObject->mCollectionViewPlugin != 0); - QVERIFY(mTestObject->mFileDetailsViewPlugin != 0); + QVERIFY(mTestObject->mFileDetailsViewPlugin == 0); QVERIFY(mTestObject->mPlaybackWrapper != 0); QVERIFY(mTestObject->mVideoServices != 0); QVERIFY(mTestObject->mIsService == true); @@ -291,10 +298,10 @@ mTestObject->initialize(); - QVERIFY(mTestObject->mCurrentViewPlugin == 0); - QVERIFY(mTestObject->mPlaybackViewPlugin != 0); + QVERIFY(mTestObject->mCurrentViewPlugin != 0); + QVERIFY(mTestObject->mPlaybackViewPlugin == 0); QVERIFY(mTestObject->mCollectionViewPlugin != 0); - QVERIFY(mTestObject->mFileDetailsViewPlugin != 0); + QVERIFY(mTestObject->mFileDetailsViewPlugin == 0); QVERIFY(mTestObject->mVideoServices != 0); QVERIFY(mTestObject->mIsService == true); QVERIFY(VideoServices::mReferenceCount == 1);