--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/videoplayerappexport.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: DLL export macro for videoplayer app.
+*
+*/
+
+#ifndef _VIDEOPLAYERAPPEXPORT_H
+#define _VIDEOPLAYERAPPEXPORT_H
+
+// System includes
+#include <qglobal.h>
+
+#ifdef BUILD_VIDEOPLAYERAPP_DLL
+ #define VIDEOPLAYERAPP_DLL_EXPORT Q_DECL_EXPORT
+#else
+ #define VIDEOPLAYERAPP_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // _VIDEOPLAYERAPPEXPORT_H
+
+// End of file.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/videoservices.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VideoServices class definition
+*
+*/
+
+#ifndef __VIDEOSERVICES_H__
+#define __VIDEOSERVICES_H__
+
+#include <QStringList>
+#include "videoplayerappexport.h"
+
+//FORWARD CLASS DECLARATION
+class VideoServiceUriFetch;
+class VideoServicePlay;
+class VideoServiceView;
+class VideoServiceBrowse;
+class QVideoPlayerEngine;
+
+class VIDEOPLAYERAPP_DLL_EXPORT VideoServices : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * Returns singleton instance for this class.
+ *
+ * WARNING! Not safe to call this from destructor of another function scope static object!
+ *
+ * @return The singleton instance.
+ */
+ static VideoServices *instance(QVideoPlayerEngine* engine = 0);
+
+ /**
+ * Decreases the reference count, when count reaches zero cleanup is done.
+ *
+ */
+ void decreaseReferenceCount();
+
+ /**
+ * Returns the context title set by service requestee
+ *
+ * @return QString the title
+ *
+ */
+ QString contextTitle() const;
+
+ /*
+ * Enum reflecting the services provided
+ */
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView,
+ EBrowse
+ };
+
+ /**
+ * Returns service active status
+ *
+ * @return bool true if active, false if not active
+ *
+ */
+ VideoServices::TVideoService currentService();
+
+ /**
+ * Returns browsing category.
+ *
+ * @return see vcxmyvideosdef.h for default categories.
+ */
+ int getBrowseCategory() const;
+
+public slots:
+ void itemSelected(const QString& item);
+ void browsingEnded();
+
+signals:
+ /*
+ * Emitted when service user has set the title
+ */
+ void titleReady(const QString& title);
+
+ /*
+ * Emitted to acticate requested plugin
+ */
+ void activated(int command);
+
+private:
+
+ /**
+ * Constructor
+ */
+ VideoServices();
+
+ /**
+ * Constructor
+ */
+ VideoServices(QVideoPlayerEngine* engine);
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoServices();
+
+ void setEngine(QVideoPlayerEngine* engine);
+
+ /**
+ * Sets the active service
+ *
+ * @param service
+ *
+ */
+ void setCurrentService(VideoServices::TVideoService service);
+
+ /**
+ * Returns the current engine
+ *
+ * @return engine
+ *
+ */
+ QVideoPlayerEngine* engine();
+
+ Q_DISABLE_COPY(VideoServices)
+
+private:
+
+ /**
+ * Reference count.
+ */
+ int mReferenceCount;
+
+ /**
+ * Singleton instance.
+ */
+ static VideoServices* mInstance;
+
+ /**
+ * VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetch;
+
+ /**
+ * VideoServicePlay service instance.
+ */
+ VideoServicePlay* mServicePlay;
+
+ /**
+ * VideoServiceView service instance.
+ */
+ VideoServiceView* mServiceView;
+
+ /**
+ * VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowse;
+
+ /**
+ * Pointer of QVideoPlayerEngine.
+ */
+ QVideoPlayerEngine* mEngine;
+
+ /*
+ * Current service
+ */
+ VideoServices::TVideoService mCurrentService;
+
+ friend class VideoServiceUriFetch;
+
+ friend class VideoServicePlay;
+
+ friend class VideoServiceView;
+
+ friend class VideoServiceBrowse;
+ };
+
+#endif //__VIDEOSERVICES_H__
--- a/layers.sysdef.xml Fri Apr 16 14:59:52 2010 +0300
+++ b/layers.sysdef.xml Mon May 03 12:32:50 2010 +0300
@@ -19,6 +19,7 @@
<unit unitID="vado.testhintwidget" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testhintwidget" proFile="testhintwidget.pro" name="unittest.testhintwidget"/>
<unit unitID="vado.testlistview" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testlistview" proFile="testlistview.pro" name="unittest.testlistview"/>
<unit unitID="vado.testlistwidget" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testlistwidget" proFile="testlistwidget.pro" name="unittest.testlistwidget"/>
+ <unit unitID="vado.testvideocollectionuiloader" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testvideocollectionuiloader" proFile="testvideocollectionuiloader.pro" name="unittest.testvideocollectionuiloader"/>
<unit unitID="vado.testvideocollectionviewutils" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testvideocollectionviewutils" proFile="testvideocollectionviewutils.pro" name="unittest.testvideocollectionviewutils"/>
<unit unitID="vado.testvideolistselectiondialog" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionview/tsrc/testvideolistselectiondialog" proFile="testvideolistselectiondialog.pro" name="unittest.testvideolistselectiondialog"/>
<unit unitID="vado.testvideocollectionclient" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient" proFile="testvideocollectionclient.pro" name="unittest.testvideocollectionclient"/>
@@ -31,6 +32,7 @@
<unit unitID="vado.testvideosortfilterproxymodel" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel" proFile="testvideosortfilterproxymodel.pro" name="unittest.testvideosortfilterproxymodel"/>
<unit unitID="vado.testvideothumbnaildata" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata" proFile="testvideothumbnaildata.pro" name="unittest.testvideothumbnaildata"/>
<unit unitID="vado.testvideothumbnaildata_p" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p" proFile="testvideothumbnaildata_p.pro" name="unittest.testvideothumbnaildata_p"/>
+ <unit unitID="vado.testvideothumbnailfetcher" mrp="" bldFile="&layer_real_source_path;/videocollection/videocollectionwrapper/tsrc/testvideothumbnailfetcher" proFile="testvideothumbnailfetcher.pro" name="unittest.testvideothumbnailfetcher"/>
</module>
</layer>
--- a/mediasettings/mediasettingsengine/group/bld.inf Fri Apr 16 14:59:52 2010 +0300
+++ b/mediasettings/mediasettingsengine/group/bld.inf Mon May 03 12:32:50 2010 +0300
@@ -16,7 +16,7 @@
-// Version : %version: 6 %
+// Version : %version: 7 %
#include <platform_paths.hrh>
@@ -28,7 +28,7 @@
// Export the loc, stub sis iby files for S60 5.0
//
../rom/mpsettropmodel.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpsettropmodel.iby)
-../rom/mpsettropmodelrsc.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(mpsettropmodelrsc.iby)
+../rom/mpsettropmodelrsc.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpsettropmodelrsc.iby)
PRJ_MMPFILES
../group/MPSettROPModel.mmp
--- a/videocollection/bwins/videocollectionwrapperu.def Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/bwins/videocollectionwrapperu.def Mon May 03 12:32:50 2010 +0300
@@ -3,32 +3,32 @@
?sendAsyncStatus@VideoCollectionWrapper@@QAEXHAAVQVariant@@@Z @ 2 NONAME ; void VideoCollectionWrapper::sendAsyncStatus(int, class QVariant &)
??1VideoSortFilterProxyModel@@UAE@XZ @ 3 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(void)
?removeThumbnail@VideoThumbnailData@@QAE_NVTMPXItemId@@@Z @ 4 NONAME ; bool VideoThumbnailData::removeThumbnail(class TMPXItemId)
- ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 5 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList<class QModelIndex> const &)
- ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
- ?removeItemsFromAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 7 NONAME ; int VideoSortFilterProxyModel::removeItemsFromAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
- ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 8 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
- ?back@VideoSortFilterProxyModel@@QAEHXZ @ 9 NONAME ; int VideoSortFilterProxyModel::back(void)
- ?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 10 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
- ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 11 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
- ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
- ??1VideoThumbnailData@@EAE@XZ @ 13 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
- ??_EVideoThumbnailData@@UAE@I@Z @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
- ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@VTMPXItemId@@@Z @ 15 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId)
- ?setAlbumInUse@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@@Z @ 16 NONAME ; void VideoSortFilterProxyModel::setAlbumInUse(class TMPXItemId)
- ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 17 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
- ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 18 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 19 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
- ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 20 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList<class QModelIndex> const &)
- ?instance@VideoThumbnailData@@SAAAV1@XZ @ 21 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
- ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 22 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
- ??0VideoCollectionWrapper@@AAE@XZ @ 23 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
- ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
- ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
- ?open@VideoSortFilterProxyModel@@QAEHH@Z @ 26 NONAME ; int VideoSortFilterProxyModel::open(int)
- ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 27 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
- ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
- ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@VTMPXItemId@@@Z @ 29 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId)
- ??0VideoSortFilterProxyModel@@QAE@HPAVQObject@@@Z @ 30 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(int, class QObject *)
+ ?open@VideoSortFilterProxyModel@@QAEHW4TCollectionLevels@VideoCollectionCommon@@@Z @ 5 NONAME ; int VideoSortFilterProxyModel::open(enum VideoCollectionCommon::TCollectionLevels)
+ ?deleteItems@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 6 NONAME ; int VideoSortFilterProxyModel::deleteItems(class QList<class QModelIndex> const &)
+ ?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *)
+ ?removeItemsFromAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 8 NONAME ; int VideoSortFilterProxyModel::removeItemsFromAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
+ ?instance@VideoCollectionWrapper@@SAAAV1@XZ @ 9 NONAME ; class VideoCollectionWrapper & VideoCollectionWrapper::instance(void)
+ ?back@VideoSortFilterProxyModel@@QAEHXZ @ 10 NONAME ; int VideoSortFilterProxyModel::back(void)
+ ?modelReady@VideoSortFilterProxyModel@@IAEXXZ @ 11 NONAME ; void VideoSortFilterProxyModel::modelReady(void)
+ ?albumChangedSlot@VideoSortFilterProxyModel@@AAEXXZ @ 12 NONAME ; void VideoSortFilterProxyModel::albumChangedSlot(void)
+ ?qt_metacall@VideoThumbnailData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int VideoThumbnailData::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??1VideoThumbnailData@@EAE@XZ @ 14 NONAME ; VideoThumbnailData::~VideoThumbnailData(void)
+ ??_EVideoThumbnailData@@UAE@I@Z @ 15 NONAME ; VideoThumbnailData::~VideoThumbnailData(unsigned int)
+ ?getMediaFilePathForId@VideoSortFilterProxyModel@@QAE?AVQString@@VTMPXItemId@@@Z @ 16 NONAME ; class QString VideoSortFilterProxyModel::getMediaFilePathForId(class TMPXItemId)
+ ?setAlbumInUse@VideoSortFilterProxyModel@@QAEXVTMPXItemId@@@Z @ 17 NONAME ; void VideoSortFilterProxyModel::setAlbumInUse(class TMPXItemId)
+ ?qt_metacast@VideoCollectionWrapper@@UAEPAXPBD@Z @ 18 NONAME ; void * VideoCollectionWrapper::qt_metacast(char const *)
+ ?addItemsInAlbum@VideoSortFilterProxyModel@@QAEHAAVTMPXItemId@@ABV?$QList@VTMPXItemId@@@@@Z @ 19 NONAME ; int VideoSortFilterProxyModel::addItemsInAlbum(class TMPXItemId &, class QList<class TMPXItemId> const &)
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *, int)
+ ?removeAlbums@VideoSortFilterProxyModel@@QAEHABV?$QList@VQModelIndex@@@@@Z @ 21 NONAME ; int VideoSortFilterProxyModel::removeAlbums(class QList<class QModelIndex> const &)
+ ?instance@VideoThumbnailData@@SAAAV1@XZ @ 22 NONAME ; class VideoThumbnailData & VideoThumbnailData::instance(void)
+ ?getType@VideoSortFilterProxyModel@@QAE?AW4TModelType@VideoCollectionCommon@@XZ @ 23 NONAME ; enum VideoCollectionCommon::TModelType VideoSortFilterProxyModel::getType(void)
+ ?fetchItemDetails@VideoSortFilterProxyModel@@QAEHABVQModelIndex@@@Z @ 24 NONAME ; int VideoSortFilterProxyModel::fetchItemDetails(class QModelIndex const &)
+ ??0VideoCollectionWrapper@@AAE@XZ @ 25 NONAME ; VideoCollectionWrapper::VideoCollectionWrapper(void)
+ ?metaObject@VideoSortFilterProxyModel@@UBEPBUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const * VideoSortFilterProxyModel::metaObject(void) const
+ ?metaObject@VideoCollectionWrapper@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * VideoCollectionWrapper::metaObject(void) const
+ ?lessThan@VideoSortFilterProxyModel@@MBE_NABVQModelIndex@@0@Z @ 28 NONAME ; bool VideoSortFilterProxyModel::lessThan(class QModelIndex const &, class QModelIndex const &) const
+ ?getStaticMetaObject@VideoCollectionWrapper@@SAABUQMetaObject@@XZ @ 29 NONAME ; struct QMetaObject const & VideoCollectionWrapper::getStaticMetaObject(void)
+ ?indexOfId@VideoSortFilterProxyModel@@QAE?AVQModelIndex@@VTMPXItemId@@@Z @ 30 NONAME ; class QModelIndex VideoSortFilterProxyModel::indexOfId(class TMPXItemId)
?getStaticMetaObject@VideoSortFilterProxyModel@@SAABUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const & VideoSortFilterProxyModel::getStaticMetaObject(void)
?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *)
?doSorting@VideoSortFilterProxyModel@@QAEXHW4SortOrder@Qt@@_N@Z @ 33 NONAME ; void VideoSortFilterProxyModel::doSorting(int, enum Qt::SortOrder, bool)
@@ -42,37 +42,40 @@
?trUtf8@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString VideoThumbnailData::trUtf8(char const *, char const *, int)
?enableBackgroundFetching@VideoThumbnailData@@QAEX_N@Z @ 42 NONAME ; void VideoThumbnailData::enableBackgroundFetching(bool)
?getMediaIdAtIndex@VideoSortFilterProxyModel@@QBE?AVTMPXItemId@@ABVQModelIndex@@@Z @ 43 NONAME ; class TMPXItemId VideoSortFilterProxyModel::getMediaIdAtIndex(class QModelIndex const &) const
- ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 44 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 45 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
- ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 46 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
- ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 47 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
- ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 48 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
- ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 49 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
- ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 50 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
- ?thumbnailsFetched@VideoThumbnailData@@IAEXV?$QList@VTMPXItemId@@@@@Z @ 51 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList<class TMPXItemId>)
- ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
- ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 53 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
- ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 54 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
- ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 55 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
- ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 56 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
- ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 57 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
- ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 58 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
- ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@H@Z @ 59 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(int)
- ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
- ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 61 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
- ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 62 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
- ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 63 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
- ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 64 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
- ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 65 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
- ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 66 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
- ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 67 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 68 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
- ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 69 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
- ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 70 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
- ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 71 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
- ?tr@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 72 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *)
- ??1VideoCollectionWrapper@@EAE@XZ @ 73 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(void)
- ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 74 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *, int)
- ??0VideoThumbnailData@@AAE@XZ @ 75 NONAME ; VideoThumbnailData::VideoThumbnailData(void)
- ?staticMetaObject@VideoThumbnailData@@2UQMetaObject@@B @ 76 NONAME ; struct QMetaObject const VideoThumbnailData::staticMetaObject
+ ?renameAlbum@VideoSortFilterProxyModel@@QAEHABVTMPXItemId@@ABVQString@@@Z @ 44 NONAME ; int VideoSortFilterProxyModel::renameAlbum(class TMPXItemId const &, class QString const &)
+ ?connectSignals@VideoSortFilterProxyModel@@AAE_NXZ @ 45 NONAME ; bool VideoSortFilterProxyModel::connectSignals(void)
+ ?getModel@VideoCollectionWrapper@@QAEPAVVideoSortFilterProxyModel@@W4TModelType@VideoCollectionCommon@@@Z @ 46 NONAME ; class VideoSortFilterProxyModel * VideoCollectionWrapper::getModel(enum VideoCollectionCommon::TModelType)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *, int)
+ ?staticMetaObject@VideoSortFilterProxyModel@@2UQMetaObject@@B @ 48 NONAME ; struct QMetaObject const VideoSortFilterProxyModel::staticMetaObject
+ ?tr@VideoSortFilterProxyModel@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString VideoSortFilterProxyModel::tr(char const *, char const *)
+ ?asyncStatus@VideoCollectionWrapper@@IAEXHAAVQVariant@@@Z @ 50 NONAME ; void VideoCollectionWrapper::asyncStatus(int, class QVariant &)
+ ?initialize@VideoSortFilterProxyModel@@QAEHPAVVideoListDataModel@@@Z @ 51 NONAME ; int VideoSortFilterProxyModel::initialize(class VideoListDataModel *)
+ ?modelChanged@VideoSortFilterProxyModel@@IAEXXZ @ 52 NONAME ; void VideoSortFilterProxyModel::modelChanged(void)
+ ?itemModifiedSlot@VideoSortFilterProxyModel@@AAEXABVTMPXItemId@@@Z @ 53 NONAME ; void VideoSortFilterProxyModel::itemModifiedSlot(class TMPXItemId const &)
+ ?thumbnailsFetched@VideoThumbnailData@@IAEXV?$QList@VTMPXItemId@@@@@Z @ 54 NONAME ; void VideoThumbnailData::thumbnailsFetched(class QList<class TMPXItemId>)
+ ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *)
+ ?processSorting@VideoSortFilterProxyModel@@AAEXXZ @ 56 NONAME ; void VideoSortFilterProxyModel::processSorting(void)
+ ?getSorting@VideoSortFilterProxyModel@@QAEXAAHAAW4SortOrder@Qt@@@Z @ 57 NONAME ; void VideoSortFilterProxyModel::getSorting(int &, enum Qt::SortOrder &)
+ ?filterAcceptsRow@VideoSortFilterProxyModel@@MBE_NHABVQModelIndex@@@Z @ 58 NONAME ; bool VideoSortFilterProxyModel::filterAcceptsRow(int, class QModelIndex const &) const
+ ?metaObject@VideoThumbnailData@@UBEPBUQMetaObject@@XZ @ 59 NONAME ; struct QMetaObject const * VideoThumbnailData::metaObject(void) const
+ ?tr@VideoThumbnailData@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *, int)
+ ?disconnectSignals@VideoSortFilterProxyModel@@AAEXXZ @ 61 NONAME ; void VideoSortFilterProxyModel::disconnectSignals(void)
+ ?trUtf8@VideoSortFilterProxyModel@@SA?AVQString@@PBD0H@Z @ 62 NONAME ; class QString VideoSortFilterProxyModel::trUtf8(char const *, char const *, int)
+ ?openItem@VideoSortFilterProxyModel@@QAEHVTMPXItemId@@@Z @ 63 NONAME ; int VideoSortFilterProxyModel::openItem(class TMPXItemId)
+ ?qt_metacast@VideoThumbnailData@@UAEPAXPBD@Z @ 64 NONAME ; void * VideoThumbnailData::qt_metacast(char const *)
+ ?tr@VideoCollectionWrapper@@SA?AVQString@@PBD0@Z @ 65 NONAME ; class QString VideoCollectionWrapper::tr(char const *, char const *)
+ ??_EVideoSortFilterProxyModel@@UAE@I@Z @ 66 NONAME ; VideoSortFilterProxyModel::~VideoSortFilterProxyModel(unsigned int)
+ ??0VideoSortFilterProxyModel@@QAE@W4TModelType@VideoCollectionCommon@@PAVQObject@@@Z @ 67 NONAME ; VideoSortFilterProxyModel::VideoSortFilterProxyModel(enum VideoCollectionCommon::TModelType, class QObject *)
+ ?addNewAlbum@VideoSortFilterProxyModel@@QAE?AVTMPXItemId@@ABVQString@@@Z @ 68 NONAME ; class TMPXItemId VideoSortFilterProxyModel::addNewAlbum(class QString const &)
+ ?enableThumbnailCreation@VideoThumbnailData@@QAEX_N@Z @ 69 NONAME ; void VideoThumbnailData::enableThumbnailCreation(bool)
+ ?qt_metacall@VideoSortFilterProxyModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 70 NONAME ; int VideoSortFilterProxyModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?freeThumbnailData@VideoThumbnailData@@QAEXXZ @ 71 NONAME ; void VideoThumbnailData::freeThumbnailData(void)
+ ?shortDetailsReady@VideoSortFilterProxyModel@@IAEXVTMPXItemId@@@Z @ 72 NONAME ; void VideoSortFilterProxyModel::shortDetailsReady(class TMPXItemId)
+ ?qt_metacast@VideoSortFilterProxyModel@@UAEPAXPBD@Z @ 73 NONAME ; void * VideoSortFilterProxyModel::qt_metacast(char const *)
+ ?staticMetaObject@VideoCollectionWrapper@@2UQMetaObject@@B @ 74 NONAME ; struct QMetaObject const VideoCollectionWrapper::staticMetaObject
+ ?tr@VideoThumbnailData@@SA?AVQString@@PBD0@Z @ 75 NONAME ; class QString VideoThumbnailData::tr(char const *, char const *)
+ ??1VideoCollectionWrapper@@EAE@XZ @ 76 NONAME ; VideoCollectionWrapper::~VideoCollectionWrapper(void)
+ ?trUtf8@VideoCollectionWrapper@@SA?AVQString@@PBD0H@Z @ 77 NONAME ; class QString VideoCollectionWrapper::trUtf8(char const *, char const *, int)
+ ??0VideoThumbnailData@@AAE@XZ @ 78 NONAME ; VideoThumbnailData::VideoThumbnailData(void)
+ ?staticMetaObject@VideoThumbnailData@@2UQMetaObject@@B @ 79 NONAME ; struct QMetaObject const VideoThumbnailData::staticMetaObject
--- a/videocollection/eabi/videocollectionwrapperu.def Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/eabi/videocollectionwrapperu.def Mon May 03 12:32:50 2010 +0300
@@ -22,7 +22,7 @@
_ZN22VideoCollectionWrapper15sendAsyncStatusEiR8QVariant @ 21 NONAME
_ZN22VideoCollectionWrapper16staticMetaObjectE @ 22 NONAME DATA 16
_ZN22VideoCollectionWrapper19getStaticMetaObjectEv @ 23 NONAME
- _ZN22VideoCollectionWrapper8getModelEi @ 24 NONAME
+ _ZN22VideoCollectionWrapper8getModelEN21VideoCollectionCommon10TModelTypeE @ 24 NONAME
_ZN22VideoCollectionWrapper8instanceEv @ 25 NONAME
_ZN22VideoCollectionWrapperC1Ev @ 26 NONAME
_ZN22VideoCollectionWrapperC2Ev @ 27 NONAME
@@ -36,43 +36,46 @@
_ZN25VideoSortFilterProxyModel11deleteItemsERK5QListI11QModelIndexE @ 35 NONAME
_ZN25VideoSortFilterProxyModel11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME
_ZN25VideoSortFilterProxyModel11qt_metacastEPKc @ 37 NONAME
- _ZN25VideoSortFilterProxyModel12modelChangedEv @ 38 NONAME
- _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 39 NONAME
- _ZN25VideoSortFilterProxyModel13setAlbumInUseE10TMPXItemId @ 40 NONAME
- _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 41 NONAME
- _ZN25VideoSortFilterProxyModel14processSortingEv @ 42 NONAME
- _ZN25VideoSortFilterProxyModel15addItemsInAlbumER10TMPXItemIdRK5QListIS0_E @ 43 NONAME
- _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 44 NONAME
- _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 45 NONAME
- _ZN25VideoSortFilterProxyModel16staticMetaObjectE @ 46 NONAME DATA 16
- _ZN25VideoSortFilterProxyModel17disconnectSignalsEv @ 47 NONAME
- _ZN25VideoSortFilterProxyModel17shortDetailsReadyE10TMPXItemId @ 48 NONAME
- _ZN25VideoSortFilterProxyModel18setGenericIdFilterE10TMPXItemIdb @ 49 NONAME
- _ZN25VideoSortFilterProxyModel19getStaticMetaObjectEv @ 50 NONAME
- _ZN25VideoSortFilterProxyModel20removeItemsFromAlbumER10TMPXItemIdRK5QListIS0_E @ 51 NONAME
- _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdE10TMPXItemId @ 52 NONAME
- _ZN25VideoSortFilterProxyModel4backEv @ 53 NONAME
- _ZN25VideoSortFilterProxyModel4openEi @ 54 NONAME
- _ZN25VideoSortFilterProxyModel8openItemE10TMPXItemId @ 55 NONAME
- _ZN25VideoSortFilterProxyModel9doSortingEiN2Qt9SortOrderEb @ 56 NONAME
- _ZN25VideoSortFilterProxyModel9indexOfIdE10TMPXItemId @ 57 NONAME
- _ZN25VideoSortFilterProxyModelC1EiP7QObject @ 58 NONAME
- _ZN25VideoSortFilterProxyModelC2EiP7QObject @ 59 NONAME
- _ZN25VideoSortFilterProxyModelD0Ev @ 60 NONAME
- _ZN25VideoSortFilterProxyModelD1Ev @ 61 NONAME
- _ZN25VideoSortFilterProxyModelD2Ev @ 62 NONAME
- _ZNK18VideoThumbnailData10metaObjectEv @ 63 NONAME
- _ZNK22VideoCollectionWrapper10metaObjectEv @ 64 NONAME
- _ZNK25VideoSortFilterProxyModel10metaObjectEv @ 65 NONAME
- _ZNK25VideoSortFilterProxyModel11getOpenItemEv @ 66 NONAME
- _ZNK25VideoSortFilterProxyModel16filterAcceptsRowEiRK11QModelIndex @ 67 NONAME
- _ZNK25VideoSortFilterProxyModel16resolveAlbumNameERK7QString @ 68 NONAME
- _ZNK25VideoSortFilterProxyModel17getMediaIdAtIndexERK11QModelIndex @ 69 NONAME
- _ZNK25VideoSortFilterProxyModel8lessThanERK11QModelIndexS2_ @ 70 NONAME
- _ZTI18VideoThumbnailData @ 71 NONAME
- _ZTI22VideoCollectionWrapper @ 72 NONAME
- _ZTI25VideoSortFilterProxyModel @ 73 NONAME
- _ZTV18VideoThumbnailData @ 74 NONAME
- _ZTV22VideoCollectionWrapper @ 75 NONAME
- _ZTV25VideoSortFilterProxyModel @ 76 NONAME
+ _ZN25VideoSortFilterProxyModel11renameAlbumERK10TMPXItemIdRK7QString @ 38 NONAME
+ _ZN25VideoSortFilterProxyModel12modelChangedEv @ 39 NONAME
+ _ZN25VideoSortFilterProxyModel12removeAlbumsERK5QListI11QModelIndexE @ 40 NONAME
+ _ZN25VideoSortFilterProxyModel13setAlbumInUseE10TMPXItemId @ 41 NONAME
+ _ZN25VideoSortFilterProxyModel14connectSignalsEv @ 42 NONAME
+ _ZN25VideoSortFilterProxyModel14processSortingEv @ 43 NONAME
+ _ZN25VideoSortFilterProxyModel15addItemsInAlbumER10TMPXItemIdRK5QListIS0_E @ 44 NONAME
+ _ZN25VideoSortFilterProxyModel16albumChangedSlotEv @ 45 NONAME
+ _ZN25VideoSortFilterProxyModel16fetchItemDetailsERK11QModelIndex @ 46 NONAME
+ _ZN25VideoSortFilterProxyModel16itemModifiedSlotERK10TMPXItemId @ 47 NONAME
+ _ZN25VideoSortFilterProxyModel16staticMetaObjectE @ 48 NONAME DATA 16
+ _ZN25VideoSortFilterProxyModel17disconnectSignalsEv @ 49 NONAME
+ _ZN25VideoSortFilterProxyModel17shortDetailsReadyE10TMPXItemId @ 50 NONAME
+ _ZN25VideoSortFilterProxyModel18setGenericIdFilterE10TMPXItemIdb @ 51 NONAME
+ _ZN25VideoSortFilterProxyModel19getStaticMetaObjectEv @ 52 NONAME
+ _ZN25VideoSortFilterProxyModel20removeItemsFromAlbumER10TMPXItemIdRK5QListIS0_E @ 53 NONAME
+ _ZN25VideoSortFilterProxyModel21getMediaFilePathForIdE10TMPXItemId @ 54 NONAME
+ _ZN25VideoSortFilterProxyModel4backEv @ 55 NONAME
+ _ZN25VideoSortFilterProxyModel4openEN21VideoCollectionCommon17TCollectionLevelsE @ 56 NONAME
+ _ZN25VideoSortFilterProxyModel7getTypeEv @ 57 NONAME
+ _ZN25VideoSortFilterProxyModel8openItemE10TMPXItemId @ 58 NONAME
+ _ZN25VideoSortFilterProxyModel9doSortingEiN2Qt9SortOrderEb @ 59 NONAME
+ _ZN25VideoSortFilterProxyModel9indexOfIdE10TMPXItemId @ 60 NONAME
+ _ZN25VideoSortFilterProxyModelC1EN21VideoCollectionCommon10TModelTypeEP7QObject @ 61 NONAME
+ _ZN25VideoSortFilterProxyModelC2EN21VideoCollectionCommon10TModelTypeEP7QObject @ 62 NONAME
+ _ZN25VideoSortFilterProxyModelD0Ev @ 63 NONAME
+ _ZN25VideoSortFilterProxyModelD1Ev @ 64 NONAME
+ _ZN25VideoSortFilterProxyModelD2Ev @ 65 NONAME
+ _ZNK18VideoThumbnailData10metaObjectEv @ 66 NONAME
+ _ZNK22VideoCollectionWrapper10metaObjectEv @ 67 NONAME
+ _ZNK25VideoSortFilterProxyModel10metaObjectEv @ 68 NONAME
+ _ZNK25VideoSortFilterProxyModel11getOpenItemEv @ 69 NONAME
+ _ZNK25VideoSortFilterProxyModel16filterAcceptsRowEiRK11QModelIndex @ 70 NONAME
+ _ZNK25VideoSortFilterProxyModel16resolveAlbumNameERK7QString @ 71 NONAME
+ _ZNK25VideoSortFilterProxyModel17getMediaIdAtIndexERK11QModelIndex @ 72 NONAME
+ _ZNK25VideoSortFilterProxyModel8lessThanERK11QModelIndexS2_ @ 73 NONAME
+ _ZTI18VideoThumbnailData @ 74 NONAME
+ _ZTI22VideoCollectionWrapper @ 75 NONAME
+ _ZTI25VideoSortFilterProxyModel @ 76 NONAME
+ _ZTV18VideoThumbnailData @ 77 NONAME
+ _ZTV22VideoCollectionWrapper @ 78 NONAME
+ _ZTV25VideoSortFilterProxyModel @ 79 NONAME
--- a/videocollection/inc/videocollectioncommon.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/inc/videocollectioncommon.h Mon May 03 12:32:50 2010 +0300
@@ -35,9 +35,10 @@
KeyDateTime,
KeySizeValue,
KeyStatus,
- KeyMetaData,
KeyFilePath,
- KeyLast
+ KeyLast,
+ KeyNumberOfItems,
+ KeyTitle
};
/**
@@ -74,7 +75,7 @@
*/
const char * const VideoDetailLabels[] = {
QT_TR_NOOP("txt_videos_list_drm"),
- QT_TR_NOOP("Service:"), //TODO: localisation
+ QT_TR_NOOP("txt_videos_list_service"),
QT_TR_NOOP("txt_videos_list_description"),
QT_TR_NOOP("txt_videos_list_duration"),
QT_TR_NOOP("txt_videos_list_date"),
@@ -82,7 +83,7 @@
QT_TR_NOOP("txt_videos_list_location"),
QT_TR_NOOP("txt_videos_list_author"),
QT_TR_NOOP("txt_videos_list_copyright"),
- QT_TR_NOOP("Audio Type:"), //TODO: localisation
+ QT_TR_NOOP("txt_videos_list_audio_type"),
QT_TR_NOOP("txt_videos_list_language"),
QT_TR_NOOP("txt_videos_list_keywords"),
QT_TR_NOOP("txt_videos_list_file_size"),
@@ -151,7 +152,16 @@
statusAllVideosAlreadyInCollection,
statusVideosRemovedFromCollection
};
-
+
+ enum TModelType
+ {
+ EModelTypeInvalid,
+ EModelTypeAllVideos,
+ EModelTypeCollections,
+ EModelTypeCollectionContent,
+ EModelTypeGeneric
+ };
+
/**
* Utility macro to trace heap consumption.
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/inc/videocollectiontrace.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,933 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: tracing functionality for video collection
+*
+*/
+
+#ifndef VIDEOCOLLETIONTRACE_H
+#define VIDEOCOLLETIONTRACE_H
+
+/**
+ * Set 1 to enable tracing in urel builds. Default is 0.
+ */
+#define UREL_TRACE 0
+
+/**
+ * Set to 1 to disable tracing. Default is 0.
+ */
+#define DISABLE_TRACE 0
+
+/**
+ * 0 = Tracing into RDebug in all builds.
+ * 1 = Tracing into RDebug in winscw, file in ARM. (Default)
+ * 2 = Tracing into file in all builds.
+ */
+#define TRACE_OUTPUT 1
+
+//-----------------------------------------------------------------------------
+// Trace configuration
+//-----------------------------------------------------------------------------
+//
+#if ( (defined(_DEBUG) || UREL_TRACE == 1) && DISABLE_TRACE == 0 )
+
+ // Error trace
+ #define ERROR_TRACE
+
+ // Function trace
+ #define FUNC_TRACE
+
+ // Info trace
+ #define INFO_TRACE
+
+ // Timestamp trace
+ #define TIMESTAMP_TRACE
+
+ // Tracing current client process and thread
+ #define CLIENT_TRACE
+
+ // Enable tracing into file.
+ #if ((TRACE_OUTPUT == 1 && !defined(__WINSCW__)) || TRACE_OUTPUT == 2)
+ #define TRACE_INTO_FILE
+ #endif
+
+#else // TRACING DISABLED
+
+ #undef ERROR_TRACE
+ #undef INFO_TRACE
+ #undef TIMESTAMP_TRACE
+ #undef FUNC_TRACE
+ #undef CLIENT_TRACE
+ #undef TRACE_INTO_FILE
+
+#endif // TRACING ENABLED
+
+//-----------------------------------------------------------------------------
+// INCLUDES
+//-----------------------------------------------------------------------------
+//
+#include <qstring.h>
+#include <e32debug.h> // RDebug
+
+#if defined TRACE_INTO_FILE
+ #include <flogger.h> // RFileLogger
+#endif
+
+//-----------------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------------
+//
+/**
+* Trace prefixes for macros with component name.
+*/
+#define _PREFIX_TRACE( a ) TPtrC( (const TText*) L"#FuC# " L##a )
+#define _PREFIX_TRACE_2( a, b ) TPtrC( (const TText*) L"#FuC# " L##a L##b )
+#define _PREFIX_TRACE8( a ) (const char*)( "#FuC# " ##a )
+
+/**
+* Prefix error trace
+*/
+#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg )
+
+/**
+* Define needed if TRACE_INTO_FILE macro in use
+*/
+#ifdef TRACE_INTO_FILE
+ _LIT( KTracePath, "Fusion" );
+ _LIT( KTraceFile, "videos.log" );
+#endif
+
+//-----------------------------------------------------------------------------
+// Error trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef ERROR_TRACE
+
+ /**
+ * Error trace definitions.
+ */
+ #ifdef TRACE_INTO_FILE
+
+ #define ERROR( aErr, aMsg )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_ERROR( aMsg ), aErr );\
+ }\
+ }
+ #define ERROR_1( aErr, aMsg, aP1 )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_ERROR( aMsg ), aErr, aP1 );\
+ }\
+ }
+ #define ERROR_2( aErr, aMsg, aP1, aP2 )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
+ }\
+ }
+ #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
+ }\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define ERROR( aErr, aMsg )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\
+ }\
+ }
+ #define ERROR_1( aErr, aMsg, aP1 )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\
+ }\
+ }
+ #define ERROR_2( aErr, aMsg, aP1, aP2 )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
+ }\
+ }
+ #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
+ {\
+ if( aErr < KErrNone )\
+ {\
+ RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
+ }\
+ }
+
+ #endif//TRACE_INTO_FILE
+
+ #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg )
+ #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 )
+ #define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 )
+ #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 )
+
+ #define ERROR_PARAM(_p) _p
+
+ #define TRAPD_ERR( aErr, aStmt ) TRAPD( aErr, aStmt )
+ #define TRAP_ERR( aErr, aStmt ) TRAP( aErr, aStmt )
+
+ #define TRAP_AND_LEAVE(_s,_t) \
+ { TRAPD(_e,_s); ERROR(_e,_t); User::LeaveIfError(_e); }
+
+#else//ERROR_TRACE not defined
+
+ #define ERROR( aErr, aMsg )
+ #define ERROR_1( aErr, aMsg, aP1 )
+ #define ERROR_2( aErr, aMsg, aP1, aP2 )
+ #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )
+ #define ERROR_GEN( aMsg )
+ #define ERROR_GEN_1( aMsg, aP1 )
+ #define ERROR_GEN_2( aMsg, aP1, aP2 )
+ #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 )
+
+ #define ERROR_PARAM(_p)
+
+ #define TRAPD_ERR( aErr, aStmt ) TRAP_IGNORE( aStmt )
+ #define TRAP_ERR( aErr, aStmt ) TRAP_IGNORE( aStmt )
+
+ #define TRAP_AND_LEAVE(_s,_t) { _s; }
+
+#endif//ERROR_TRACE
+
+//-----------------------------------------------------------------------------
+// Info trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef INFO_TRACE
+
+ /**
+ * Info log message definitions.
+ */
+ #ifdef TRACE_INTO_FILE
+
+ #define INFO( aMsg )\
+ {\
+ RFileLogger::Write( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ) );\
+ }
+ #define INFO_1( aMsg, aP1 )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), aP1 );\
+ }
+ #define INFO_2( aMsg, aP1, aP2 )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), aP1, aP2 );\
+ }
+ #define INFO_3( aMsg, aP1, aP2, aP3 )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), aP1, aP2, aP3 );\
+ }
+ #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), aP1, aP2, aP3, aP4 );\
+ }
+ #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), aP1, aP2, aP3, aP4, aP5 );\
+ }
+ #define INFOQSTR_1( aMsg, aQStr )\
+ {\
+ TPtrC _qstringptrc(aQStr.utf16()); \
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), &_qstringptrc );\
+ }
+ #define INFOQSTR_2( aMsg, aQStr1, aQStr2 )\
+ {\
+ TPtrC _qstringptrc1(aQStr1.utf16()); \
+ TPtrC _qstringptrc2(aQStr2.utf16()); \
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ _PREFIX_TRACE( aMsg ), &_qstringptrc1, &_qstringptrc2 );\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define INFO( aMsg )\
+ {\
+ RDebug::Print( _PREFIX_TRACE( aMsg ) );\
+ }
+ #define INFO_1( aMsg, aP1 )\
+ {\
+ RDebug::Print( _PREFIX_TRACE( aMsg ), aP1 );\
+ }
+ #define INFO_2( aMsg, aP1, aP2 )\
+ {\
+ RDebug::Print( _PREFIX_TRACE( aMsg ), aP1, aP2 );\
+ }
+ #define INFO_3( aMsg, aP1, aP2, aP3 )\
+ {\
+ RDebug::Print( _PREFIX_TRACE( aMsg ), aP1, aP2, aP3 );\
+ }
+ #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\
+ {\
+ RDebug::Print( _PREFIX_TRACE( aMsg ), aP1, aP2, aP3, aP4 );\
+ }
+ #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )\
+ {\
+ RDebug::Print( _PREFIX_TRACE( aMsg ), aP1, aP2, aP3, aP4, aP5 );\
+ }
+
+ #define INFOQSTR_1( aMsg, aQStr )\
+ {\
+ TPtrC _qstringptrc(aQStr.utf16()); \
+ RDebug::Print( _PREFIX_TRACE( aMsg ), &_qstringptrc );\
+ }
+
+ #define INFOQSTR_2( aMsg, aQStr1, aQStr2 )\
+ {\
+ TPtrC _qstringptrc1(aQStr1.utf16()); \
+ TPtrC _qstringptrc2(aQStr2.utf16()); \
+ RDebug::Print( _PREFIX_TRACE( aMsg ), &_qstringptrc1, &_qstringptrc2 );\
+ }
+
+ #endif//TRACE_INTO_FILE
+
+ #define INFO_PARAM( aParam ) aParam
+
+#else//INFO_TRACE not defined
+
+ #define INFO( aMsg )
+ #define INFO_1( aMsg, aP1 )
+ #define INFO_2( aMsg, aP1, aP2 )
+ #define INFO_3( aMsg, aP1, aP2, aP3 )
+ #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )
+ #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )
+ #define INFO_PARAM( aParam )
+ #define INFOQSTR_1( aMsg, aP1 );
+ #define INFOQSTR_2( aMsg, aP1, aP2 );
+
+#endif//INFO_TRACE
+
+//-----------------------------------------------------------------------------
+// Trace current client thread name and process id
+//-----------------------------------------------------------------------------
+//
+#ifdef CLIENT_TRACE
+
+ #define _PREFIX_CLIENT( aMsg ) _PREFIX_TRACE( "[CLIENT: sid [0x%x] thread [%S]] " L##aMsg )
+
+ #ifdef TRACE_INTO_FILE
+
+ #define CLIENT_TRACE_2( aMsg, aP1, aP2 )\
+ {\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, _PREFIX_CLIENT(aMsg), aP1, aP2 );\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define CLIENT_TRACE_2( aMsg, aP1, aP2 )\
+ {\
+ RDebug::Print( _PREFIX_CLIENT(aMsg), aP1, aP2 );\
+ }
+
+ #endif//TRACE_INTO_FILE
+
+ /**
+ * Traces current secure id and thread
+ */
+ #define CURRENT_CLIENT( aMsg )\
+ {\
+ TName name( RThread().Name() );\
+ TSecureId sid( RThread().SecureId() );\
+ CLIENT_TRACE_2( aMsg, sid.iId, &name );\
+ }
+
+ /**
+ * Traces secure id and thread from RMessage2
+ */
+ #define CLIENT( aRMessage2 )\
+ {\
+ RThread thread;\
+ TInt err = aRMessage2.Client( thread );\
+ if( err == KErrNone )\
+ {\
+ TName name( thread.Name() );\
+ TSecureId sid( thread.SecureId() );\
+ CLIENT_TRACE_2( "", sid.iId, &name );\
+ }\
+ thread.Close();\
+ }
+
+ /**
+ * Traces secure id and thread from RMessage2
+ */
+ #define CLIENT_1( aRMessage2, aMsg )\
+ {\
+ RThread thread;\
+ TInt err = aRMessage2.Client( thread );\
+ if( err == KErrNone )\
+ {\
+ TName name( thread.Name() );\
+ TSecureId sid( thread.SecureId() );\
+ CLIENT_TRACE_2( aMsg, sid.iId, &name );\
+ }\
+ thread.Close();\
+ }
+
+#else
+
+ #define CURRENT_CLIENT( aMsg )
+ #define CLIENT( aRMessage2 )
+ #define CLIENT_1( aRMessage2, aMsg )
+
+#endif
+
+//-----------------------------------------------------------------------------
+// Trace current heap usage
+//-----------------------------------------------------------------------------
+//
+#ifdef HEAP_TRACE
+
+ #define _PREFIX_HEAP( aMsg ) _PREFIX_TRACE( "[HEAP: %d bytes] " L##aMsg )
+
+ #ifdef TRACE_INTO_FILE
+
+ #define HEAP( aMsg )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace );\
+ }
+ #define HEAP_1( aMsg, aP1 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1 );\
+ }
+ #define HEAP_2( aMsg, aP1, aP2 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2 );\
+ }
+ #define HEAP_3( aMsg, aP1, aP2, aP3 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3 );\
+ }
+ #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3, aP4 );\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define HEAP( aMsg )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace );\
+ }
+ #define HEAP_1( aMsg, aP1 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1 );\
+ }
+ #define HEAP_2( aMsg, aP1, aP2 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2 );\
+ }
+ #define HEAP_3( aMsg, aP1, aP2, aP3 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3 );\
+ }
+ #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )\
+ {\
+ TInt totalAllocSpace = 0;\
+ User::AllocSize( totalAllocSpace );\
+ RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3, aP4 );\
+ }
+
+ #endif//TRACE_INTO_FILE
+
+#else//HEAP_TRACE not defined
+
+ #define HEAP( aMsg )
+ #define HEAP_1( aMsg, aP1 )
+ #define HEAP_2( aMsg, aP1, aP2 )
+ #define HEAP_3( aMsg, aP1, aP2, aP3 )
+ #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )
+
+#endif//HEAP_TRACE
+
+
+//-----------------------------------------------------------------------------
+// Function trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef FUNC_TRACE
+
+ #include <e32base.h> // TCleanupItem
+
+ /**
+ * Function logging definitions.
+ */
+ #ifdef TRACE_INTO_FILE
+
+ #define FUNC( aMsg, aP1 )\
+ {\
+ TPtrC8 trace( _S8( aMsg ) );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, trace, aP1 );\
+ }
+
+ #define FUNC2( aMsg, aP1, aP2 )\
+ {\
+ TPtrC8 trace( _S8( aMsg ) );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, trace, aP1, aP2 );\
+ }
+
+ #define FUNC_2( aMsg, aP1, aP2, aP3 )\
+ {\
+ TPtrC8 trace( _S8( aMsg ) );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, trace, aP1, aP2, aP3 );\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define FUNC( aMsg, aP1 )\
+ {\
+ RDebug::Printf( aMsg, aP1 );\
+ }
+
+ #define FUNC2( aMsg, aP1, aP2 )\
+ {\
+ RDebug::Printf( aMsg, aP1, aP2 );\
+ }
+
+ #define FUNC_2( aMsg, aP1, aP2, aP3 )\
+ {\
+ RDebug::Printf( aMsg, aP1, aP2, aP3 );\
+ }
+
+ #endif//TRACE_INTO_FILE
+
+ /**
+ * Function trace helper class.
+ */
+ const TText KFuncNameTerminator = '(';
+ const TText KFuncLeaveIndicator = 'L';
+ const TInt KFuncCanLeave = 0x1;
+ const TInt KFuncLeft = 0x2;
+ const TInt KFuncLogClient = 0x4;
+
+ class TFuncLog
+ {
+ public:
+ static void Cleanup( TAny* aPtr )
+ {
+ TFuncLog* self = static_cast< TFuncLog* >( aPtr );
+ self->iFlags |= KFuncLeft;
+ self->LogLeave();
+ }
+
+ inline void LogStart()
+ {
+ if ( iFlags & KFuncLogClient )
+ {
+ TBuf8<KMaxName> name8;
+ name8.Copy( RThread().Name() );
+ TSecureId sid( RThread().SecureId() );
+ FUNC_2( _PREFIX_TRACE8("%S() -> ENTER(sid [0x%x] thread [%S])"),
+ &iFunc, sid.iId, &name8 );
+ }
+ else
+ {
+ if(!iAddr)
+ {
+ FUNC( _PREFIX_TRACE8("%S() -> ENTER"), &iFunc );
+ }
+ else
+ {
+ FUNC2( _PREFIX_TRACE8("%S() [0x%x] -> ENTER"), &iFunc, iAddr );
+ }
+ }
+ }
+
+ inline void LogLeave()
+ {
+ if ( iFlags & KFuncLogClient )
+ {
+ TBuf8<KMaxName> name8;
+ name8.Copy( RThread().Name() );
+ TSecureId sid( RThread().SecureId() );
+ FUNC_2( _PREFIX_TRACE8("%S() - LEAVE(sid [0x%x] thread [%S])"),
+ &iFunc, sid.iId, &name8 );
+ }
+ else
+ {
+ if(!iAddr)
+ {
+ FUNC( _PREFIX_TRACE8("%S() - LEAVE"), &iFunc );
+ }
+ else
+ {
+ FUNC2( _PREFIX_TRACE8("%S() [0x%x] - LEAVE"), &iFunc, iAddr );
+ }
+ }
+ }
+
+ inline void LogEnd()
+ {
+ if ( iFlags & KFuncLogClient )
+ {
+ TBuf8<KMaxName> name8;
+ name8.Copy( RThread().Name() );
+ TSecureId sid( RThread().SecureId() );
+ FUNC_2( _PREFIX_TRACE8("%S() <- OUT(sid [0x%x] thread [%S])"),
+ &iFunc, sid.iId, &name8 );
+ }
+ else
+ {
+ if(!iAddr)
+ {
+ FUNC( _PREFIX_TRACE8("%S() <- OUT"), &iFunc );
+ }
+ else
+ {
+ FUNC2( _PREFIX_TRACE8("%S() [0x%x] <- OUT"), &iFunc, iAddr );
+ }
+ }
+ }
+
+ // For non leaving and L methods
+ inline TFuncLog( const char* aFunc, TUint aFlags ) :
+ iAddr(0), iFunc( aFunc ? _S8( aFunc ) : _S8("") ),
+ iFlags( aFlags ),
+ iCleanupItem( Cleanup, this ),
+ iLCPtr( NULL )
+ {
+ TInt pos( iFunc.Locate( KFuncNameTerminator ) );
+ if( pos >= 0 && pos < iFunc.Length() )
+ {
+ iFunc.Set( iFunc.Left( pos ) );
+ TInt len( iFunc.Length() );
+ if( len > 0 && iFunc[ len - 1 ] == KFuncLeaveIndicator )
+ {
+ iFlags |= KFuncCanLeave;
+ CleanupStack::PushL( iCleanupItem ); // Ignore warnings
+ }
+ }
+ LogStart();
+ }
+
+ // For non leaving and L methods
+ inline TFuncLog( TUint aAddr, const char* aFunc, TUint aFlags ) :
+ iAddr(aAddr), iFunc( aFunc ? _S8( aFunc ) : _S8("") ),
+ iFlags( aFlags ),
+ iCleanupItem( Cleanup, this ),
+ iLCPtr( NULL )
+ {
+ TInt pos( iFunc.Locate( KFuncNameTerminator ) );
+ if( pos >= 0 && pos < iFunc.Length() )
+ {
+ iFunc.Set( iFunc.Left( pos ) );
+ TInt len( iFunc.Length() );
+ if( len > 0 && iFunc[ len - 1 ] == KFuncLeaveIndicator )
+ {
+ iFlags |= KFuncCanLeave;
+ CleanupStack::PushL( iCleanupItem ); // Ignore warnings
+ }
+ }
+ LogStart();
+ }
+
+ // For LC methods only
+ inline TFuncLog( const char* aFunc, TUint aFlags, TAny** aLCPtr ) :
+ iAddr(0), iFunc( aFunc ? _S8( aFunc ) : _S8("") ),
+ iFlags( aFlags ),
+ iCleanupItem( Cleanup, this ),
+ iLCPtr( NULL )
+ {
+ TInt pos( iFunc.Locate( KFuncNameTerminator ) );
+ if( pos >= 0 && pos < iFunc.Length() )
+ {
+ iFunc.Set( iFunc.Left( pos ) );
+ iFlags |= KFuncCanLeave;
+ iLCPtr = aLCPtr;
+ CleanupStack::PushL( iCleanupItem ); // Ignore warnings
+ }
+ LogStart();
+ }
+
+ inline ~TFuncLog()
+ {
+ if ( !( iFlags & KFuncLeft ) )
+ {
+ if ( iFlags & KFuncCanLeave )
+ {
+ if ( iLCPtr && *iLCPtr)
+ {
+ CleanupStack::Pop(); // Pop LC ptr first
+ CleanupStack::Pop( this ); // Pop the cleanup item
+ CleanupStack::PushL( *iLCPtr ); // Push LC ptr back
+ }
+ else
+ {
+ CleanupStack::Pop( this ); // Pop the cleanup item
+ }
+ }
+ LogEnd(); // Normally finished
+ }
+ }
+
+ private: // Data
+ TPtrC8 iFunc;
+ TUint iFlags;
+ TCleanupItem iCleanupItem;
+ TAny** iLCPtr;
+ TUint iAddr;
+ };
+
+ /*
+ * Use with non leaving and L methods
+ *
+ * CMyClass* CMyClass::DoL()
+ * {
+ * FUNC_LOG;
+ * CMyClass* ret = new (ELeave) CMyClass();
+ * ...
+ * return ret;
+ * }
+ *
+ * CMyClass* CMyClass::Do()
+ * {
+ * FUNC_LOG;
+ * return iMyClass;
+ * }
+ *
+ */
+ #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__, 0 );
+
+ /**
+ * Use this to log memory address.
+ */
+ #define FUNC_LOG_ADDR(P1) TFuncLog _fl2( (int)P1, __PRETTY_FUNCTION__, 0 );
+
+ /*
+ * Use with LC methods
+ *
+ * CMyClass* CMyClass::DoLC()
+ * {
+ * CMyClass* ret = NULL;
+ * FUNC_LOG_LC( ret );
+ * ...
+ * return ret;
+ * }
+ */
+ #define FUNC_LOG_LC( aPtr ) TFuncLog _fl( __PRETTY_FUNCTION__, 0, (TAny**)&aPtr );
+
+#ifdef CLIENT_TRACE
+
+ /*
+ * Used like FUNC_LOG. Prints client info useful for client side executed API methods.
+ */
+ #define FUNC_LOG_WITH_CLIENT TFuncLog _fl( __PRETTY_FUNCTION__, KFuncLogClient );
+
+ /*
+ * Used like FUNC_LOG_LC. Prints client info useful for client side executed API methods.
+ */
+ #define FUNC_LOG_WITH_CLIENT_LC( aPtr )\
+ TFuncLog _fl( __PRETTY_FUNCTION__, KFuncLogClient, (TAny**)&aPtr );
+
+#else //CLIENT_TRACE not defined
+
+ #define FUNC_LOG_WITH_CLIENT FUNC_LOG
+ #define FUNC_LOG_WITH_CLIENT_LC( aPtr ) FUNC_LOG_LC( aPtr )
+
+#endif //CLIENT_TRACE
+
+#else//FUNC_TRACE not defined
+
+ #define FUNC_LOG
+ #define FUNC_LOG_ADDR(P1)
+ #define FUNC_LOG_LC( ptr )
+ #define FUNC_LOG_WITH_CLIENT
+ #define FUNC_LOG_WITH_CLIENT_LC( ptr )
+
+#endif//FUNC_TRACE
+
+//-----------------------------------------------------------------------------
+// Timestamp trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef TIMESTAMP_TRACE
+
+ #define PREFIX_TIMESTAMP( aCaption )\
+ _PREFIX_TRACE_2("[TIMESTAMP] (%d:%02d:%02d.%06d us) ",aCaption)
+ #define CURRENT_TIME( aDt ) TDateTime aDt; { TTime t; t.HomeTime(); aDt = t.DateTime(); }
+ #define EXTRACT_TIME( aDt ) aDt.Hour(), aDt.Minute(), aDt.Second(), aDt.MicroSecond()
+
+ #ifdef TRACE_INTO_FILE
+
+ #define TIMESTAMP( aCaption )\
+ {\
+ CURRENT_TIME( dt );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ) );\
+ }
+
+ #define TIMESTAMP_1( aCaption, aP1 )\
+ {\
+ CURRENT_TIME( dt );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1 );\
+ }
+
+ #define TIMESTAMP_2( aCaption, aP1, aP2 )\
+ {\
+ CURRENT_TIME( dt );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2 );\
+ }
+
+ #define TIMESTAMP_3( aCaption, aP1, aP2, aP3 )\
+ {\
+ CURRENT_TIME( dt );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend,\
+ PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2,aP3 );\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define TIMESTAMP( aCaption )\
+ {\
+ CURRENT_TIME( dt );\
+ RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ) );\
+ }
+
+ #define TIMESTAMP_1( aCaption, aP1 )\
+ {\
+ CURRENT_TIME( dt );\
+ RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1 );\
+ }
+
+ #define TIMESTAMP_2( aCaption, aP1, aP2 )\
+ {\
+ CURRENT_TIME( dt );\
+ RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2 );\
+ }
+
+ #define TIMESTAMP_3( aCaption, aP1, aP2, aP3 )\
+ {\
+ CURRENT_TIME( dt );\
+ RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2,aP3 );\
+ }
+
+ #endif//TRACE_INTO_FILE
+
+#else//TIMESTAMP_TRACE not defined
+
+ #define TIMESTAMP( aCaption )
+ #define TIMESTAMP_1( aCaption, aP1 )
+ #define TIMESTAMP_2( aCaption, aP1, aP2 )
+ #define TIMESTAMP_3( aCaption, aP1, aP2, aP3 )
+
+#endif//TIMESTAMP_TRACE
+
+//-----------------------------------------------------------------------------
+// Trace assert macros
+//-----------------------------------------------------------------------------
+//
+#if ( (defined(_DEBUG) || UREL_TRACE == 1) && DISABLE_TRACE == 0 )
+
+ #ifdef TRACE_INTO_FILE
+
+ #define PANIC_TRACE_2( aMsg, aP1, aP2 )\
+ {\
+ TPtrC8 trace( _S8( aMsg ) );\
+ RFileLogger::WriteFormat( KTracePath, KTraceFile,\
+ EFileLoggingModeAppend, trace, aP1, aP2 );\
+ }
+
+ #else//TRACE_INTO_FILE not defined
+
+ #define PANIC_TRACE_2( aMsg, aP1, aP2 )\
+ {\
+ RDebug::Printf( aMsg, aP1, aP2 );\
+ }
+
+ #endif //TRACE_INTO_FILE not define
+
+ static void Panic( const TDesC8& aFileName, const TInt aLineNum )
+ {
+ PANIC_TRACE_2( "Assertion failed in file=%S, line=%d", &aFileName, aLineNum );
+ User::Invariant();
+ }
+
+ #define ASSERT_ALWAYS_TRACE Panic( _L8(__FILE__), __LINE__ );
+ #define ASSERT_TRACE( _s ) if ( !( _s ) ) { ASSERT_ALWAYS_TRACE; }
+
+#else // TRACING DISABLED
+
+ #define ASSERT_ALWAYS_TRACE
+ #define ASSERT_TRACE( _s )
+
+#endif // TRACING ENABLED
+
+
+#endif // VIDEOCOLLETIONTRACE_H
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h Mon May 03 12:32:50 2010 +0300
@@ -114,14 +114,19 @@
* Can be used to run async operations.
*/
void ContinueStepping();
-
+
+ /**
+ * Add some functionality to CActive::Cancel
+ */
+ void Cancel();
+
protected: // From base class
/**
* From CActive
*/
void RunL();
-
+
/**
* From CActive
*/
@@ -144,6 +149,13 @@
*/
void ConstructL();
+public:
+ /**
+ * Set to ETrue when stepping is stopped.
+ * Cancel or Done has to be called.
+ */
+ TBool iStopped;
+
private: // data
CMPXCommand* iCurCommand; // Current Command
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbum.h Mon May 03 12:32:50 2010 +0300
@@ -38,9 +38,9 @@
/**
* Constructor.
- */
- TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo();
-
+ */
+ TVcxMyVideosAlbumVideo();
+
/**
* = operator.
*/
@@ -141,11 +141,6 @@
* ETrue as default.
*/
void Remove( TUint32 aMdsId, TBool aCompress = ETrue );
-
- /**
- * Updates album attributes from scratch.
- */
- void UpdateAttributesL();
/**
* Used for keeping RArray<TVcxMyVideosAlbumVideo> in integer order by
@@ -178,6 +173,16 @@
void AppendToVideoListL( CMPXMedia& aFromVideoList,
CMPXMedia& aToVideoList, TInt aNewItemStartIndex );
+ /**
+ * Calculates KVcxMediaMyVideosCategoryItemCount, KVcxMediaMyVideosCategoryNewItemCount,
+ * KVcxMediaMyVideosCategoryNewItemName and KMPXMediaGeneralDate attributes to iMedia.
+ *
+ * @param aStartIndex Start position of the calculations in iVideoList.
+ * Can be used to update values when items are appended
+ * to old list, without calculating everything from scratch.
+ */
+ void CalculateAttributesL( TInt aStartIndex = 0 );
+
private:
/**
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosalbums.h Mon May 03 12:32:50 2010 +0300
@@ -158,6 +158,29 @@
*/
TBool UpdateAlbumL( const CMPXMedia& aAlbum );
+ /**
+ * Calculates and updates album media attributes.
+ */
+ void CalculateAttributesL();
+
+ /**
+ * Called when video's New Video flag changes. Calculates
+ * album attributes for the affected albums. Adds events
+ * to iCollection.iMessageList but does not send them.
+ *
+ * @param aMdsId MDS ID of the changed video.
+ */
+ void NewVideoFlagChangedL( TUint32 aMdsId );
+
+ /**
+ * Called when video's title changes. Calculates
+ * album attributes for the affected albums. Adds events
+ * to iCollection.iMessageList but does not send them.
+ *
+ * @param aMdsId MDS ID of the changed video.
+ */
+ void VideoTitleChangedL( TUint32 aMdsId );
+
protected:
/**
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionplugin.h Mon May 03 12:32:50 2010 +0300
@@ -387,15 +387,6 @@
*/
TBool iOrphanDownloadsCleared;
-
-#ifdef _DEBUG
- /**
- * Used for debugging that client receives all events.
- */
- TInt iTotalMessagesSent;
- TInt iMessagesInArraySent;
-#endif
-
};
#endif // VCXMYVIDEOSCOLLECTIONPLUGIN_H
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscollectionutil.h Mon May 03 12:32:50 2010 +0300
@@ -127,6 +127,14 @@
static TUint32 FlagsL( CMPXMedia& aVideo );
/**
+ * Gets KMPXMediaGeneralDate (creation date) of aVideo.
+ *
+ * @param aVideo Media object to fetch parameter from.
+ * @return Creation date, works with TTime.
+ */
+ static TInt64 CreationDateL( CMPXMedia& aVideo );
+
+ /**
* Gets KVcxMediaMyVideosDownloadId attribute of aVideo.
*
* @param aVideo Media object to fetch parameter from.
@@ -223,7 +231,7 @@
* @param aMedia Media where from the attribute is fetched.
* @return Pointer to media array.
*/
- static CMPXMediaArray* MediaArrayL( CMPXMedia& aMedia );
+ static CMPXMediaArray* MediaArrayL( const CMPXMedia& aMedia );
/**
* Gets KVcxMediaMyVideosInt32Value attribute from aMedia. Leaves
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsalbums.h Mon May 03 12:32:50 2010 +0300
@@ -41,7 +41,7 @@
public CActive,
public MMdEQueryObserver,
public MMdERelationItemObserver
-#if 0 // not used
+#if 0
,
public MMdERelationObserver
#endif
@@ -77,13 +77,21 @@
public: // new methods
/**
+ * From CActive.
* Cancels possible ongoing asynchronous request.
*
* @param aType Defines what kind of request is cancelled.
*/
- void Cancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
+ void DoCancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
/**
+ * Cancels queries.
+ *
+ * @param aType Defines what kind of request is cancelled.
+ */
+ void CancelQueries( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
+
+ /**
* Gets My Videos albums from MDS asynchronously.
* HandleGetAlbumsResp() callback function is called when ready.
* Utilizes CVcxMyVideosMdsCmdQueue.
@@ -300,7 +308,7 @@
* @param aMpxCmd Media containing command parameters: array with albums IDs.
* @param aClient Response call is done to this object.
*/
- void CVcxMyVideosMdsAlbums::DoRemoveAlbumsL( CMPXMedia* aMpxCmd,
+ void DoRemoveAlbumsL( CMPXMedia* aMpxCmd,
MVcxMyVideosMdsAlbumsObserver& aClient );
/**
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosmdsdb.h Mon May 03 12:32:50 2010 +0300
@@ -157,6 +157,17 @@
virtual void HandleRelationEvent( TObserverNotificationType aType,
const RArray<TMdERelation>& aRelationArray ) = 0;
+#if 0
+ /**
+ * Event handler function for relation add events.
+ *
+ * @param aType Event type
+ * @param aRelationArray Array containing relations.
+ */
+ virtual void HandleRelationIdEvent( TObserverNotificationType aType,
+ const RArray<TUint32>& aRelationIdArray ) = 0;
+#endif
+
};
/**
@@ -443,6 +454,12 @@
* @param aObject Creation date is written here.
*/
void SetCreationDateToObjectL( const CMPXMedia& aVideo, CMdEObject& aObject );
+
+ /**
+ * Opens MDS session.
+ */
+ void OpenMdsSessionL();
+
public:
/**
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosvideocache.h Mon May 03 12:32:50 2010 +0300
@@ -31,6 +31,140 @@
// CLASS DECLARATION
/**
+ * Contains information about video.
+ * These are stored to CVcxMyVideosVideoListIndex::iVideoArray.
+ */
+NONSHARABLE_CLASS(TVcxMyVideosVideo)
+ {
+ public:
+
+ /**
+ * Constructor.
+ */
+ TVcxMyVideosVideo();
+
+ /**
+ * = operator.
+ */
+ TVcxMyVideosVideo& operator=( const TVcxMyVideosVideo& aVideo );
+ public:
+
+ /**
+ * Set values.
+ *
+ * @param aMdsId MDS ID
+ * @param aPos Position in CVcxMyVideosVideoCache::iVideoList
+ * @param aVideo Pointer to CVcxMyVideosVideoCache::iVideoList item,
+ * ownership does not move.
+ */
+ void Set( TUint32 aMdsId, TInt aPos, CMPXMedia* aVideo );
+
+ public:
+ TUint32 iMdsId; // Video object ID in MDS.
+ CMPXMedia* iVideo; // Pointer to CVcxMyVideosVideoCache::iVideoList item
+ TInt iPos; // Items position in CVcxMyVideosVideoCache::iVideoList
+ };
+
+/**
+* Used for keeping videos in MDS ID order for fast access.
+* (Indexes CVcxMyVideosVideoCache::iVideoList).
+*
+* @lib mpxmyvideoscollectionplugin.lib
+*/
+NONSHARABLE_CLASS(CVcxMyVideosVideoListIndex) : public CBase
+ {
+public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor
+ * @return Object constructed
+ */
+ static CVcxMyVideosVideoListIndex* NewL();
+
+ /**
+ * Destructor
+ */
+ virtual ~CVcxMyVideosVideoListIndex();
+
+public:
+
+ /**
+ * Sets up iVideoArray from aVideoList. Sorting is also done.
+ *
+ * @param aVideoList Video list to use for constructing iVideoArray.
+ */
+ void SetL( const CMPXMedia& aVideoList );
+
+ /**
+ * Finds video by MDS ID from the index. Uses bisection method.
+ *
+ * @param aVideo The found video data is written here.
+ * @return KErrNotFound if not found, index of the item in iVideoArray
+ * otherwise.
+ */
+ TInt Find( TUint32 aMdsId, TVcxMyVideosVideo& aVideo );
+
+ /**
+ * Removes video from index.
+ *
+ * @param aMdsId ID if the item to be removed.
+ * @param aCompress If ETrue, compresses the video array.
+ * @return KErrNotFound if not found, index of the removed item otherwise.
+ */
+ TInt Remove( TUint32 aMdsId, TBool aCompress = ETrue );
+
+ /**
+ * Adds video to index. Keeps sorting order.
+ *
+ * @param aVideo Video to be added, ownership does not move.
+ * @param aPos aVideo's position in CVcxMyVideosVideoCache::iVideoList.
+ */
+ void AddL( CMPXMedia* aVideo, TInt aPos );
+
+#ifdef _DEBUG
+ /**
+ * Returns reference to video array.
+ */
+ const RArray<TVcxMyVideosVideo>& VideoArray();
+#endif
+
+private:
+ /**
+ * Constructor
+ */
+ CVcxMyVideosVideoListIndex();
+
+ /**
+ * Symbian 2nd phase constructor.
+ */
+ void ConstructL ();
+
+ /**
+ * Sorts iVideoArray by MDS ID.
+ */
+ void Sort();
+
+ /**
+ * Used for keeping RArray<TVcxMyVideosVideo> in integer order by
+ * TVcxMyVideosVideo::iMdsId.
+ *
+ * @param aVideo1 Video to compare
+ * @param aVideo2 Video to compare
+ * @return -1 if aVideo1 is smaller than aVideo2, 1 if aVideo1 is larger than
+ * aVideo2.
+ */
+ static TInt CompareVideosByMdsId( const TVcxMyVideosVideo& aVideo1,
+ const TVcxMyVideosVideo& aVideo2 );
+
+private:
+
+ /**
+ * Video array which is kept in order by MDS ID.
+ */
+ RArray<TVcxMyVideosVideo> iVideoArray;
+ };
+
+/**
* Used for storing MDS items to RAM for fast access.
*
* @lib mpxmyvideoscollectionplugin.lib
@@ -52,6 +186,19 @@
*/
virtual ~CVcxMyVideosVideoCache();
+ public:
+
+ /**
+ * @return ETrue if iVideoList is complete. (All items have
+ * been fetched from MDS.)
+ */
+ TBool IsComplete();
+
+ /**
+ * Set to ETrue when all items have been fetched from MDS.
+ */
+ void SetComplete( TBool aComplete );
+
private:
/**
* Constructor
@@ -176,7 +323,14 @@
* @return Position, KErrNotFound if item is not in iVideoList.
*/
TInt PosOnVideoListL( CMPXMedia& aVideo );
-
+
+#ifdef _DEBUG
+ /**
+ * Checks that iVideoListIndex is correctly formed.
+ */
+ void CheckVideoListIndexL();
+#endif
+
public:
/**
* Creates filtered video list from iVideoList. This is used for
@@ -327,11 +481,6 @@
* is removed.
*/
RArray<CMPXMedia*> iPartialVideoList;
-
- /**
- * If ETrue then iVideoList does not contain all items from MDS.
- */
- TBool iVideoListIsPartial;
/**
* Sorting order which was used last time when list was queryed from MDS.
@@ -343,11 +492,22 @@
*/
TBool IsFetchingVideoList;
private:
+
+ /**
+ * If ETrue then iVideoList contains all items from MDS.
+ */
+ TBool iVideoListIsComplete;
/**
* My Videos collection plugin, owner of this object.
*/
- CVcxMyVideosCollectionPlugin& iCollection;
+ CVcxMyVideosCollectionPlugin& iCollection;
+
+ /**
+ * Index which keeps TVcxMyVidesVideo items indexed in MDS ID
+ * order for fast access.
+ */
+ CVcxMyVideosVideoListIndex* iVideoListIndex;
};
#endif // VCXMYVIDEOSVIDEOCACHE_H
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp Mon May 03 12:32:50 2010 +0300
@@ -79,6 +79,7 @@
// Start the AO
iStatus = KRequestPending;
+ MPX_DEBUG1("CVcxMyVideosActiveTask::StartL SetActive");
SetActive();
TRequestStatus* status = &iStatus;
User::RequestComplete( status, KErrNone );
@@ -126,6 +127,8 @@
//
void CVcxMyVideosActiveTask::RunL()
{
+ MPX_DEBUG1("CVcxMyVideosActiveTask::RunL() start");
+
switch ( iObserver.HandleStepL() )
{
case MVcxMyVideosActiveTaskObserver::EDone:
@@ -136,10 +139,13 @@
ContinueStepping();
break;
- //observer is responsible for calling Done or ContinueStepping
+ //observer is responsible for calling Done, Cancel or ContinueStepping
case MVcxMyVideosActiveTaskObserver::EStopStepping:
+ MPX_DEBUG1("CVcxMyVideosActiveTask::RunL stopped stepping");
+ iStopped = ETrue;
break;
}
+ MPX_DEBUG1("CVcxMyVideosActiveTask::RunL() exit");
}
// ---------------------------------------------------------------------------
@@ -153,6 +159,7 @@
iObserver.HandleOperationCompleted( KErrNone );
delete iCurCommand;
iCurCommand = NULL;
+ iStopped = EFalse;
MPX_DEBUG1("CVcxMyVideosActiveTask::Done() exit");
}
@@ -165,21 +172,39 @@
{
++iCurStep;
iStatus = KRequestPending;
+ MPX_DEBUG1("CVcxMyVideosActiveTask::ContinueStepping SetActive");
SetActive();
+ iStopped = EFalse;
TRequestStatus* status = &iStatus;
User::RequestComplete( status, KErrNone );
}
+void CVcxMyVideosActiveTask::Cancel()
+ {
+ if ( iStopped && !IsActive() )
+ {
+ MPX_DEBUG1("CVcxMyVideosActiveTask:: was paused, calling DoCancel()");
+ DoCancel();
+ }
+ else
+ {
+ MPX_DEBUG1("CVcxMyVideosActiveTask:: wasn't paused, calling CActive::Cancel() normally");
+ CActive::Cancel();
+ }
+ }
// ---------------------------------------------------------------------------
// From CActive
// ---------------------------------------------------------------------------
//
void CVcxMyVideosActiveTask::DoCancel()
{
+ MPX_DEBUG1("CVcxMyVideosActiveTask::DoCancel() start");
// Callback and cleanup
iObserver.HandleOperationCompleted( KErrCancel );
delete iCurCommand;
iCurCommand = NULL;
+ iStopped = EFalse;
+ MPX_DEBUG1("CVcxMyVideosActiveTask::DoCancel() exit");
}
// ---------------------------------------------------------------------------
@@ -188,11 +213,15 @@
//
TInt CVcxMyVideosActiveTask::RunError( TInt aError )
{
+ MPX_DEBUG1("CVcxMyVideosActiveTask::RunError() start");
+
// Callback and cleanup
iObserver.HandleOperationCompleted( aError );
delete iCurCommand;
iCurCommand = NULL;
+ iStopped = EFalse;
+ MPX_DEBUG1("CVcxMyVideosActiveTask::RunError() exit");
return KErrNone;
}
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Mon May 03 12:32:50 2010 +0300
@@ -19,6 +19,7 @@
#include <mpxmedia.h>
#include <mpxmediaarray.h>
#include <mpxmediacontainerdefs.h>
+#include <mpxmediageneraldefs.h>
#include "vcxmyvideosalbum.h"
#include "vcxmyvideoscollectionplugin.h"
#include "vcxmyvideosvideocache.h"
@@ -111,7 +112,7 @@
// ---------------------------------------------------------------------------
//
void CVcxMyVideosAlbum::Sort()
- {
+ {
const TLinearOrder<TVcxMyVideosAlbumVideo> KOrderByMdsId(
CVcxMyVideosAlbum::CompareVideosByMdsId );
@@ -220,16 +221,6 @@
}
// ---------------------------------------------------------------------------
-// CVcxMyVideosAlbum::UpdateAttributesL
-// ---------------------------------------------------------------------------
-//
-void CVcxMyVideosAlbum::UpdateAttributesL()
- {
- //CalcNewVideoCountAndLatestNonWatchedL();
- //CalcPlaytimeL();
- }
-
-// ---------------------------------------------------------------------------
// CVcxMyVideosAlbum::CompareVideosByMdsId
// ---------------------------------------------------------------------------
//
@@ -267,7 +258,7 @@
// ---------------------------------------------------------------------------
// CVcxMyVideosAlbum::CreateVideoListL
-// Appends to video list items which belong to this album.
+// Appends to video list the items which belong to this album.
// ---------------------------------------------------------------------------
//
void CVcxMyVideosAlbum::AppendToVideoListL( CMPXMedia& aFromVideoList,
@@ -296,3 +287,47 @@
}
}
}
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosAlbum::CalculateAttributesL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbum::CalculateAttributesL( TInt aStartIndex )
+ {
+ TUint32 count = iVideoList.Count();
+ iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, count );
+ TInt newCount = 0;
+ CMPXMedia* video;
+ CMPXMedia* latestNewVideo = NULL;
+ TInt pos;
+ TUint32 flags;
+ TInt64 currentItemsCreationDate = 0;
+ TInt64 latestCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *iMedia );
+ for ( TInt i = aStartIndex; i < count; i++ )
+ {
+ video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos );
+ if ( video )
+ {
+ flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
+ if ( flags & EVcxMyVideosVideoNew )
+ {
+ newCount++;
+ currentItemsCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *video );
+ if ( latestCreationDate < currentItemsCreationDate )
+ {
+ latestCreationDate = currentItemsCreationDate;
+ latestNewVideo = video;
+ }
+ }
+ }
+ }
+ iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryItemCount, count );
+ iMedia->SetTObjectValueL<TUint32>( KVcxMediaMyVideosCategoryNewItemCount, newCount );
+ if ( latestNewVideo )
+ {
+ iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName,
+ TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) );
+ }
+ iMedia->SetTObjectValueL<TInt64>( KMPXMediaGeneralDate, latestCreationDate );
+ }
+
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp Mon May 03 12:32:50 2010 +0300
@@ -166,6 +166,51 @@
//
void CVcxMyVideosAlbums::AddVideosToAlbumL( CMPXMedia* aCmd )
{
+ TInt albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+ CVcxMyVideosAlbum* album = Album( albumId );
+ if ( album )
+ {
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
+ TInt count = mediaArray->Count();
+ CMPXMedia* video;
+ TInt mdsId;
+ RArray<TUint32> uniqueVideoIds;
+ uniqueVideoIds.Reset();
+ CleanupClosePushL( uniqueVideoIds );
+
+ for ( TInt i = 0; i < count; i++ )
+ {
+ video = mediaArray->AtL( i );
+ mdsId = TVcxMyVideosCollectionUtil::IdL( *video ).iId1;
+
+ // Mark duplicates as failed to aCmd (KErrAlreadyExists)
+ if ( uniqueVideoIds.Find( mdsId ) == KErrNotFound )
+ {
+ uniqueVideoIds.AppendL( mdsId );
+
+ // Mark videos which are already in album as failed to aCmd (KErrAlreadyExists)
+ if ( album->BelongsToAlbum( mdsId ) )
+ {
+ MPX_DEBUG3("CVcxMyVideosAlbums:: %d already belongs to %d album",
+ mdsId, albumId );
+ video->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, KErrAlreadyExists );
+ }
+ else
+ {
+ video->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, KErrNone );
+ }
+ }
+ else
+ {
+ MPX_DEBUG2("CVcxMyVideosAlbums:: %d already present in the aCmd, marking as KErrAlreadyExists", mdsId);
+ video->SetTObjectValueL<TInt32>( KVcxMediaMyVideosInt32Value, KErrAlreadyExists );
+ }
+
+ }
+
+ CleanupStack::PopAndDestroy( &uniqueVideoIds );
+ }
+
iCollection.iMyVideosMdsDb->iAlbums->AddVideosToAlbumL( aCmd, *this );
}
@@ -217,6 +262,11 @@
//
void CVcxMyVideosAlbums::AddAlbumL( CMPXMedia& aCmd )
{
+ if ( TVcxMyVideosCollectionUtil::Title( aCmd ).Length() > 255 )
+ {
+ User::Leave( KErrArgument );
+ }
+
iCollection.iMyVideosMdsDb->iAlbums->AddAlbumL( aCmd );
TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aCmd ).iId1;
@@ -243,7 +293,6 @@
//
void CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL( CMPXMedia* aCmd )
{
- //TODO: find out what happens to relations, do we have to clean them out
iCollection.iMyVideosMdsDb->iAlbums->RemoveAlbumsL( aCmd, *this );
}
@@ -297,6 +346,19 @@
}
// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::CalculateAttributesL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::CalculateAttributesL()
+ {
+ TInt count = iAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ iAlbums[i]->CalculateAttributesL();
+ }
+ }
+
+// ----------------------------------------------------------------------------
// CVcxMyVideosAlbums::AddAlbumsFromMdsL
// From MDS insert event, no need to fetch content since the album was just
// created.
@@ -429,36 +491,71 @@
{
MPX_DEBUG1("CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp() start");
+ TUint32 albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
+ CVcxMyVideosAlbum* album = Album( albumId );
+
CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *aCmd );
TVcxMyVideosAlbumVideo video;
- TUint albumId;
- CVcxMyVideosAlbum* album;
-
- TInt count = aItemArray.Count();
- for ( TInt i = 0; i < count; i++ )
+ RArray<CVcxMyVideosAlbum*> modifiedAlbums;
+ modifiedAlbums.Reset();
+ CleanupClosePushL( modifiedAlbums );
+
+ TInt mediaArrayCount = mediaArray->Count();
+ TInt resultArrayCount = aItemArray.Count();
+ CMPXMedia* media;
+ TInt j = 0;
+ for ( TInt i = 0; i < mediaArrayCount; i++ )
{
- video.iRelationMdsId = aItemArray[i]->Id();
- MPX_DEBUG3( "CVcxMyVideosAlbums:: item result[%d] = %d (id)", i, video.iRelationMdsId );
- if ( video.iRelationMdsId == KNoId )
+ if ( j > resultArrayCount - 1 )
+ {
+ MPX_DEBUG1("CVcxMyVideosAlbums:: result array already at end, skipping the rest");
+ break; //break from for loop
+ }
+
+ media = mediaArray->AtL( i );
+
+ // Skip items which were already failed (KErrAlreadyExists)
+ if ( TVcxMyVideosCollectionUtil::Int32ValueL( *media ) != KErrAlreadyExists )
{
- mediaArray->AtL( i )->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
- KErrGeneral );
+ video.iRelationMdsId = aItemArray[j]->Id();
+ MPX_DEBUG3( "CVcxMyVideosAlbums:: item result[%d] = %d (id)", j, video.iRelationMdsId );
+ if ( video.iRelationMdsId == KNoId )
+ {
+ media->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
+ KErrGeneral );
+ }
+ else
+ {
+ media->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value, KErrNone );
+ video.iMdsId = TVcxMyVideosCollectionUtil::IdL( *media ).iId1;
+ if ( album )
+ {
+ album->AddL( video );
+ if ( modifiedAlbums.Find( album ) == KErrNotFound )
+ {
+ modifiedAlbums.AppendL( album );
+ }
+ iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+ }
+ }
+ j++;
}
else
{
- mediaArray->AtL( i )->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value, KErrNone );
- video.iMdsId = TVcxMyVideosCollectionUtil::IdL( *mediaArray->AtL( i ) ).iId1;
- albumId = TVcxMyVideosCollectionUtil::Uint32ValueL( *aCmd );
- album = Album( albumId );
- if ( album )
- {
- album->AddL( video );
- iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
- EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
- }
+ MPX_DEBUG2("CVcxMyVideosAlbums:: skipping already failed %d(KErrAlreadyExists) media array item",
+ TVcxMyVideosCollectionUtil::IdL( *media ).iId1 );
}
}
+
+ TInt count = modifiedAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ modifiedAlbums[i]->CalculateAttributesL();
+ }
+
+ CleanupStack::PopAndDestroy( &modifiedAlbums );
iCollection.iActiveTask->Done();
iCollection.iMessageList->SendL();
@@ -549,20 +646,33 @@
const RArray<TMdERelation>& aRelationArray )
{
TRAP_IGNORE(
-
+
+ RArray<CVcxMyVideosAlbum*> modifiedAlbums;
+ modifiedAlbums.Reset();
+ CleanupClosePushL( modifiedAlbums );
+
TUint albumId;
CVcxMyVideosAlbum* album;
TInt count = aRelationArray.Count();
+
+
for ( TInt i = 0; i < count; i++ )
{
albumId = aRelationArray[i].LeftObjectId();
+ MPX_DEBUG3("CVcxMyVideosAlbums:: relation (%d,%d) deleted from MDS",
+ aRelationArray[i].LeftObjectId(), aRelationArray[i].RightObjectId() );
+
if ( iAlbumListIsComplete )
{
album = Album( albumId );
if ( album )
{
- album->Remove( aRelationArray[i].RightObjectId(), ETrue /* compress */ );
+ if ( modifiedAlbums.Find( album ) == KErrNotFound )
+ {
+ modifiedAlbums.AppendL( album );
+ }
+ album->Remove( aRelationArray[i].RightObjectId(), ETrue /* compress */ );
iCollection.iMessageList->AddEventL( TMPXItemId( albumId, KVcxMvcMediaTypeAlbum ),
EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
}
@@ -574,15 +684,28 @@
//album fetching from scratch.
}
}
+
+ count = modifiedAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ modifiedAlbums[i]->CalculateAttributesL();
+ }
+
+ CleanupStack::PopAndDestroy( &modifiedAlbums );
+
iCollection.iMessageList->SendL();
);
}
+//HandleRelationIdEvent
+
// ----------------------------------------------------------------------------
// CVcxMyVideosAlbums::UpdateAlbumL
// Updates album attributes from aAlbum, if album is not found from memory,
// nothing is done (no fetching from MDS).
+// This func is also called (by MDS modified event) when items are added or
+// removed from album.
// ----------------------------------------------------------------------------
//
TBool CVcxMyVideosAlbums::UpdateAlbumL( const CMPXMedia& aAlbum )
@@ -608,7 +731,39 @@
changed = ETrue;
}
}
+ // calculate attributes, in case that videos were removed or added to this album
+ album->CalculateAttributesL();
}
+
return changed;
}
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::NewVideoFlagChangedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::NewVideoFlagChangedL( TUint32 aMdsId )
+ {
+ TInt count = iAlbums.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ if ( iAlbums[i]->BelongsToAlbum( aMdsId ) )
+ {
+ iAlbums[i]->CalculateAttributesL();
+ iCollection.iMessageList->AddEventL(
+ TMPXItemId( iAlbums[i]->iMdsId, KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, EVcxMyVideosListNoInfo );
+ }
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::VideoTitleChangedL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::VideoTitleChangedL( TUint32 aMdsId )
+ {
+ NewVideoFlagChangedL( aMdsId ); // same calculation works for this
+ }
+
// END OF FILE
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Mon May 03 12:32:50 2010 +0300
@@ -451,16 +451,8 @@
MPX_DEBUG1("CVcxMyVideosCategories:: video added");
if ( TVcxMyVideosCollectionUtil::FlagsL( aVideo ) & EVcxMyVideosVideoNew )
{
- TInt64 newItemsDate( 0 );
- if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
- {
- newItemsDate = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
- }
- TInt64 prevNewDate( 0 );
- if ( aCategory.IsSupported( KMPXMediaGeneralDate ) )
- {
- prevNewDate = aCategory.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
- }
+ TInt64 newItemsDate = TVcxMyVideosCollectionUtil::CreationDateL( aVideo );
+ TInt64 prevNewDate = TVcxMyVideosCollectionUtil::CreationDateL( aCategory );
if ( static_cast<TInt64>(newItemsDate) > static_cast<TInt64>(prevNewDate) )
{
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Mon May 03 12:32:50 2010 +0300
@@ -251,7 +251,7 @@
void CVcxMyVideosCollectionPlugin::CommandL(
CMPXCommand& aCmd)
{
- MPX_FUNC("CVcxMyVideosCollectionPlugin::CommandL 2");
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin::CommandL() start");
if ( !aCmd.IsSupported( KMPXCommandGeneralId ) )
{
@@ -349,7 +349,7 @@
}
}
}
-
+ MPX_DEBUG1("CVcxMyVideosCollectionPlugin::CommandL() exit");
}
// ----------------------------------------------------------------------------
@@ -391,33 +391,6 @@
//
void CVcxMyVideosCollectionPlugin::SendMessages( CMPXMessage& aMessages )
{
-#if _DEBUG
- TRAP_IGNORE(
-
- if ( aMessages.IsSupported( KMPXMessageArrayContents ) )
- {
- const CMPXMessageArray* messageArray =
- aMessages.Value<CMPXMessageArray>(KMPXMessageArrayContents);
-
- for( TInt i = 0; i < messageArray->Count(); i++ )
- {
- MPX_DEBUG2("CVcxMyVideosCollectionPlugin:: sending message ID: %d in array", ++iTotalMessagesSent);
- messageArray->AtL( i )->SetTObjectValueL<TUint32>( KVcxMediaMyVideosMessageId, iTotalMessagesSent );
- iMessagesInArraySent++;
- }
-
- MPX_DEBUG3("CVcxMyVideosCollectionPlugin:: total messages sent (MSG ID): %d, messages in array sent: %d",
- iTotalMessagesSent, iMessagesInArraySent);
- }
- else
- {
- MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: NO ARRAY IN MESSAGE!!!");
- return;
- }
-
- );
-#endif
-
iObs->HandleMessage( aMessages );
}
@@ -429,7 +402,6 @@
TMPXChangeEventType aEvent,
RArray<TUint32>& aId )
{
- //MPX_FUNC("CVcxMyVideosCollectionPlugin::HandleMyVideosDbEvent");
TRAPD( err, DoHandleMyVideosDbEventL( aEvent, aId ));
if ( err != KErrNone )
{
@@ -688,13 +660,13 @@
if ( !iCache->iVideoList )
{
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: iVideoListCache = NULL -> creating new empty iCache->iVideoList");
- iCache->iVideoListIsPartial = ETrue;
+ iCache->SetComplete( EFalse );
iCache->iVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
}
TBool videoListFetchingWasCancelled = EFalse;
- if ( iCache->iVideoListIsPartial )
+ if ( !iCache->IsComplete() )
{
// Load items to cache
MPX_DEBUG1("CVcxMyVideosCollectionPlugin:: loading requested items to iCache->iVideoList");
@@ -1120,55 +1092,3 @@
iMessageList->SendL();
}
-#if 0
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::SetDownloadIdToZeroL
-// ----------------------------------------------------------------------------
-//
-void CVcxMyVideosCollectionPlugin::SetDownloadIdToZeroL( TUint aDownloadId )
- {
- CMPXMedia* video = iCache->FindVideoByDownloadIdL( aDownloadId );
- if ( video )
- {
- video->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, 0 );
- video->SetTObjectValueL<TUint8>( KVcxMediaMyVideosDownloadState,
- static_cast<TUint8>( EVcxMyVideosDlStateNone ) );
- iMyVideosMdsDb->UpdateVideoL( *video );
- iMessageList->AddEventL( TVcxMyVideosCollectionUtil::IdL(
- *video ), EMPXItemModified );
- iMessageList->SendL();
- }
- }
-
-#ifdef _DEBUG
-// ----------------------------------------------------------------------------
-// CVcxMyVideosCollectionPlugin::DownloadState
-// ----------------------------------------------------------------------------
-//
-const TDesC& CVcxMyVideosCollectionPlugin::DownloadState( TUint8 aDlState )
- {
- _LIT(KDlStateNoneDes, "None");
- _LIT(KDlStateDownloadingDes, "Downloading");
- _LIT(KDlStateFailedDes, "Failed");
- _LIT(KDlStatePausedDes, "Paused");
- _LIT(KDlStateDownloadedDes, "Downloaded");
-
- switch ( aDlState )
- {
- case EVcxMyVideosDlStateNone:
- return KDlStateNoneDes;
- case EVcxMyVideosDlStateDownloading:
- return KDlStateDownloadingDes;
- case EVcxMyVideosDlStateFailed:
- return KDlStateFailedDes;
- case EVcxMyVideosDlStatePaused:
- return KDlStatePausedDes;
- case EVcxMyVideosDlStateDownloaded:
- return KDlStateDownloadedDes;
- default:
- return KNullDesC;
- }
- }
-#endif
-
-#endif
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionutil.cpp Mon May 03 12:32:50 2010 +0300
@@ -278,6 +278,21 @@
}
// ----------------------------------------------------------------------------
+// TVcxMyVideosCollectionUtil::CreationDateL
+// ----------------------------------------------------------------------------
+//
+TInt64 TVcxMyVideosCollectionUtil::CreationDateL( CMPXMedia& aVideo )
+ {
+ TInt64 creationDate = 0;
+
+ if ( aVideo.IsSupported( KMPXMediaGeneralDate ) )
+ {
+ creationDate = aVideo.ValueTObjectL<TInt64>( KMPXMediaGeneralDate );
+ }
+ return creationDate;
+ }
+
+// ----------------------------------------------------------------------------
// TVcxMyVideosCollectionUtil::DownloadIdL
// ----------------------------------------------------------------------------
//
@@ -481,7 +496,7 @@
// TVcxMyVideosCollectionUtil::MediaArrayL
// ----------------------------------------------------------------------------
//
-CMPXMediaArray* TVcxMyVideosCollectionUtil::MediaArrayL( CMPXMedia& aMedia )
+CMPXMediaArray* TVcxMyVideosCollectionUtil::MediaArrayL( const CMPXMedia& aMedia )
{
if ( !aMedia.IsSupported( KMPXMediaArrayContents ) )
{
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp Mon May 03 12:32:50 2010 +0300
@@ -58,7 +58,7 @@
iMdsDb.iMdsSession->AddRelationItemObserverL( *this, NULL,
ENotifyRemove, iMdsDb.iNamespaceDef );
-#if 0
+#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
@@ -93,20 +93,22 @@
//
CVcxMyVideosMdsAlbums::~CVcxMyVideosMdsAlbums()
{
+ CancelQueries();
delete iAlbumQuery;
delete iVideoQuery;
delete iRelationQuery;
- delete iAlbumList;
iItemArray.Close();
iResultBuffer.Close();
}
// ---------------------------------------------------------------------------
-// CVcxMyVideosMdsAlbums::Cancel
+// CVcxMyVideosMdsAlbums::CancelQueries
// ---------------------------------------------------------------------------
//
-void CVcxMyVideosMdsAlbums::Cancel( CVcxMyVideosMdsDb::TRequestType aType )
+void CVcxMyVideosMdsAlbums::CancelQueries( CVcxMyVideosMdsDb::TRequestType aType )
{
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::CancelQueries() start");
+
if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EGetAlbums )
{
if ( iAlbumQuery )
@@ -130,15 +132,42 @@
iVideoQuery->Cancel();
}
}
-
-
- //TODO: cancel for "add to album"
+
+ if ( aType == CVcxMyVideosMdsDb::EAll || aType == CVcxMyVideosMdsDb::EAddVideosToAlbum
+ || aType == CVcxMyVideosMdsDb::ERemoveRelations
+ || aType == CVcxMyVideosMdsDb::ERemoveAlbums )
+ {
+
+ // MDS does not offer cancel for these
+ //Cancel();
+ }
+
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::CancelQueries() exit");
+ }
+
+// ---------------------------------------------------------------------------
+// From CActive
+// CVcxMyVideosMdsAlbums::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::DoCancel()
+ {
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoCancel() start");
+
+#if 0
+ // Seems like the only way to cancel these is to close session to MDS and reopen it...
+ // Update: even this does not cancel the operation
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums:: closing mds session");
+
+ delete iMdsDb.iMdsSession;
+ iMdsDb.iMdsSession = NULL;
- //TODO: cancel for "remove from album"
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums:: opening mds session");
+ TRAP_IGNORE( iMdsDb.OpenMdsSessionL() );
+ MPX_DEBUG2("CVcxMyVideosMdsAlbums:: opened mds session (%d)", iMdsDb.iMdsError);
+#endif
- //TODO: cancel for "remove albums"
-
- // Seems like the only way to cancel these is to close session to MDS and reopen it...
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums::DoCancel() exit");
}
// ---------------------------------------------------------------------------
@@ -314,7 +343,6 @@
rootCondition.AddRelationConditionL( *iContainsRelationDef );
CMdELogicCondition& leftCondition = relationCondition.LeftL();
- CMdELogicCondition& rightCondition = relationCondition.RightL();
//...left side is an album...
leftCondition.AddObjectConditionL( *iAlbumObjectDef );
@@ -551,7 +579,7 @@
Object2MediaL( object, *media );
#ifdef _DEBUG
- TBuf<200> title;
+ TBuf<KVcxMvcMaxTitleLength> title;
title = TVcxMyVideosCollectionUtil::Title( *media );
MPX_DEBUG2("CVcxMyVideosMdsAlbums:: object title: %S", &title);
#endif
@@ -668,7 +696,7 @@
cmd->iCmdType = CVcxMyVideosMdsDb::EAddVideosToAlbum;
cmd->iClient = &aClient;
cmd->iMpxCmd = aCmd;
- iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //owneship moves
+ iMdsDb.iCmdQueue->ExecuteCmdL( cmd ); //ownership moves
CleanupStack::Pop( cmd ); // <-1
MPX_DEBUG1("CVcxMyVideosMdsAlbums::AddVideosToAlbumL() exit");
}
@@ -692,12 +720,17 @@
iItemArray.Reserve( count );
for ( TInt i = 0; i < count; i++ )
{
- relation = iMdsDb.iMdsSession->NewRelationL(
- *iContainsRelationDef, albumId,
- TVcxMyVideosCollectionUtil::IdL( *videoArray->AtL( i ) ) );
- CleanupStack::PushL( relation );
- iItemArray.AppendL( relation );
- CleanupStack::Pop( relation );
+ // Filter already failed items out from the request (KErrAlreadyExists)
+ if ( TVcxMyVideosCollectionUtil::Int32ValueL( *videoArray->AtL( i ) )
+ != KErrAlreadyExists )
+ {
+ relation = iMdsDb.iMdsSession->NewRelationL(
+ *iContainsRelationDef, albumId,
+ TVcxMyVideosCollectionUtil::IdL( *videoArray->AtL( i ) ) );
+ CleanupStack::PushL( relation );
+ iItemArray.AppendL( relation );
+ CleanupStack::Pop( relation );
+ }
}
iClient = &aClient;
@@ -942,16 +975,6 @@
//TODO: implement RunError
// ---------------------------------------------------------------------------
-// CVcxMyVideosMdsAlbums::RunL
-// From CActive.
-// ---------------------------------------------------------------------------
-//
-void CVcxMyVideosMdsAlbums::DoCancel()
- {
- //TODO:
- }
-
-// ---------------------------------------------------------------------------
// CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL
// ---------------------------------------------------------------------------
//
@@ -1039,7 +1062,7 @@
iObserver->HandleRelationEvent( aType, aRelationArray );
}
-#if 0 //not used
+#if 0
// ----------------------------------------------------------------------------
// CVcxMyVideosMdsAlbums::HandleRelationNotification
// From MMdERelationObserver
@@ -1048,19 +1071,18 @@
void CVcxMyVideosMdsAlbums::HandleRelationNotification(CMdESession& /*aSession*/,
TObserverNotificationType aType,
const RArray<TItemId>& aRelationIdArray)
- {
- iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
-
+ {
switch ( aType )
{
case ENotifyAdd:
- MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyAdd");
+ MPX_DEBUG1("CVcxMyVideosMdsAlbums:: relation ENotifyAdd");
+ iObserver->HandleRelationIdEvent( aType, aRelationIdArray );
break;
case ENotifyModify:
MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyModify");
break;
case ENotifyRemove:
- MPX_DEBUG1("CVcxMyVideosMdsAlbums:: ENotifyRemove");
+ //remove is handled at HandleRelationItemNotification
break;
}
}
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsdb.cpp Mon May 03 12:32:50 2010 +0300
@@ -78,47 +78,54 @@
//
void CVcxMyVideosMdsDb::ConstructL()
{
- MPX_FUNC( "CVcxMyVideosMdsDb::ConstructL" );
+ MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL start" );
iCmdQueue = CVcxMyVideosMdsCmdQueue::NewL( *this );
iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait;
- MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL CMdESession::NewL" );
+ OpenMdsSessionL();
+
+ // Get the schema definitions
+ GetSchemaDefinitionsL();
+
+ iAlbums = CVcxMyVideosMdsAlbums::NewL( *this, iAlbumsObserver );
+
+ TCallBack callBack( AsyncHandleQueryCompleted, this );
+ iAsyncHandleQueryCompleteCaller = new (ELeave) CAsyncCallBack( callBack,
+ CActive::EPriorityStandard );
- // Create session
+ MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL exit" );
+ }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosMdsDb::OpenMdsSessionL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsDb::OpenMdsSessionL()
+ {
+ MPX_DEBUG1( "CVcxMyVideosMdsDb::OpenMdsSessionL() start" );
+
iMdsError = KErrNone;
iMdsSession = CMdESession::NewL( *this );
- if (!iMdsSession)
+ if ( !iMdsSession )
{
// Failed to create session, leave
User::Leave( iMdsError );
}
-
- // Wait until session opened
- iActiveSchedulerWait->Start();
-
- MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL iActiveSchedulerWait->Start done" );
-
+
if ( iMdsError != KErrNone )
{
MPX_DEBUG2("Failed to create session to MDS: %d", iMdsError);
User::LeaveIfError( iMdsError );
}
- // Get the schema definitions
- iMdsError = KErrNone;
- GetSchemaDefinitionsL();
+ // Wait until session opened
+ iActiveSchedulerWait->Start();
+ MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL iActiveSchedulerWait->Start done" );
- // Is schema ok
- if ( iMdsError != KErrNone )
- {
- // Schema not loaded, abort
- User::Leave( iMdsError );
- }
-
- MPX_DEBUG1( "CVcxMyVideosMdsDb::ConstructL Adding observers" );
+ MPX_DEBUG1( "CVcxMyVideosMdsDb::OpenMdsSessionL Adding observers" );
// We order all object notifications. If we set video condition, then we wont
// receive remove notifications at all (mds feature). Extra notifications
@@ -128,12 +135,8 @@
iMdsSession->AddObjectObserverL( *this, NULL );
iMdsSession->AddObjectPresentObserverL( *this );
-
- iAlbums = CVcxMyVideosMdsAlbums::NewL( *this, iAlbumsObserver );
-
- TCallBack callBack( AsyncHandleQueryCompleted, this );
- iAsyncHandleQueryCompleteCaller = new (ELeave) CAsyncCallBack( callBack,
- CActive::EPriorityStandard );
+
+ MPX_DEBUG1( "CVcxMyVideosMdsDb::OpenMdsSessionL() exit" );
}
// ---------------------------------------------------------------------------
@@ -192,8 +195,9 @@
{
MPX_FUNC( "CVcxMyVideosMdsDb::~CVcxMyVideosMdsDb()" );
- Cancel();
+ Cancel( EGetVideoList );
+ delete iAlbums;
delete iCmdQueue;
if ( iMdsSession )
@@ -202,7 +206,6 @@
}
delete iVideoQuery;
- delete iAlbums;
delete iMdsSession;
delete iActiveSchedulerWait;
delete iAsyncHandleQueryCompleteCaller;
@@ -214,7 +217,7 @@
//
void CVcxMyVideosMdsDb::Cancel( TRequestType aType )
{
- MPX_FUNC("CVcxMyVideosMdsDb::Cancel()");
+ MPX_DEBUG1("CVcxMyVideosMdsDb::Cancel() start");
iCmdQueue->Cancel( aType );
@@ -227,7 +230,12 @@
iVideoListFetchingIsOngoing = EFalse;
}
- iAlbums->Cancel( aType );
+ if ( aType != EGetVideoList )
+ {
+ iAlbums->CancelQueries( aType );
+ }
+
+ MPX_DEBUG1("CVcxMyVideosMdsDb::Cancel() exit");
}
// ---------------------------------------------------------------------------
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmessagelist.cpp Mon May 03 12:32:50 2010 +0300
@@ -271,7 +271,7 @@
//
void CVcxMyVideosMessageList::SendL()
{
- MPX_FUNC("CVcxMyVideosMessageList::SendL()");
+ MPX_DEBUG1("CVcxMyVideosMessageList::SendL");
if ( iMessageCount == 0 || !iMessageList )
{
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp Mon May 03 12:32:50 2010 +0300
@@ -152,6 +152,8 @@
{
//we are at second level, return video list from some category or album
+ iCollection.AlbumsL().CreateAlbumListL(); //async
+
TMPXItemId categoryId( aPath.Id() );
if ( ( categoryId.iId2 == KVcxMvcMediaTypeCategory ) ||
@@ -170,7 +172,6 @@
{
MPX_DEBUG2("CVcxMyVideosOpenHandler:: opening album %d", categoryId.iId1 );
- iCollection.AlbumsL().CreateAlbumListL(); //async
iPendingAlbumOpenId = categoryId.iId1;
if ( iCollection.AlbumsL().iAlbumListIsComplete )
{
@@ -209,7 +210,7 @@
// If iCache.iVideoList is complete and can be used (correct sorting order),
// then nothing is done.
- if ( !iCache.iVideoListIsPartial )
+ if ( iCache.IsComplete() )
{
MPX_DEBUG1("CVcxMyVideosOpenHandler:: videolist complete");
@@ -320,7 +321,7 @@
{
// End event arrived
- iCache.iVideoListIsPartial = EFalse;
+ iCache.SetComplete( ETrue );
iCache.IsFetchingVideoList = EFalse;
@@ -359,8 +360,9 @@
// (KVcxMessageMyVideosItemsAppended events don't update collection frameworks cache) cache.
MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for album %d, extra info = %d",
iAlbumIdsBeingOpened[i], EVcxMyVideosVideoListOrderChanged );
- iCollection.iMessageList->AddEventL( TMPXItemId( iAlbumIdsBeingOpened[i], 2 ), EMPXItemModified,
- EVcxMyVideosVideoListOrderChanged );
+ iCollection.iMessageList->AddEventL(
+ TMPXItemId( iAlbumIdsBeingOpened[i], KVcxMvcMediaTypeAlbum ),
+ EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
// We dont send here, the send is at the end of this function.
delete iAlbumVideoListsBeingOpened[i]; // we can delete our copy, client has its own copy
iAlbumVideoListsBeingOpened[i] = NULL;
@@ -374,6 +376,8 @@
iCollection.CategoriesL().UpdateCategoriesNewVideoNamesL();
+ iCollection.AlbumsL().CalculateAttributesL();
+
iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
}
iCollection.iMessageList->SendL();
@@ -394,7 +398,7 @@
CVcxMyVideosAlbum* album = iCollection.AlbumsL().Album( iPendingAlbumOpenId );
if ( album )
{
- if ( !iCollection.iCache->iVideoListIsPartial )
+ if ( iCollection.iCache->IsComplete() )
{
//videolist complete
CMPXMedia* videoList = album->CreateVideoListL();
@@ -512,8 +516,11 @@
else
{
//TODO: should add album id
+ iCollection.AlbumsL().CalculateAttributesL();
+
iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
+
delete iAlbumVideoList;
iAlbumVideoList = NULL;
}
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Mon May 03 12:32:50 2010 +0300
@@ -14,6 +14,7 @@
* Description: Video list cache. Contains cached data from MDS.*
*/
+// Version : %version: %
// INCLUDE FILES
@@ -33,13 +34,226 @@
#include "vcxmyvideoscategories.h"
#include "vcxmyvideosmessagelist.h"
#include "vcxmyvideosopenhandler.h"
-
-// If video list fetching is going on and at the same time add/delete events
-// arrive from mds, what to do?
+#include "vcxmyvideosalbums.h"
// ============================ MEMBER FUNCTIONS ==============================
// ----------------------------------------------------------------------------
+// constructor.
+// ----------------------------------------------------------------------------
+//
+TVcxMyVideosVideo::TVcxMyVideosVideo()
+:iMdsId( 0 ), iVideo( NULL ), iPos( KErrNotFound )
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// TVcxMyVideosVideo::operator=
+// ---------------------------------------------------------------------------
+//
+TVcxMyVideosVideo& TVcxMyVideosVideo::operator=( const TVcxMyVideosVideo& aVideo )
+ {
+ Set( aVideo.iMdsId, aVideo.iPos, aVideo.iVideo );
+ return *this;
+ }
+
+// ----------------------------------------------------------------------------
+// TVcxMyVideosVideo::Set
+// ----------------------------------------------------------------------------
+//
+void TVcxMyVideosVideo::Set( TUint32 aMdsId, TInt aPos, CMPXMedia* aVideo )
+ {
+ iMdsId = aMdsId;
+ iPos = aPos;
+ iVideo = aVideo;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::NewL
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosVideoListIndex* CVcxMyVideosVideoListIndex::NewL()
+ {
+ CVcxMyVideosVideoListIndex* self = new (ELeave) CVcxMyVideosVideoListIndex();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::CVcxMyVideosVideoListIndex
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosVideoListIndex::CVcxMyVideosVideoListIndex()
+ {
+
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::ConstructL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoListIndex::ConstructL ()
+ {
+ iVideoArray.Reset();
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::~CVcxMyVideosVideoListIndex
+// ----------------------------------------------------------------------------
+//
+CVcxMyVideosVideoListIndex::~CVcxMyVideosVideoListIndex()
+ {
+ iVideoArray.Close();
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::~CVcxMyVideosVideoListIndex
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoListIndex::SetL( const CMPXMedia& aVideoList )
+ {
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( aVideoList );
+ TInt count = mediaArray->Count();
+ iVideoArray.Reset();
+ iVideoArray.ReserveL( count );
+ for ( TInt i = 0; i < count; i++ )
+ {
+ AddL( mediaArray->AtL( i ), i );
+ }
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::Find
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoListIndex::Find( TUint32 aMdsId, TVcxMyVideosVideo& aVideo )
+ {
+ const TLinearOrder<TVcxMyVideosVideo> KOrderByMdsId(
+ CVcxMyVideosVideoListIndex::CompareVideosByMdsId );
+
+ TInt index;
+ TVcxMyVideosVideo video;
+ video.iMdsId = aMdsId;
+ TInt err = iVideoArray.FindInOrder( video, index, KOrderByMdsId );
+
+ if ( err != KErrNone )
+ {
+ return KErrNotFound;
+ }
+
+ aVideo = iVideoArray[index];
+ return KErrNone;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::Remove
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoListIndex::Remove( TUint32 aMdsId, TBool aCompress )
+ {
+ const TLinearOrder<TVcxMyVideosVideo> KOrderByMdsId(
+ CVcxMyVideosVideoListIndex::CompareVideosByMdsId );
+
+ TVcxMyVideosVideo video;
+ video.iMdsId = aMdsId;
+ TInt pos;
+ TInt posInVideoList;
+ TInt err = iVideoArray.FindInOrder( video, pos, KOrderByMdsId );
+ if ( err == KErrNone )
+ {
+ posInVideoList = iVideoArray[pos].iPos;
+ iVideoArray.Remove( pos );
+
+ // update all indexes which are bigger than posInVideoList
+ TInt count = iVideoArray.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ if ( iVideoArray[i].iPos > posInVideoList )
+ {
+ iVideoArray[i].iPos--;
+ }
+ }
+ }
+
+ if ( aCompress )
+ {
+ iVideoArray.Compress();
+ }
+
+ return err;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::AddL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoListIndex::AddL( CMPXMedia* aVideo, TInt aPos )
+ {
+ TVcxMyVideosVideo video;
+ video.Set( TVcxMyVideosCollectionUtil::IdL( *aVideo ).iId1, aPos, aVideo );
+
+ const TLinearOrder<TVcxMyVideosVideo> KOrderByMdsId(
+ CVcxMyVideosVideoListIndex::CompareVideosByMdsId );
+
+ // update indexes
+ TInt count = iVideoArray.Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ if ( iVideoArray[i].iPos >= aPos )
+ {
+ iVideoArray[i].iPos++;
+ }
+ }
+
+ iVideoArray.InsertInOrderAllowRepeatsL( video, KOrderByMdsId );
+
+ }
+
+#ifdef _DEBUG
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::VideoArray
+// ----------------------------------------------------------------------------
+//
+const RArray<TVcxMyVideosVideo>& CVcxMyVideosVideoListIndex::VideoArray()
+ {
+ return iVideoArray;
+ }
+#endif
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::Sort
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoListIndex::Sort()
+ {
+ const TLinearOrder<TVcxMyVideosVideo> KOrderByMdsId(
+ CVcxMyVideosVideoListIndex::CompareVideosByMdsId );
+
+ iVideoArray.Sort( KOrderByMdsId );
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoListIndex::CompareVideosByMdsId
+// ----------------------------------------------------------------------------
+//
+TInt CVcxMyVideosVideoListIndex::CompareVideosByMdsId( const TVcxMyVideosVideo& aVideo1,
+ const TVcxMyVideosVideo& aVideo2 )
+ {
+ if ( aVideo1.iMdsId == aVideo2.iMdsId )
+ {
+ return 0;
+ }
+
+ if ( aVideo1.iMdsId < aVideo2.iMdsId )
+ {
+ return -1;
+ }
+ return 1;
+ }
+
+// ----------------------------------------------------------------------------
// Two-phased constructor.
// ----------------------------------------------------------------------------
//
@@ -65,6 +279,7 @@
delete iVideoList;
DeletePartialList();
+ delete iVideoListIndex;
}
// ----------------------------------------------------------------------------
@@ -87,9 +302,10 @@
MPX_FUNC("CVcxMyVideosVideoCache::ConstructL");
iVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
- iVideoListIsPartial = ETrue;
-
+ SetComplete( EFalse );
+
iPartialVideoList.Reset();
+ iVideoListIndex = CVcxMyVideosVideoListIndex::NewL();
}
// ----------------------------------------------------------------------------------------------------------
@@ -222,7 +438,19 @@
{
return NULL;
}
-
+
+ if ( IsComplete() )
+ {
+ TVcxMyVideosVideo video;
+ TInt pos = iVideoListIndex->Find( aMdsId, video );
+ if ( pos != KErrNotFound )
+ {
+ aPos = video.iPos;
+ MPX_DEBUG2("CVcxMyVideosVideoCache::FindVideoByMdsIdL found %d from index", aMdsId );
+ return video.iVideo;
+ }
+ }
+
CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
KMPXMediaArrayContents);
@@ -370,7 +598,7 @@
{
MPX_FUNC("CVcxMyVideosVideoCache::AddL");
- if ( iVideoListIsPartial )
+ if ( !IsComplete() )
{
MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList is partial, adding to iPartialVideoList");
return AddToPartialListL( aVideo );
@@ -528,7 +756,7 @@
return;
}
- if ( iVideoListIsPartial || (sortingOrder != iLastSortingOrder) || aForce )
+ if ( !IsComplete() || (sortingOrder != iLastSortingOrder) || aForce )
{
MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating");
@@ -564,7 +792,7 @@
IsFetchingVideoList = ETrue;
iLastSortingOrder = sortingOrder;
- iVideoListIsPartial = ETrue;
+ SetComplete( EFalse );
}
else
{
@@ -627,30 +855,7 @@
if ( videoInCache->ValueText( KMPXMediaGeneralUri ) !=
aVideo.ValueText( KMPXMediaGeneralUri ) )
- {
-#if 0 // this should be in mds, or mds should keep title empty if it is not set by client
- TParse parse;
- HBufC* oldTitle = HBufC::NewL( videoInCache->ValueText( KMPXMediaGeneralTitle ).Length() );
- CleanupStack::PushL( oldTitle ); // 1->
- oldTitle->Des() = videoInCache->ValueText( KMPXMediaGeneralTitle );
- oldTitle->Des().LowerCase();
-
- parse.Set( videoInCache->ValueText( KMPXMediaGeneralUri ), NULL, NULL );
- MPX_DEBUG2("CVcxMyVideosVideoCache:: title generated from old file name: %S", &parse.Name());
- MPX_DEBUG2("CVcxMyVideosVideoCache:: old title (lower cased): %S", oldTitle);
- if ( parse.Name() == *oldTitle )
- {
- // filename has been used as a title -> update title also to new filename
- MPX_DEBUG1("CVcxMyVideosVideoCache:: filename has been used as a title -> changing title to new filename");
- parse.Set( aVideo.ValueText( KMPXMediaGeneralUri ), NULL, NULL );
- videoInCache->SetTextValueL( KMPXMediaGeneralTitle, parse.Name() );
-
- //updates sorting order and category attributes if necessarry
- HandleVideoTitleModifiedL( videoInCache );
- }
- CleanupStack::PopAndDestroy( oldTitle ); // <-1
-#endif
-
+ {
videoInCache->SetTextValueL( KMPXMediaGeneralUri,
aVideo.ValueText( KMPXMediaGeneralUri ) );
@@ -708,7 +913,7 @@
KMPXMediaGeneralId ).iId1, pos );
iCollection.CategoriesL().GenerateCategoryModifiedEventL(
- *videoInCache, ETrue /* flush */, EVcxMyVideosVideoListOrderChanged );
+ *videoInCache, EFalse /* dont flush */, EVcxMyVideosVideoListOrderChanged );
}
changed = ETrue;
@@ -728,7 +933,7 @@
if ( aVideo.IsSupported( KMPXMediaGeneralLastPlaybackPosition ) )
{
newFlags &= ~EVcxMyVideosVideoNew;
- MPX_DEBUG3("CVcxMyVideosVideoCache:: %x -> %x", oldFlags, newFlags);
+ MPX_DEBUG3("CVcxMyVideosVideoCache:: flags: %x -> %x", oldFlags, newFlags);
}
if ( oldFlags != newFlags )
@@ -747,13 +952,9 @@
oldFlags, newFlags,
videoInCache->ValueTObjectL<TUint8>( KVcxMediaMyVideosOrigin ),
modified );
-
- if ( !(newFlags & EVcxMyVideosVideoNew) &&
- TVcxMyVideosCollectionUtil::OriginL( *videoInCache ) == EVcxMyVideosOriginDownloaded )
- {
- MPX_DEBUG1("CVcxMyVideosVideoCache::UpdateVideoL - Count of new videos in Downloaded origin has decreased, sending mediator event to notification launcher");
- iCollection.NotifyNewVideosCountDecreasedL( *videoInCache );
- }
+
+ iCollection.AlbumsL().NewVideoFlagChangedL(
+ TVcxMyVideosCollectionUtil::IdL( *videoInCache ).iId1 );
}
changed = ETrue;
}
@@ -970,7 +1171,12 @@
changed = ETrue;
}
}
-
+
+ if ( changed )
+ {
+ iCollection.iMessageList->SendL();
+ }
+
return changed;
}
@@ -990,6 +1196,9 @@
iCollection.CategoriesL().UpdateCategoryNewVideoNameAndDateL(
*aVideoInCache, modified );
+ iCollection.AlbumsL().VideoTitleChangedL(
+ TVcxMyVideosCollectionUtil::IdL( *aVideoInCache ).iId1 );
+
TVcxMyVideosSortingOrder sortingOrder = SortingOrderL();
if ( sortingOrder == EVcxMyVideosSortingName )
{
@@ -1276,19 +1485,22 @@
TInt pos = FindCorrectPositionL( aVideo, aSortingOrder );
- CMPXMediaArray* cachedVideoArray = NULL;
- cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
+ CMPXMediaArray* cachedVideoArray = iVideoList->Value<CMPXMediaArray>(
KMPXMediaArrayContents );
if ( pos > (cachedVideoArray->Count() -1) )
{
- cachedVideoArray->AppendL( aVideo );
+ cachedVideoArray->AppendL( aVideo );
}
else
{
cachedVideoArray->InsertL( aVideo, pos );
}
-
+ iVideoListIndex->AddL( cachedVideoArray->AtL( pos ), pos );
+#ifdef _DEBUG
+ CheckVideoListIndexL();
+#endif
+
if ( aUpdateCategories )
{
iCollection.CategoriesL().VideoAddedL( aVideo );
@@ -1329,6 +1541,7 @@
// ----------------------------------------------------------------------------
// CVcxMyVideosVideoCache::RemoveL
+// All removes end up here (except ResetVideoListL).
// ----------------------------------------------------------------------------
//
TInt CVcxMyVideosVideoCache::RemoveL( TUint32 aMdsId, TBool aUpdateCategories )
@@ -1344,18 +1557,7 @@
return KErrNotFound;
}
- TUint32 flags( 0 );
- if ( video->IsSupported( KMPXMediaGeneralFlags ) )
- {
- flags = video->ValueTObjectL<TUint32>( KMPXMediaGeneralFlags );
- }
-
- if ( ( flags & EVcxMyVideosVideoNew ) &&
- TVcxMyVideosCollectionUtil::OriginL( *video ) == EVcxMyVideosOriginDownloaded )
- {
- MPX_DEBUG1("CVcxMyVideosVideoCache::RemoveL - New video has been removed from Downloaded origin -> sending mediator event to notification launcher");
- iCollection.NotifyNewVideosCountDecreasedL( *video );
- }
+ TUint32 flags = TVcxMyVideosCollectionUtil::FlagsL( *video );
if ( aUpdateCategories &&
pos != KErrNotFound /* no need to update if item is on iPartialVideoList*/ )
@@ -1370,6 +1572,10 @@
MPX_DEBUG2("CVcxMyVideosVideoCache:: %d removed from iVideoList", aMdsId);
cachedVideoArray->Remove( pos );
+ iVideoListIndex->Remove( aMdsId, ETrue /* compress */);
+#ifdef _DEBUG
+ CheckVideoListIndexL();
+#endif
}
else
{
@@ -1442,7 +1648,7 @@
}
}
- iVideoListIsPartial = ETrue;
+ SetComplete( EFalse );
iCollection.CategoriesL().ResetVideoCountersL(); //this does not send events
}
@@ -1480,7 +1686,92 @@
delete iVideoList;
iVideoList = NULL;
iVideoList = newList;
+
+ iVideoListIndex->SetL( *iVideoList );
+#ifdef _DEBUG
+ CheckVideoListIndexL();
+#endif
+
CleanupStack::Pop( newList ); // <-1
}
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::IsComplete
+// ----------------------------------------------------------------------------
+//
+TBool CVcxMyVideosVideoCache::IsComplete()
+ {
+ return iVideoListIsComplete;
+ }
+
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::SetComplete
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::SetComplete( TBool aComplete )
+ {
+ if ( !iVideoListIsComplete && aComplete )
+ {
+ MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList turned to complete, setting up iVideoListIndex");
+ iVideoListIndex->SetL( *iVideoList );
+#ifdef _DEBUG
+ CheckVideoListIndexL();
+#endif
+ }
+ iVideoListIsComplete = aComplete;
+ }
+
+#ifdef _DEBUG
+// ----------------------------------------------------------------------------
+// CVcxMyVideosVideoCache::SetComplete
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosVideoCache::CheckVideoListIndexL()
+ {
+ if ( !IsComplete() )
+ {
+ return;
+ }
+
+ TInt pos;
+ TInt mdsId;
+ CMPXMedia* video;
+ CMPXMediaArray* mediaArray = TVcxMyVideosCollectionUtil::MediaArrayL( *iVideoList );
+ TInt count = iVideoListIndex->VideoArray().Count();
+ for ( TInt i = 0; i < count; i++ )
+ {
+ pos = iVideoListIndex->VideoArray()[i].iPos;
+ mdsId = iVideoListIndex->VideoArray()[i].iMdsId;
+ video = iVideoListIndex->VideoArray()[i].iVideo;
+
+ if ( pos < 0 || pos > mediaArray->Count() -1 )
+ {
+ MPX_DEBUG3( "CVcxMyVideosVideoCache:: iVideoListIndex->iVideoArray[%d].iPos out of range -> Panic",
+ i, pos );
+ _LIT( KVideoListIndexPosCorrupted, "iVideoListIndex pos");
+ User::Panic( KVideoListIndexPosCorrupted, KErrCorrupt );
+ }
+
+ if ( mediaArray->AtL( pos ) != video )
+ {
+ MPX_DEBUG3( "CVcxMyVideosVideoCache:: iVideoListIndex->iVideoArray[%d].iVideo != mediaArray->AtL( %d ) -> Panic",
+ i, pos );
+ _LIT( KVideoListIndexVideoCorrupted, "iVideoListIndex video pointer");
+ User::Panic( KVideoListIndexVideoCorrupted, KErrCorrupt );
+ }
+
+ if ( TVcxMyVideosCollectionUtil::IdL( *mediaArray->AtL( pos ) ).iId1 !=
+ mdsId )
+ {
+ MPX_DEBUG3( "CVcxMyVideosVideoCache:: iVideoListIndex->iVideoArray[%d].iMdsId != MDSID in mediaArray->AtL( %d ) -> Panic",
+ i, pos );
+ _LIT( KVideoListIndexMdsIdCorrupted, "iVideoListIndex MDS ID");
+ User::Panic( KVideoListIndexMdsIdCorrupted, KErrCorrupt );
+ }
+ }
+ MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoListIndex check OK");
+ }
+#endif
+
// End of file
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTest.cfg Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTest.cfg Mon May 03 12:32:50 2010 +0300
@@ -446,10 +446,12 @@
VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video0.mp4"
-VCXMV CloseLevel EVcxMyVideosAllVideos
+VCXMV CloseLevel
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
waittestclass VCXMV
+VCXMV CoolDown
+
VCXMV OpenLevel EVcxMyVideosAllVideos
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
waittestclass VCXMV
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestAlbums.cfg Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/conf/VCXMyVideosCollectionPluginTestAlbums.cfg Mon May 03 12:32:50 2010 +0300
@@ -216,6 +216,8 @@
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
waittestclass VCXMV
+VCXMV CoolDown
+
VCXMV CheckAlbumCount 2
print OK!
@@ -243,9 +245,10 @@
VCXMV CreateAlbum "2KString"
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
-waittestclass VCXMV
-
-VCXMV CheckAlbumCount 1
+allownextresult KERRARGUMENT
+waittestclass VCXMV
+
+VCXMV CheckAlbumCount 0
print OK!
delete VCXMV
@@ -341,6 +344,8 @@
VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
waittestclass VCXMV
+VCXMV CoolDown
+
VCXMV CheckAlbumCount 2
print OK!
@@ -2511,3 +2516,606 @@
delete VCXMV
[Endtest]
+#------------------------------------------------------------------------------------
+#
+# Album video count - album just created, empty
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - album just created, empty
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckAlbumExists Album1
+VCXMV CheckAlbumCount 1
+
+allownextresult -1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 0
+allownextresult -1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - no videos
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - no videos
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+delete VCXMV
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckAlbumExists Album1
+VCXMV CheckAlbumCount 1
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 0
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 0
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos added
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos added
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - album has videos
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - album has videos
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+delete VCXMV
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - album open and close
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - album open and close
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+delete VCXMV
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV OpenLevel Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 3
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 3
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos removed at root level
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos removed at root level
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV SetUseCopiedMedias 1
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV RemoveMediasFromAlbum Album1 ANY_DRIVE 0 2
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos removed when album is open
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos removed when album is open
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV RemoveMediasFromAlbum Album1 ANY_DRIVE 0 2
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos deleted at root level
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos deleted at root level
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV SetUseCopiedMedias 1
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV DeleteMedias ANY_DRIVE 0 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos deleted when all videos is open
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos deleted when all videos is open
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV DeleteMedias ANY_DRIVE 0 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos deleted when album is open
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos deleted when album is open
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV DeleteMedias ANY_DRIVE 0 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+#------------------------------------------------------------------------------------
+#
+# Album video count - videos deleted when another album is open
+#
+#------------------------------------------------------------------------------------
+[Test]
+title Album video count - videos deleted when another album is open
+
+callsub Cleanup
+
+// TESTCASE START
+
+create VCXMyVideosCollectionPluginTest VCXMV
+VCXMV Create
+
+VCXMV OpenCollection VCXCollectionMyVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album1
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CreateAlbum Album2
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumInserted KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel EVcxMyVideosAllVideos
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV CreateVideoFile VcxTestVideoMpeg4 DRIVE_1 "video.mp4" ANY_SIZE 3
+VCXMV CheckMediaCount ANY_DRIVE 3
+
+VCXMV CoolDown
+
+VCXMV AddMediasToAlbum Album1 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV AddMediasToAlbum Album2 ANY_DRIVE 0 3
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageMpxAlbumModified KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV OpenLevel Album2
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened KVCXMYVideosTestMessageListComplete
+waittestclass VCXMV
+
+VCXMV DeleteMedias ANY_DRIVE 0 2 0
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCommandComplete KVCXMYVideosTestMessageDeleteStarted KVCXMYVideosTestMessageDeleteResp KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CoolDown
+
+VCXMV CloseLevel
+VCXMV WaitForMessages 1MINUTE KVCXMYVideosTestMessageCollectionOpened
+waittestclass VCXMV
+
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album1 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+VCXMV CheckMediaDetail ANY_DRIVE Album2 EVcxTestMapping_KVcxMediaMyVideosCategoryItemCount 1
+VCXMV CheckMediaDetail ANY_DRIVE Album2 EVcxTestMapping_KVcxMediaMyVideosCategoryNewItemCount 1
+
+print OK!
+delete VCXMV
+[Endtest]
+
+
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.pkg Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/group/VCXMyVideosCollectionPluginTest.pkg Mon May 03 12:32:50 2010 +0300
@@ -17,10 +17,7 @@
&EN
; Provide value for uid
-#{"VCXMyVideosCollectionPluginTest"},(0x00000000),1,1,0,TYPE=SA
-
-; Series60 product id for S60 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+#{"VCXMyVideosCollectionPluginTest"},(0x00000000),1,0,0,TYPE=SA, RU
; Localised Vendor name
%{"Nokia"}
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTestBlocks.cpp Mon May 03 12:32:50 2010 +0300
@@ -859,7 +859,7 @@
itemIndex = iTester->GetIndexOfMediaWithNameL( itemIndexOrName );
}
- if( itemIndex == KErrNotFound )
+ if( itemIndex == KErrNotFound )
{
User::Leave( KErrArgument );
}
--- a/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTester.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/src/VCXMyVideosCollectionPluginTester.cpp Mon May 03 12:32:50 2010 +0300
@@ -2524,6 +2524,7 @@
TInt realIndex = GetMediaIndexInCollectionL( aDrive, aIndex );
media = (*iCollectionMediaArray)[realIndex];
+
return media;
}
@@ -3107,13 +3108,30 @@
//
void CVCXMyVideosCollectionPluginTester::EnsureMediaFilesAreNotInUseL()
{
- if( iMediaArray->Count() <= 0 ) return;
+ CMPXMediaArray* iSourceMedias;
+
+ if( !iUseCopiedMedias )
+ {
+ if( !iMediaArray )
+ {
+ User::Leave( KErrNotReady );
+ }
+ iSourceMedias = iMediaArray;
+ }
+ else
+ {
+ if( !iMediaArrayCopy )
+ {
+ User::Leave( KErrNotReady );
+ }
+ iSourceMedias = iMediaArrayCopy;
+ }
+
+ if( iSourceMedias->Count() <= 0 ) return;
TInt retries = 200;
RFile64 file;
- TInt error( KErrInUse );
-
- const TInt KEnsureMediasNotInUseID = 1234567;
+ TInt error( KErrNone );
TBool filesLocked( ETrue );
// Check all files that they are not in use, retry few times.
@@ -3121,17 +3139,18 @@
{
filesLocked = EFalse;
- for( TInt i=0; i<iMediaArray->Count(); i++ )
+ for( TInt i=0; i<iSourceMedias->Count(); i++ )
{
- CMPXMedia* media = (*iMediaArray)[i];
+ CMPXMedia* media = (*iSourceMedias)[i];
if( media->IsSupported( KMPXMediaGeneralUri ) )
{
const TDesC& localFilePath = media->ValueText( KMPXMediaGeneralUri );
- error = file.Open( iFs, localFilePath, EFileShareExclusive );
- if( error == KErrInUse || error == KErrLocked )
+ TInt err = file.Open( iFs, localFilePath, EFileShareExclusive );
+ if( err == KErrInUse || err == KErrLocked )
{
+ error = err;
filesLocked = ETrue;
User::After( 1000000 * 5 ); // Wait
break;
@@ -3139,6 +3158,11 @@
file.Close();
}
}
+
+ if(!filesLocked)
+ {
+ error = KErrNone;
+ }
}
if( error != KErrNone && error != KErrNotFound && error != KErrBadName )
--- a/videocollection/tsrc/stubs/inc/hbabstractitemview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbabstractitemview.h Mon May 03 12:32:50 2010 +0300
@@ -22,6 +22,8 @@
#include <QGraphicsWidget>
#include <QItemSelectionModel>
+class HbAbstractViewItem;
+
class HbAbstractItemView : public HbWidget
{
Q_OBJECT
@@ -42,6 +44,8 @@
signals:
void activated(const QModelIndex &index);
+
+ void longPressed(HbAbstractViewItem *item, const QPointF &point);
};
--- a/videocollection/tsrc/stubs/inc/hbaction.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbaction.h Mon May 03 12:32:50 2010 +0300
@@ -26,7 +26,15 @@
#include "hbicon.h"
#include "hbmenu.h"
-class HbAction : public QObject
+class XQServiceUtil
+{
+public:
+ static void toBackground(bool value);
+ static bool isEmbedded();
+ static bool isService();
+};
+
+class HbAction : public QAction
{
Q_OBJECT
@@ -35,7 +43,9 @@
/**
* Constructor
*/
- explicit HbAction(QObject *parent = 0)
+ explicit HbAction(QObject *parent = 0)
+ : QAction(parent),
+ mMenu(0)
{
Q_UNUSED(parent);
initializeCount++;
@@ -45,7 +55,9 @@
/**
* Contructor.
*/
- explicit HbAction(const QString &txt, QObject *parent = 0) : mTxt(txt)
+ explicit HbAction(const QString &txt, QObject *parent = 0)
+ : QAction(txt, parent),
+ mMenu(0)
{
Q_UNUSED(parent);
initializeCount++;
@@ -55,7 +67,9 @@
/**
* Contructor.
*/
- explicit HbAction(Hb::SoftKeyAction actType, QObject *parent = 0) : mTxt("")
+ explicit HbAction(Hb::SoftKeyAction actType, QObject *parent = 0)
+ : QAction(parent),
+ mMenu(0)
{
Q_UNUSED(parent);
Q_UNUSED(actType);
@@ -63,11 +77,14 @@
mTriggeredCount = 0;
}
- explicit HbAction(Hb::NavigationAction action, QObject* parent = 0) : mTxt("")
+ explicit HbAction(Hb::NavigationAction action, QObject* parent = 0)
+ : QAction(parent),
+ mMenu(0)
{
Q_UNUSED(parent);
Q_UNUSED(action);
initializeCount++;
+ mNavAction = action;
mTriggeredCount = 0;
}
@@ -77,78 +94,61 @@
virtual ~HbAction(){initializeCount--;}
/**
- * sets mDisable;
+ * icon
*/
- void setDisabled(bool disable){mDisable = disable;}
-
- /**
- * sets mVisible;
- */
- void setVisible(bool visible){mVisible = visible;}
+ void setIcon(const HbIcon &icon) { mIcon = icon; }
/**
- * not stubbed yet.
+ * icon
*/
- void setIcon(const HbIcon &icon) { Q_UNUSED(icon); }
+ HbIcon icon() const { return mIcon; }
/**
- * not stubbed yet.
+ * menu
*/
- HbIcon icon() const { return HbIcon(); }
+ void setMenu(HbMenu* menu) { mMenu = menu; }
/**
- * not stubbed yet.
+ * menu
*/
- HbMenu *menu() const { return 0; }
+ HbMenu *menu() const { return mMenu; }
/**
* Trigger stub
*/
- void trigger() { mTriggeredCount++; };
+ void trigger()
+ {
+ mTriggeredCount++;
+ QAction::trigger();
+ }
- /**
- * SetText stub
- */
- void setText(QString text) { mText = text; };
-
-signals:
-
- /**
- * dummy triggered
- */
- void triggered();
-
public: // data
/**
- * dummy member
- */
- bool mDisable;
-
- /**
- * dummy member
- */
- bool mVisible;
-
- /**
- * text setted
- */
- QString mTxt;
-
- /**
* counter to make sure alloc dealloc match
*/
static int initializeCount;
/**
+ * Hb navigation action type.
+ */
+ static Hb::NavigationAction mNavAction;
+
+ /**
* Count how many times this was triggered.
*/
int mTriggeredCount;
/**
- * Set text.
+ * icon
*/
- QString mText;
+ HbIcon mIcon;
+
+ /**
+ * menu
+ */
+ HbMenu* mMenu;
+
};
#endif
--- a/videocollection/tsrc/stubs/inc/hbdialog.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbdialog.h Mon May 03 12:32:50 2010 +0300
@@ -67,7 +67,8 @@
public slots:
/**
- * emits finished -signal with mPrimaryAction if execReturnPrimary is true.
+ * emits finished -signal with first action in actions if execReturnPrimary is true,
+ * else second action is returned.
*/
void open( QObject* receiver = 0, const char* member = 0 );
@@ -92,11 +93,6 @@
* sets mContentWidget
*/
void setContentWidget(QGraphicsWidget *contentWidget);
-
- /**
- * sets mPrimaryAction
- */
- void setPrimaryAction(HbAction *action);
/**
* add action into actions -list
@@ -104,21 +100,6 @@
void addAction(HbAction *action);
/**
- * gets mPrimaryAction;
- */
- HbAction* primaryAction();
-
- /**
- * sets mSecondaryAction
- */
- void setSecondaryAction(HbAction *action);
-
- /**
- * gets mSecondaryAction;
- */
- HbAction* secondaryAction();
-
- /**
* sets mMinSize
*/
void setMinimumSize(QSize size);
@@ -127,11 +108,6 @@
* sets mMaxSize
*/
void setMaximumSize(QSize size);
-
- /**
- * returns mPrimaryAction if execReturnPrimary is true.
- */
- HbAction* exec();
/**
* stubbed member
--- a/videocollection/tsrc/stubs/inc/hbdocumentloader.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbdocumentloader.h Mon May 03 12:32:50 2010 +0300
@@ -47,6 +47,8 @@
{
public:
+ static void cleanup();
+
HbDocumentLoader();
HbDocumentLoader(const HbMainWindow *window);
virtual ~HbDocumentLoader();
@@ -74,6 +76,13 @@
static bool mFindWidgetFails;
static bool mFindObjectFails;
static bool mCreateObjectFails;
+
+ static bool mVideoListWidgetFailure;
+ static bool mCollectionWidgetFailure;
+ static bool mCollectionContentWidgetFailure;
+ static bool mLoadFails;
+
+ static QObjectList mLoadReturns;
};
#endif // HBDOCUMENTLOADER_H
--- a/videocollection/tsrc/stubs/inc/hbeffect.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbeffect.h Mon May 03 12:32:50 2010 +0300
@@ -46,58 +46,55 @@
QVariant userData;
};
- static bool start(QGraphicsItem */*item*/,
- const QString &/*itemType*/,
- const QString &/*effectEvent*/,
- QObject */*receiver = 0*/,
- const char */*member = 0*/,
- const QVariant &/*userData = QVariant()*/,
- const QRectF &/*extRect = QRectF()*/)
+ static bool start(QGraphicsItem *item,
+ const QString &itemType,
+ const QString &effectEvent,
+ QObject *receiver = 0,
+ const char *member = 0,
+ const QVariant &userData = QVariant(),
+ const QRectF &extRect = QRectF())
{
- /* HbEffect::EffectStatus status;
- status.item = item;
- status.effectEvent = effectEvent;
- status.userData = userData;
- status.reason = EffectNotStarted;
+ Q_UNUSED(item);
+ Q_UNUSED(itemType);
+ Q_UNUSED(effectEvent);
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ Q_UNUSED(userData);
+ Q_UNUSED(extRect);
- QMetaObject::invokeMethod(
- receiver,
- member,
- Qt::AutoConnection,
- QGenericReturnArgument(),
- Q_ARG(HbEffect::EffectStatus, status));*/
return false;
}
- static bool start(QGraphicsItem */*item*/,
- const QString &/*effectEvent*/,
- QObject */*receiver = 0*/,
- const char */*member = 0*/,
- const QVariant &/*userData = QVariant()*/,
- const QRectF &/*extRect = QRectF()*/)
+ static bool start(QGraphicsItem *item,
+ const QString &effectEvent,
+ QObject *receiver = 0,
+ const char *member = 0,
+ const QVariant &userData = QVariant(),
+ const QRectF &extRect = QRectF())
{
- /* HbEffect::EffectStatus status;
- status.item = item;
- status.effectEvent = effectEvent;
- status.userData = userData;
- status.reason = EffectNotStarted;
+ mLastStartedEffectContainer = item;
+ Q_UNUSED(effectEvent);
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ Q_UNUSED(userData);
+ Q_UNUSED(extRect);
- QMetaObject::invokeMethod(
- receiver,
- member,
- Qt::AutoConnection,
- QGenericReturnArgument(),
- Q_ARG(HbEffect::EffectStatus, status));*/
return false;
}
- static bool start(const QList<QGraphicsItem *> &/*items*/,
- const QString &/*itemType*/,
- const QString &/*effectEvent*/,
- QObject */*receiver = 0*/,
- const char */*member = 0*/,
- const QVariant &/*userData = QVariant()*/)
+ static bool start(const QList<QGraphicsItem *> &items,
+ const QString &itemType,
+ const QString &effectEvent,
+ QObject *receiver = 0,
+ const char *member = 0,
+ const QVariant &userData = QVariant())
{
+ Q_UNUSED(items);
+ Q_UNUSED(itemType);
+ Q_UNUSED(effectEvent);
+ Q_UNUSED(receiver);
+ Q_UNUSED(member);
+ Q_UNUSED(userData);
return false;
}
@@ -124,6 +121,9 @@
static void enable(QGraphicsItem */*item*/) {}
static void disable(QGraphicsItem */*item*/) {}
+
+ static QGraphicsItem* mLastStartedEffectContainer;
+
private:
};
--- a/videocollection/tsrc/stubs/inc/hbgroupbox.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbgroupbox.h Mon May 03 12:32:50 2010 +0300
@@ -25,20 +25,21 @@
Q_OBJECT
public:
- HbGroupBox(QGraphicsItem *parent = 0) : HbWidget(parent) {};
+ HbGroupBox(QGraphicsItem *parent = 0) : HbWidget(parent), mText(QString()) {};
HbGroupBox( const QString &titleText, QGraphicsItem *parent = 0 ) : HbWidget(parent) {
- Q_UNUSED(titleText);
+ mText = titleText;
}
- ~HbGroupBox();
+ ~HbGroupBox() {}
void setHeading(const QString &text) {
- Q_UNUSED(text);
+ mText = text;
}
QString heading() const {
- return QString();
+ return mText;
}
+ QString mText;
};
#endif //HbGroupBox_H
--- a/videocollection/tsrc/stubs/inc/hbinputdialog.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbinputdialog.h Mon May 03 12:32:50 2010 +0300
@@ -30,10 +30,17 @@
HbInputDialog(QGraphicsItem *parent= 0) : HbWidget(parent) {}
~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);
static bool mGetTextFails;
+
+ static QString mGetTextReturnValue;
+
+ static int mGetTextCallCount;
};
#endif //HBINPUT_DIALOG_H
--- a/videocollection/tsrc/stubs/inc/hblistview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hblistview.h Mon May 03 12:32:50 2010 +0300
@@ -18,6 +18,7 @@
#ifndef HBLISTVIEW_H
#define HBLISTVIEW_H
+#include <hbglobal.h>
#include "hbwidget.h"
#include "hblistviewitem.h"
#include "hbscrollbar.h"
@@ -42,7 +43,7 @@
enum ScrollingStyle
{
InvalidScrolling,
- PanOrFlick
+ PanWithFollowOn
};
};
@@ -221,6 +222,14 @@
}
/**
+ * sets mLongPressedPoint
+ */
+ void panGesture (const QPointF &point)
+ {
+ mPanGesturePoint = point;
+ }
+
+ /**
* dummy method
*/
void clearSelection()
@@ -263,6 +272,7 @@
*/
HbAbstractViewItem* itemAtPosition(const QPointF &position)
{
+ Q_UNUSED(position);
return mItem;
}
public:
@@ -325,6 +335,11 @@
static QPointF mLongPressedPoint;
/**
+ * value setted in panGesture
+ */
+ static QPointF mPanGesturePoint;
+
+ /**
* latest value settes in setClampingStyle
*/
static HbScrollArea::ClampingStyle mLatestClamping;
--- a/videocollection/tsrc/stubs/inc/hblistwidget.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hblistwidget.h Mon May 03 12:32:50 2010 +0300
@@ -25,9 +25,9 @@
Q_OBJECT
public:
- HbListWidget(QGraphicsItem *parent = 0) : HbWidget(parent) {};
- virtual ~HbListWidget();
-
+ HbListWidget(QGraphicsItem *parent = 0) : HbWidget(parent) {}
+ virtual ~HbListWidget() {}
+
};
#endif // HBLISTWIDGET_H
--- a/videocollection/tsrc/stubs/inc/hbmainwindow.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbmainwindow.h Mon May 03 12:32:50 2010 +0300
@@ -35,7 +35,9 @@
*/
HbMainWindow(QWidget *parent = 0, Hb::WindowFlags windowFlags = Hb::WindowFlagNone) :
mSoftKeyAction(0),
- mOrientation(Qt::Vertical)
+ mOrientation(Qt::Vertical),
+ mOrientationSet(false),
+ mCurrentView(0)
{
Q_UNUSED(parent);
Q_UNUSED(windowFlags);
@@ -44,7 +46,7 @@
/**
* destructor
*/
- ~HbMainWindow(){};
+ ~HbMainWindow() {};
/**
* dummy
@@ -82,6 +84,8 @@
HbView *currentView() const;
+ void setCurrentView(HbView *view);
+
Qt::Orientation orientation() const
{
return mOrientation;
@@ -91,16 +95,19 @@
{
Q_UNUSED(animate);
mOrientation = orientation;
+ mOrientationSet = true;
}
void unsetOrientation(bool animate = true)
{
Q_UNUSED(animate);
mOrientation = Qt::Vertical;
+ mOrientationSet = false;
}
-
+
signals:
+ void aboutToChangeOrientation();
void orientationChanged(Qt::Orientation orientation);
public:
@@ -119,5 +126,13 @@
* orientation
*/
Qt::Orientation mOrientation;
+
+ /**
+ * orientation set
+ */
+ bool mOrientationSet;
+
+ HbView *mCurrentView;
+
};
#endif
--- a/videocollection/tsrc/stubs/inc/hbmenu.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbmenu.h Mon May 03 12:32:50 2010 +0300
@@ -92,6 +92,9 @@
public:
/** dummy actions */
QMap<QString, HbAction*> mActions;
+
+ /** active action */
+ HbAction* mActiveAction;
};
#endif // HBMENU_H
--- a/videocollection/tsrc/stubs/inc/hbmenudata.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbmenudata.h Mon May 03 12:32:50 2010 +0300
@@ -26,8 +26,7 @@
public: // methods
static void reset()
{
- delete mMenuAction;
- delete mActiveAction;
+ mMenuAction = 0;
mEnabledSetted = false;
mReturnEmptyActionList = false;
mExecPoint = QPointF();
@@ -35,7 +34,6 @@
public: // data
static HbAction *mMenuAction;
- static HbAction *mActiveAction;
static bool mEnabledSetted;
static bool mReturnEmptyActionList;
static QPointF mExecPoint;
--- a/videocollection/tsrc/stubs/inc/hbnamespace.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbnamespace.h Mon May 03 12:32:50 2010 +0300
@@ -206,6 +206,13 @@
ItemType_IndexFeedback,
ItemType_Last = QGraphicsItem::UserType + 20000
};
+
+ enum ApplicationFlag {
+ DefaultApplicationFlags = 0x00,
+ NoSplash = 0x01
+ };
+ Q_DECLARE_FLAGS(ApplicationFlags, ApplicationFlag)
+
/*
enum WidgetAttribute
@@ -324,13 +331,13 @@
/*!
A type definition for text wrapping
*/
-/* enum TextWrapping
+ enum TextWrapping
{
TextNoWrap = 0,
TextWordWrap = 1,
TextWrapAnywhere = 3
};
-
+/*
enum InstantInteraction {
InstantPressed = 0,
InstantReleased,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/hbnotificationdialog.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 hbnotificationdialog
+*
+*/
+
+#ifndef HBNOTIFICATIONDIALOG_H
+#define HBNOTIFICATIONDIALOG_H
+
+
+#include "hbdialog.h"
+#include "hbnamespace.h"
+
+class HbNotificationDialog : public HbDialog
+{
+ Q_OBJECT
+
+
+public:
+
+
+ /**
+ * contructor
+ */
+ HbNotificationDialog(QGraphicsItem *parent=0);
+
+ /**
+ * destructor
+ */
+ ~HbNotificationDialog();
+
+ /**
+ * sets mAttribute
+ */
+ void setAttribute(Qt::WidgetAttribute attr);
+
+ /**
+ * sets mTitle
+ */
+ void setTitle(QString txt);
+
+ /**
+ * sets mTitleTextWRapping
+ */
+ void setTitleTextWrapping(Hb::TextWrapping value);
+
+ /**
+ * method just calls deleteLater to remove object as soon as
+ * event loop gets called
+ */
+ void show();
+
+ static QString mNotifDialogTitle;
+
+ static Hb::TextWrapping mTitleTextWRapping;
+
+ static Qt::WidgetAttribute mAttribute;
+
+};
+
+#endif
--- a/videocollection/tsrc/stubs/inc/hbpushbutton.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbpushbutton.h Mon May 03 12:32:50 2010 +0300
@@ -54,7 +54,9 @@
}
public slots:
- void setText( const QString &text );
+ void setText( const QString &text ) {
+ Q_UNUSED(text);
+ }
public:
QString mText;
--- a/videocollection/tsrc/stubs/inc/hbtoolbar.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbtoolbar.h Mon May 03 12:32:50 2010 +0300
@@ -26,7 +26,7 @@
public:
HbToolBar( QGraphicsItem *parent = 0 ) : HbWidget(parent) {};
- virtual ~HbToolBar();
+ virtual ~HbToolBar() {};
using HbWidget::addAction;
/* HbAction *addAction( const QString &text );
--- a/videocollection/tsrc/stubs/inc/hbview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbview.h Mon May 03 12:32:50 2010 +0300
@@ -20,6 +20,7 @@
#define HBVIEW_H
#include <QGraphicsWidget>
+#include "qstring.h"
#include "hbinstance.h"
#include "hbtoolbar.h"
#include "hbeffect.h"
@@ -28,7 +29,6 @@
{
Q_OBJECT
-
public:
HbView(QGraphicsItem *parent = 0) : QGraphicsWidget(parent), mToolBar(0), mNavigationAction(0)
@@ -45,7 +45,7 @@
void setTitle(const QString &title)
{
- Q_UNUSED(title);
+ mTitle = title;
}
HbToolBar *toolBar() const
@@ -59,7 +59,7 @@
void setItemVisible(Hb::SceneItem item, bool visible)
{
Q_UNUSED(item);
- Q_UNUSED(visible);
+ mSetItemVisibleLast = visible;
}
void setNavigationAction(HbAction *action)
@@ -71,6 +71,12 @@
HbAction *mNavigationAction;
mutable HbToolBar* mToolBar;
+
+ QString mTitle;
+
+public:
+
+ static bool mSetItemVisibleLast;
};
#endif // HBVIEW_H
--- a/videocollection/tsrc/stubs/inc/hbwidget.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/hbwidget.h Mon May 03 12:32:50 2010 +0300
@@ -17,8 +17,10 @@
#ifndef HBWIDGET_H
#define HBWIDGET_H
+
#include <QGraphicsWidget>
#include <hbnamespace.h>
+#include <hbglobal.h>
/**
* counter to make sure alloc dealloc match
@@ -33,7 +35,15 @@
virtual ~HbWidget(){initializeCount--;}
- void clearActions() {}
+ void clearActions()
+ {
+ // Note actions().clear() does not work as actions() returns a copy of the actions list.
+ QList<QAction*> act = actions();
+ QAction* temp;
+ foreach(temp, act) {
+ this->removeAction(temp);
+ }
+ }
static int initializeCount;
};
--- a/videocollection/tsrc/stubs/inc/videocollectionuiloaderdata.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videocollectionuiloaderdata.h Mon May 03 12:32:50 2010 +0300
@@ -19,6 +19,7 @@
#define VIDEOCOLLECTIONUILOADERDATA_H
#include <qstringlist.h>
+#include <qmap.h>
class VideoCollectionUiLoaderData
{
@@ -28,12 +29,16 @@
mFindFailure = false;
mFailDialogLoad = false;
mFindFailureNameList.clear();
+ mMenuActions.clear();
+ mLastLoadPhasedData = -1;
}
public: // data
static bool mFindFailure;
static bool mFailDialogLoad;
static QStringList mFindFailureNameList;
+ static QMap<VideoCollectionUiLoader::ActionIds, HbAction*> mMenuActions;
+ static int mLastLoadPhasedData;
};
#endif /* VIDEOCOLLECTIONUILOADERDATA_H */
--- a/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videocollectionviewutilsdata.h Mon May 03 12:32:50 2010 +0300
@@ -29,8 +29,10 @@
mLastError = 0;
mLoadSortingValuesFails = false;
mGetServiceIconStringsFails = false;
- mSortRole = 0;
- mSortOrder = Qt::AscendingOrder;
+ mVideoSortRole = -1;
+ mCollectionSortRole = -1;
+ mVideoSortOrder = Qt::AscendingOrder;
+ mCollectionSortOrder = Qt::AscendingOrder;
mIconString = "";
mPressedString = "";
mLastStatusAdditional = QVariant();
@@ -40,8 +42,10 @@
static int mLastError;
static bool mLoadSortingValuesFails;
static bool mGetServiceIconStringsFails;
- static int mSortRole;
- static Qt::SortOrder mSortOrder;
+ static int mVideoSortRole;
+ static int mCollectionSortRole;
+ static Qt::SortOrder mVideoSortOrder;
+ static Qt::SortOrder mCollectionSortOrder;
static QString mIconString;
static QString mPressedString;
static QVariant mLastStatusAdditional;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videohintwidgetdata.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub data for video hint widget
+*
+*/
+
+#ifndef VIDEOHINTWIDGETDATA_H
+#define VIDEOHINTWIDGETDATA_H
+
+
+class VideoHintWidgetData
+{
+public: // methods
+ static void reset()
+ {
+ mSettedHintLevel = -1;
+ mSettedButtonShowLevel = false;
+ }
+
+public: // data
+ static int mSettedHintLevel;
+ static bool mSettedButtonShowLevel;
+
+};
+
+#endif /* VIDEOHINTWIDGETDATA_H */
--- a/videocollection/tsrc/stubs/inc/videolistdatamodeldata.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videolistdatamodeldata.h Mon May 03 12:32:50 2010 +0300
@@ -29,6 +29,7 @@
mLastIndex = QModelIndex();
mDataAccessCount = 0;
mRowCount = 0;
+ mRowCountDecrement = 0;
}
static QModelIndex lastIndex()
@@ -60,6 +61,7 @@
static QModelIndex mLastIndex;
static int mDataAccessCount;
static int mRowCount;
+ static int mRowCountDecrement;
};
#endif /* VIDEOLISTDATAMODELDATA_H */
--- a/videocollection/tsrc/stubs/inc/videolistviewdata.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videolistviewdata.h Mon May 03 12:32:50 2010 +0300
@@ -18,6 +18,9 @@
#ifndef VIDEOLISTVIEWDATA_H
#define VIDEOLISTVIEWDATA_H
+#include <e32std.h>
+#include <mpxitemid.h>
+
class VideoListViewData
{
public: // methods
@@ -27,6 +30,7 @@
mActivateViewCount = 0;
mDeactivateViewCount = 0;
mBackCount = 0;
+ mActivatedItemId = TMPXItemId::InvalidId();
}
public: // data
@@ -34,6 +38,7 @@
static int mActivateViewCount;
static int mDeactivateViewCount;
static int mBackCount;
+ static TMPXItemId mActivatedItemId;
};
#endif /* VIDEOLISTVIEWDATA_H */
--- a/videocollection/tsrc/stubs/inc/videoplayerappexport.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videoplayerappexport.h Mon May 03 12:32:50 2010 +0300
@@ -20,6 +20,7 @@
#define VIDEOPLAYERAPP_DLL_EXPORT
+
#endif // _VIDEOPLAYERAPPEXPORT_H
// End of file.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoservicebrowsedata.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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 videoservicebrowse
+*
+*/
+
+#ifndef VIDEOSERVICEBROWSEDATA_H
+#define VIDEOSERVICEBROWSEDATA_H
+
+class VideoServiceBrowseData
+{
+public: // methods
+ static void reset()
+ {
+ mBrowseCategory = 0;
+ }
+
+public: // data
+ static int mBrowseCategory;
+};
+
+#endif /* VIDEOSERVICEBROWSEDATA_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/inc/videoservices.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VideoServices class definition
+*
+*/
+
+#ifndef __VIDEOSERVICES_H__
+#define __VIDEOSERVICES_H__
+
+/**
+ *
+ * We need stub for this because it has static data and HW compilation of moc file fails because of that.
+ *
+ */
+
+#include <QStringList>
+
+//FORWARD CLASS DECLARATION
+class VideoServiceUriFetch;
+class VideoServicePlay;
+class VideoServiceView;
+class VideoServiceBrowse;
+class QVideoPlayerEngine;
+
+class VideoServices : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * Returns singleton instance for this class.
+ *
+ * WARNING! Not safe to call this from destructor of another function scope static object!
+ *
+ * @return The singleton instance.
+ */
+ static VideoServices *instance(QVideoPlayerEngine* engine = 0);
+
+ /**
+ * Decreases the reference count, when count reaches zero cleanup is done.
+ *
+ */
+ void decreaseReferenceCount();
+
+ /**
+ * Returns the context title set by service requestee
+ *
+ * @return QString the title
+ *
+ */
+ QString contextTitle() const;
+
+ /*
+ * Enum reflecting the services provided
+ */
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView,
+ EBrowse
+ };
+
+ /**
+ * Returns service active status
+ *
+ * @return bool true if active, false if not active
+ *
+ */
+ VideoServices::TVideoService currentService();
+
+ /**
+ * Returns browsing category.
+ *
+ * @return see vcxmyvideosdef.h for default categories.
+ */
+ int getBrowseCategory() const;
+
+public slots:
+ void itemSelected(const QString& item);
+ void browsingEnded();
+
+signals:
+ /*
+ * Emitted when service user has set the title
+ */
+ void titleReady(const QString& title);
+
+ /*
+ * Emitted to acticate requested plugin
+ */
+ void activated(int command);
+
+private:
+
+ /**
+ * Constructor
+ */
+ VideoServices();
+
+ /**
+ * Constructor
+ */
+ VideoServices(QVideoPlayerEngine* engine);
+
+ /**
+ * Destructor.
+ */
+ virtual ~VideoServices();
+
+ void setEngine(QVideoPlayerEngine* engine);
+
+ /**
+ * Sets the active service
+ *
+ * @param service
+ *
+ */
+ void setCurrentService(VideoServices::TVideoService service);
+
+ /**
+ * Returns the current engine
+ *
+ * @return engine
+ *
+ */
+ QVideoPlayerEngine* engine();
+
+ Q_DISABLE_COPY(VideoServices)
+
+private:
+
+ /**
+ * Reference count.
+ */
+ int mReferenceCount;
+
+ /**
+ * VideoServiceUriFetch service instance.
+ */
+ VideoServiceUriFetch* mServiceUriFetch;
+
+ /**
+ * VideoServicePlay service instance.
+ */
+ VideoServicePlay* mServicePlay;
+
+ /**
+ * VideoServiceView service instance.
+ */
+ VideoServiceView* mServiceView;
+
+ /**
+ * VideoServiceBrowse service instance.
+ */
+ VideoServiceBrowse *mServiceBrowse;
+
+ /**
+ * Pointer of QVideoPlayerEngine.
+ */
+ QVideoPlayerEngine* mEngine;
+
+ /*
+ * Current service
+ */
+ VideoServices::TVideoService mCurrentService;
+
+ friend class VideoServiceUriFetch;
+
+ friend class VideoServicePlay;
+
+ friend class VideoServiceView;
+
+ friend class VideoServiceBrowse;
+ };
+
+#endif //__VIDEOSERVICES_H__
--- a/videocollection/tsrc/stubs/inc/videosortfilterproxymodeldata.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/videosortfilterproxymodeldata.h Mon May 03 12:32:50 2010 +0300
@@ -19,6 +19,7 @@
#define VIDEOSORTFILTERPROXYMODELDATA_H
#include <qnamespace.h>
+#include <qstring.h>
class VideoSortFilterProxyModelData
{
@@ -26,7 +27,7 @@
static void reset()
{
mOpenFails = false;
- mSortRole = 0;
+ mSortRole = -1;
mSortOrder = Qt::AscendingOrder;
mSortAsync = false;
mDeleteItemsFails = true;
@@ -42,6 +43,9 @@
mGenericFilterId = TMPXItemId::InvalidId();
mGenericFilterValue = false;
mNewAlbumId = TMPXItemId::InvalidId();
+ mLastAlbumNameInRename = "";
+ mRenameAlbumReturnValue= 0;
+ mLastAddedAlbumName = "";
}
public: // data
@@ -62,6 +66,9 @@
static TMPXItemId mGenericFilterId;
static bool mGenericFilterValue;
static TMPXItemId mNewAlbumId;
+ static QString mLastAlbumNameInRename;
+ static int mRenameAlbumReturnValue;
+ static QString mLastAddedAlbumName;
};
#endif /* VIDEOSORTFILTERPROXYMODEL_H */
--- a/videocollection/tsrc/stubs/inc/xqserviceutil.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/**
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef XQSERVICEUTIL_H
-#define XQSERVICEUTIL_H
-
-#include <QObject>
-#include <stub/inc/xqserviceutilxtra.h>
-
-class XQServiceUtilXtra;
-
-namespace XQServiceUtil
-{
- static void toBackground(bool value){};
- static bool isEmbedded(){return false;};
- static bool isService()
- {
- bool service;
- XQServiceUtilXtra* ptr = XQServiceUtilXtra::instance();
- service = ptr->currentService();
- ptr->decreaseReferenceCount();
- return service;
- };
-}
-
-
-
-#endif
--- a/videocollection/tsrc/stubs/inc/xqserviceutilxtra.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/inc/xqserviceutilxtra.h Mon May 03 12:32:50 2010 +0300
@@ -20,8 +20,6 @@
#include <QObject>
-class XQServiceUtilXtra;
-
class XQServiceUtilXtra : public QObject
{
Q_OBJECT
@@ -44,7 +42,6 @@
virtual ~XQServiceUtilXtra();
-
Q_DISABLE_COPY(XQServiceUtilXtra)
public:
@@ -55,6 +52,5 @@
static int mReferenceCount;
static bool service;
-
};
#endif
--- a/videocollection/tsrc/stubs/src/hbaction.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbaction.cpp Mon May 03 12:32:50 2010 +0300
@@ -18,5 +18,5 @@
#include "hbaction.h"
int HbAction::initializeCount = 0;
+Hb::NavigationAction HbAction::mNavAction = Hb::QuitNaviAction;
-
--- a/videocollection/tsrc/stubs/src/hbcheckbox.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: stub hbcheckbox for testing video list selection dialog
-*
-*/
-
-#ifndef HBCHECKBOX_H
-#define HBCHECKBOX_H
-
-#include "hbwidget.h"
-#include <QGraphicsLayout>
-#include <QGraphicsWidget>
-#include <QString>
-
-class HbCheckBox : public HbWidget
-{
- Q_OBJECT
-
-public:
-
- /**
- * Contructor.
- */
- HbCheckBox(QGraphicsItem *parent = 0) : HbWidget(parent){initializeCount++;}
-
- /**
- * Destructor.
- */
- virtual ~HbCheckBox(){initializeCount--;}
-
- /**
- * sets mChecked
- */
- void setChecked(bool check){mChecked = check;}
-
- /**
- * counter to make sure alloc dealloc match
- */
- static int initializeCount;
-
- /**
- * dummy value setted in setchecked
- */
- bool mChecked;
-
-signals:
- /**
- * state changed -signal
- */
- void stateChanged(int);
-
-};
-
-#endif
--- a/videocollection/tsrc/stubs/src/hbdeviceprofile.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: stub hbdeviceprofile for testing video collection ui uitils
-*
-*/
-
-#ifndef HBDEVICEPROFILE_H
-#define HBDEVICEPROFILE_H
-
-#include <QSize>
-
-
-
-class HbDeviceProfile
-{
-public:
-
- /**
- * contructor
- */
- HbDeviceProfile(){mSize.setHeight(100); mSize.setWidth(100);}
-
- /**
- * destructor
- */
- ~HbDeviceProfile(){};
-
- /**
- * returns static object reference from this class
- */
- static HbDeviceProfile& current(){ static HbDeviceProfile _profile; return _profile; }
-
- /**
- * sets mSize
- */
- void setLogicalSize(QSize size){
- mSize.setHeight(size.height());
- mSize.setWidth(size.width());
- }
-
- /**
- * gets mSize
- */
- QSize logicalSize() const{return mSize;}
-
- QSize mSize;
-
-};
-
-#endif
--- a/videocollection/tsrc/stubs/src/hbdialog.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbdialog.cpp Mon May 03 12:32:50 2010 +0300
@@ -18,7 +18,7 @@
#include "hbaction.h"
#include "hblabel.h"
-#include "HbDialog.h"
+#include "hbdialog.h"
HbDialog *HbDialog::currentInstance = 0;
bool HbDialog::execReturnPrimary = true;
@@ -29,8 +29,6 @@
HbWidget(parent),
mHeadingWidget(0),
mContentWidget(0),
-mPrimaryAction(0),
-mSecondaryAction(0),
mTimeout(NoTimeout),
mDismissPolicy(NoDismiss)
@@ -45,8 +43,6 @@
HbDialog::~HbDialog()
{
delete mHeadingWidget;
- delete mPrimaryAction;
- delete mSecondaryAction;
delete mContentWidget;
currentInstance = 0;
mActions.clear();
@@ -60,11 +56,21 @@
}
if(execReturnPrimary)
{
- emit finished(mPrimaryAction);
+ HbAction *action = 0;
+ if(mActions.count() >= 1)
+ {
+ action = mActions[0];
+ }
+ emit finished(action);
}
else
{
- emit finished(mSecondaryAction);
+ HbAction *action = 0;
+ if(mActions.count() >= 2)
+ {
+ action = mActions[1];
+ }
+ emit finished(action);
}
if(receiver && member)
{
@@ -81,7 +87,7 @@
{
mTimeout = timeout;
}
-
+
void HbDialog::setHeadingWidget(QGraphicsWidget *headingWidget)
{
mHeadingWidget = headingWidget;
@@ -92,39 +98,11 @@
mContentWidget = contentWidget;
}
-void HbDialog::setPrimaryAction(HbAction *action)
-{
- mPrimaryAction = action;
-}
-
-HbAction* HbDialog::primaryAction()
-{
- if(primaryReturnNull)
- {
- return 0;
- }
- return mPrimaryAction;
-}
-
-void HbDialog::setSecondaryAction(HbAction *action)
-{
- mSecondaryAction = action;
-}
-
-HbAction* HbDialog::secondaryAction()
-{
- if(secondaryReturnNull)
- {
- return 0;
- }
- return mSecondaryAction;
-}
-
void HbDialog::addAction(HbAction *action)
{
mActions.append(action);
}
-
+
void HbDialog::setMinimumSize(QSize size)
{
mMinSize.setHeight(size.height());
@@ -136,12 +114,3 @@
mMaxSize.setHeight(size.height());
mMaxSize.setWidth(size.width());
}
-
-HbAction* HbDialog::exec()
-{
- if(execReturnPrimary)
- {
- return mPrimaryAction;
- }
- return mSecondaryAction;
-}
--- a/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -25,11 +25,33 @@
#include "hbcheckbox.h"
#include "hbpushbutton.h"
#include "hblabel.h"
+#include "hbgroupbox.h"
#include "videocollectionuiloader.h"
+#include "videocollectionuiloaderdef.h"
+#include "videolistwidget.h"
+#include "videolistview.h"
+#include "videohintwidget.h"
+#include "videolistselectiondialog.h"
bool HbDocumentLoader::mFindWidgetFails = false;
bool HbDocumentLoader::mFindObjectFails = false;
bool HbDocumentLoader::mCreateObjectFails = false;
+bool HbDocumentLoader::mVideoListWidgetFailure = false;
+bool HbDocumentLoader::mCollectionWidgetFailure = false;
+bool HbDocumentLoader::mCollectionContentWidgetFailure = false;
+bool HbDocumentLoader::mLoadFails = false;
+QObjectList HbDocumentLoader::mLoadReturns;
+
+void HbDocumentLoader::cleanup() {
+ mFindWidgetFails = false;
+ mFindObjectFails = false;
+ mCreateObjectFails = false;
+ mVideoListWidgetFailure = false;
+ mCollectionWidgetFailure = false;
+ mCollectionContentWidgetFailure = false;
+ mLoadFails = false;
+ mLoadReturns.clear();
+}
HbDocumentLoader::HbDocumentLoader() : mCreatingObject(false)
{
@@ -44,6 +66,7 @@
HbDocumentLoader::~HbDocumentLoader()
{
+ cleanup();
reset();
}
@@ -53,9 +76,12 @@
Q_UNUSED(section);
*ok = true;
+ if(mLoadFails)
+ {
+ *ok = false;
+ }
- QObjectList objs;
- return objs;
+ return mLoadReturns;
}
QObjectList HbDocumentLoader::load( const QString &fileName, bool *ok)
@@ -64,9 +90,12 @@
Q_UNUSED(ok);
*ok = true;
+ if(mLoadFails)
+ {
+ *ok = false;
+ }
- QObjectList objs;
- return objs;
+ return mLoadReturns;
}
QGraphicsWidget *HbDocumentLoader::findWidget(const QString &name)
@@ -76,6 +105,21 @@
return 0;
}
+ if(mVideoListWidgetFailure && name == DOCML_NAME_VC_VIDEOLISTWIDGET)
+ {
+ return 0;
+ }
+
+ if(mCollectionWidgetFailure && name == DOCML_NAME_VC_COLLECTIONWIDGET)
+ {
+ return 0;
+ }
+
+ if(mCollectionContentWidgetFailure && name == DOCML_NAME_VC_COLLECTIONCONTENTWIDGET)
+ {
+ return 0;
+ }
+
QObject *obj = 0;
for(int i = 0; i < mObjects.count(); i++)
@@ -91,6 +135,10 @@
{
mCreatingObject = true;
obj = createObject(QString(), name);
+ if(obj)
+ {
+ mObjects.append(new ObjectData(obj, name));
+ }
mCreatingObject = false;
}
@@ -123,7 +171,10 @@
{
mCreatingObject = true;
obj = createObject(QString(), name);
- mObjects.append(new ObjectData(obj, name));
+ if(obj)
+ {
+ mObjects.append(new ObjectData(obj, name));
+ }
mCreatingObject = false;
}
@@ -151,18 +202,6 @@
return 0;
}
- if(name == DOCML_NAME_OPTIONS_MENU ||
- name == DOCML_NAME_SORT_MENU)
- {
- obj = new HbMenu();
- mObjects.append(new ObjectData(obj, name));
- }
-
- if(obj)
- {
- return obj;
- }
-
obj = doCreateObject(name);
return obj;
}
@@ -172,67 +211,63 @@
QObject *obj = 0;
if(name == DOCML_NAME_VIEW)
{
-
+ obj = new VideoListView(0, 0);
}
else if(name == DOCML_NAME_VC_HEADINGBANNER)
{
-
+ obj = new HbGroupBox();
}
else if(name == DOCML_NAME_VC_COLLECTIONWIDGET)
{
-
+ obj = new VideoListWidget(0, 0);
}
else if(name == DOCML_NAME_VC_COLLECTIONCONTENTWIDGET)
{
-
+ obj = new VideoListWidget(0, 0);
}
else if(name == DOCML_NAME_VC_VIDEOLISTWIDGET)
{
-
+ obj = new VideoListWidget(0, 0);
}
else if(name == DOCML_NAME_VC_VIDEOHINTWIDGET)
{
-
+ obj = new VideoHintWidget(0, 0);
}
else if(name == DOCML_NAME_OPTIONS_MENU)
{
-
+ obj = new HbMenu();
}
else if(name == DOCML_NAME_SORT_MENU)
{
-
+ obj = new HbMenu();
}
else if(name == DOCML_NAME_SORT_BY_DATE)
{
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_SORT_BY_NAME)
{
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS)
{
-
- }
- else if(name == DOCML_NAME_SORT_BY_RATING)
- {
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_SORT_BY_SIZE)
{
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_ADD_TO_COLLECTION)
{
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_CREATE_COLLECTION)
{
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_DELETE_MULTIPLE)
{
-
+ obj = new HbAction();
}
else if(name == DOCML_NAME_HINT_BUTTON)
{
@@ -248,11 +283,11 @@
}
else if(name == DOCML_VIDEOSELECTIONDIALOG_FILE)
{
-
+ obj = new VideoListSelectionDialog(0, 0);
}
else if(name == DOCML_NAME_DIALOG)
{
-
+ obj = new VideoListSelectionDialog(0, 0);
}
else if(name == DOCML_NAME_DLG_HEADINGLBL)
{
@@ -274,11 +309,5 @@
{
obj = new HbStackedWidget();
}
-
- if(obj)
- {
- mObjects.append(new ObjectData(obj, name));
- }
return obj;
}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/hbeffect.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub hbeffect
+*
+*/
+
+#include "hbeffect.h"
+
+QGraphicsItem* HbEffect::mLastStartedEffectContainer = 0;
+
+
--- a/videocollection/tsrc/stubs/src/hbinputdialog.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbinputdialog.cpp Mon May 03 12:32:50 2010 +0300
@@ -18,6 +18,8 @@
#include "hbinputdialog.h"
bool HbInputDialog::mGetTextFails = false;
+QString HbInputDialog::mGetTextReturnValue = QString();
+int HbInputDialog::mGetTextCallCount = 0;
QString HbInputDialog::getText(const QString &label,const QString &text,
@@ -26,7 +28,16 @@
Q_UNUSED(label);
Q_UNUSED(scene);
Q_UNUSED(parent);
- QString textReturn = text;
+ mGetTextCallCount++;
+ QString textReturn;
+ if(HbInputDialog::mGetTextReturnValue.isNull())
+ {
+ textReturn = text;
+ }
+ else
+ {
+ textReturn = mGetTextReturnValue;
+ }
if(mGetTextFails)
{
*ok = false;
--- a/videocollection/tsrc/stubs/src/hblistview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hblistview.cpp Mon May 03 12:32:50 2010 +0300
@@ -25,6 +25,7 @@
bool HbListView::mVScrollBarIsNull = false;
bool HbListView::mLatestrecycling = false;
QPointF HbListView::mLongPressedPoint = QPointF();
+QPointF HbListView::mPanGesturePoint = QPointF();
HbScrollArea::ClampingStyle HbListView::mLatestClamping = HbScrollArea::InvalidClamping;
HbScrollArea::ScrollingStyle HbListView::mLatestScrolling = HbScrollArea::InvalidScrolling;
bool HbListView::mLatestFrictionEnabled = false;
--- a/videocollection/tsrc/stubs/src/hbmainwindow.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbmainwindow.cpp Mon May 03 12:32:50 2010 +0300
@@ -56,3 +56,15 @@
}
return 0;
}
+
+void HbMainWindow::setCurrentView(HbView *view)
+{
+ for(int i = 0; i < mViews.count(); i++)
+ {
+ if(mViews[i] == view)
+ {
+ mViews.takeAt(i);
+ }
+ }
+ mViews.prepend(view);
+}
--- a/videocollection/tsrc/stubs/src/hbmenu.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/hbmenu.cpp Mon May 03 12:32:50 2010 +0300
@@ -19,7 +19,6 @@
#include "hbmenudata.h"
HbAction *HbMenuData::mMenuAction = 0;
-HbAction *HbMenuData::mActiveAction = 0;
bool HbMenuData::mEnabledSetted = false;
bool HbMenuData::mReturnEmptyActionList = false;
QPointF HbMenuData::mExecPoint = QPointF();
@@ -59,17 +58,12 @@
HbAction* HbMenu::activeAction()
{
- return HbMenuData::mActiveAction;
+ return mActiveAction;
}
void HbMenu::setActiveAction(HbAction *action)
{
- if (HbMenuData::mActiveAction)
- {
- delete HbMenuData::mActiveAction;
- HbMenuData::mActiveAction = 0;
- }
- HbMenuData::mActiveAction = action;
+ mActiveAction = action;
}
void HbMenu::setEnabled(bool enabled)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/hbnotificationdialog.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HbNotificationDialog
+*
+*/
+
+#include "hbnotificationdialog.h"
+
+
+QString HbNotificationDialog::mNotifDialogTitle = "";
+
+Hb::TextWrapping HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
+
+Qt::WidgetAttribute HbNotificationDialog::mAttribute = Qt::WA_Disabled;
+
+HbNotificationDialog::HbNotificationDialog(QGraphicsItem *parent) :
+HbDialog(parent)
+{
+
+}
+
+HbNotificationDialog::~HbNotificationDialog()
+{
+
+}
+
+void HbNotificationDialog::setAttribute(Qt::WidgetAttribute attr)
+{
+ mAttribute = attr;
+}
+
+void HbNotificationDialog::setTitle(QString txt)
+{
+ mNotifDialogTitle = txt;
+}
+
+void HbNotificationDialog::setTitleTextWrapping(Hb::TextWrapping value)
+{
+ mTitleTextWRapping = value;
+}
+
+void HbNotificationDialog::show()
+{
+ deleteLater();
+}
+
+
--- a/videocollection/tsrc/stubs/src/hbstackedwidget.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: stub HbStackedWidget for testing video list selection dialog
-*
-*/
-
-#ifndef HBSTACKEDWIDGET
-#define HBSTACKEDWIDGET
-
-#include <qpointer.h>
-#include <QGraphicsWidget>
-#include "hbwidget.h"
-
-class HbStackedWidget : public HbWidget
-{
- Q_OBJECT
-public:
- /**
- * constructor
- */
- HbStackedWidget(QGraphicsItem *parent = 0) : HbWidget(parent), mCurrentWidget(0){initializeCount++;}
-
- /**
- * destructor
- */
- ~HbStackedWidget(){initializeCount--; delete mCurrentWidget;}
-
- /**
- * dummey member
- */
- int addWidget(QObject *widget){mCurrentWidget = widget; return 0;}
-
- /**
- * dummy member
- */
- QObject* currentWidget(){ return mCurrentWidget;}
-
- /**
- * dummy member
- */
- QObject *removeAt(int index){Q_UNUSED(index); QObject *tmp = mCurrentWidget; mCurrentWidget = 0; return tmp;}
-
- /**
- * counter to make sure alloc dealloc match
- */
- static int initializeCount;
-
- QPointer<QObject> mCurrentWidget;
-};
-
-#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/hbview.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,20 @@
+/*
+* 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: stub hbview
+*
+*/
+
+#include "hbview.h"
+
+bool HbView::mSetItemVisibleLast = false;
--- a/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionuiloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -21,21 +21,27 @@
#include <hblistview.h>
#include <hbmenu.h>
+#include "videocollectioncommon.h"
#include "videocollectionuiloader.h"
+#include "videocollectionuiloaderdef.h"
#include "videolistview.h"
#include "videolistwidget.h"
#include "videohintwidget.h"
#include "videolistselectiondialog.h"
+#include "videocollectionwrapper.h"
#include "videocollectionuiloaderdata.h"
bool VideoCollectionUiLoaderData::mFindFailure = false;
bool VideoCollectionUiLoaderData::mFailDialogLoad = false;
QStringList VideoCollectionUiLoaderData::mFindFailureNameList;
+QMap<VideoCollectionUiLoader::ActionIds, HbAction*> VideoCollectionUiLoaderData::mMenuActions;
+int VideoCollectionUiLoaderData::mLastLoadPhasedData = -1;
VideoCollectionUiLoader::VideoCollectionUiLoader():
HbDocumentLoader(),
- mTimerId(0)
+ mTimerId(0),
+ mIsService(0)
{
// not stubbed
}
@@ -45,22 +51,50 @@
VideoCollectionUiLoaderData::reset();
}
-void VideoCollectionUiLoader::startLoading(QSet<QString> uiSections,
+void VideoCollectionUiLoader::loadPhase(int loadPhase)
+{
+ VideoCollectionUiLoaderData::mLastLoadPhasedData = loadPhase;
+}
+
+void VideoCollectionUiLoader::addData(QList<VideoCollectionUiLoaderParam> params,
QObject *receiver,
- const char *widgetSlot,
- const char *objectSlot)
+ const char *slot)
{
- Q_UNUSED(uiSections);
+ Q_UNUSED(params);
Q_UNUSED(receiver);
- Q_UNUSED(widgetSlot);
- Q_UNUSED(objectSlot);
- // not stubbed
+ Q_UNUSED(slot);
+}
+
+void VideoCollectionUiLoader::removeOrphanFromList(QObject *object)
+{
+ if (mOrphans.contains(object))
+ {
+ mOrphans.removeOne(object);
+ }
+
+ const QString &name = mObjects.key(object);
+ if (!name.isEmpty())
+ {
+ // found from list, remove
+ mObjects.remove(name);
+ }
}
void VideoCollectionUiLoader::setIsService(bool isService)
{
- Q_UNUSED(isService);
- // not stubbed
+ mIsService = isService;
+}
+
+void VideoCollectionUiLoader::load(const QString &fileName, bool *ok)
+{
+ QObjectList list = HbDocumentLoader::load(fileName, ok);
+ storeOrphans(list);
+}
+
+void VideoCollectionUiLoader::load(const QString &fileName, const QString §ion , bool *ok)
+{
+ QObjectList list = HbDocumentLoader::load(fileName, section, ok);
+ storeOrphans(list);
}
QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name)
@@ -91,26 +125,69 @@
return object;
}
-void VideoCollectionUiLoader::addToQueue(Params ¶ms)
-{
- Q_UNUSED(params);
- // not stubbed
-}
-
-void VideoCollectionUiLoader::initWidget(QGraphicsWidget *widget,
- const QString &name)
-{
- Q_UNUSED(widget);
- Q_UNUSED(name);
- // not stubbed
-}
-
void VideoCollectionUiLoader::initObject(QObject *object,
const QString &name)
{
- Q_UNUSED(object);
- Q_UNUSED(name);
- // not stubbed
+ VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
+
+ if (name == DOCML_NAME_VC_VIDEOLISTWIDGET ||
+ name == DOCML_NAME_VC_COLLECTIONWIDGET ||
+ name == DOCML_NAME_VC_COLLECTIONCONTENTWIDGET)
+ {
+ VideoCollectionCommon::TModelType type = VideoCollectionCommon::EModelTypeAllVideos;
+ if(name == DOCML_NAME_VC_COLLECTIONWIDGET) {
+ type = VideoCollectionCommon::EModelTypeCollections;
+ } else if (name == DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) {
+ type = VideoCollectionCommon::EModelTypeCollectionContent;
+ }
+ VideoListWidget *videoList = qobject_cast<VideoListWidget*>(object);
+ VideoSortFilterProxyModel *model = wrapper.getModel(type);
+ videoList->initialize(*model, 0);
+ }
+ else if (name == DOCML_NAME_DIALOG)
+ {
+
+ }
+ else if (name == DOCML_NAME_VC_VIDEOHINTWIDGET)
+ {
+
+ }
+ else if (name == DOCML_NAME_OPTIONS_MENU)
+ {
+
+ }
+ else if (name == DOCML_NAME_SORT_MENU)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionSortBy] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_ADD_TO_COLLECTION)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionAddToCollection] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_CREATE_COLLECTION)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionNewCollection] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_DELETE_MULTIPLE)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionDelete] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_SORT_BY_DATE)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionSortByDate] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_SORT_BY_NAME)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionSortByName] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EACtionSortByItemCount] = qobject_cast<HbAction*>(object);
+ }
+ else if(name == DOCML_NAME_SORT_BY_SIZE)
+ {
+ VideoCollectionUiLoaderData::mMenuActions[EActionSortBySize] = qobject_cast<HbAction*>(object);
+ }
}
void VideoCollectionUiLoader::timerEvent(QTimerEvent *event)
@@ -134,6 +211,7 @@
name == DOCML_NAME_VC_VIDEOLISTWIDGET)
{
object = new VideoListWidget(this);
+ initObject(qobject_cast<QGraphicsWidget*>(object), name);
}
else if (name == DOCML_NAME_DIALOG)
{
@@ -153,11 +231,10 @@
if (object)
{
object->setObjectName(name);
-
-
return object;
}
object = HbDocumentLoader::createObject(type, name);
+ initObject(object, name);
}
return object;
@@ -168,9 +245,32 @@
// not stubbed
}
-bool VideoCollectionUiLoader::isValid(const Params ¶ms)
+bool VideoCollectionUiLoader::isValid(const VideoCollectionUiLoaderParam ¶m)
{
- Q_UNUSED(params);
+ Q_UNUSED(param);
// not stubbed
return true;
}
+
+// ---------------------------------------------------------------------------
+// storeOrphans
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionUiLoader::storeOrphans(const QObjectList &list)
+{
+ foreach (QObject *object, list)
+ {
+ if (!mOrphans.contains(object))
+ {
+ // add to list
+ mOrphans.append(object);
+
+ // connect to "destroyed" signal
+ connect(
+ object, SIGNAL(destroyed(QObject*)),
+ this, SLOT(removeOrphanFromList(QObject*)));
+ }
+ }
+}
+
+// end of file
--- a/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionviewutils.cpp Mon May 03 12:32:50 2010 +0300
@@ -21,8 +21,10 @@
int VideoCollectionViewUtilsData::mLastError = 0;
bool VideoCollectionViewUtilsData::mLoadSortingValuesFails = false;
bool VideoCollectionViewUtilsData::mGetServiceIconStringsFails = false;
-int VideoCollectionViewUtilsData::mSortRole = 0;
-Qt::SortOrder VideoCollectionViewUtilsData::mSortOrder = Qt::AscendingOrder;
+int VideoCollectionViewUtilsData::mVideoSortRole = -1;
+int VideoCollectionViewUtilsData::mCollectionSortRole = -1;
+Qt::SortOrder VideoCollectionViewUtilsData::mVideoSortOrder = Qt::AscendingOrder;
+Qt::SortOrder VideoCollectionViewUtilsData::mCollectionSortOrder = Qt::AscendingOrder;
QString VideoCollectionViewUtilsData::mIconString = "";
QString VideoCollectionViewUtilsData::mPressedString = "";
QVariant VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant();
@@ -34,8 +36,10 @@
}
VideoCollectionViewUtils::VideoCollectionViewUtils():
- mSortRole(-1),
- mSortOrder(Qt::AscendingOrder)
+mVideosSortRole(-1),
+mCollectionsSortRole(-1),
+mVideosSortOrder(Qt::AscendingOrder),
+mCollectionsSortOrder(Qt::AscendingOrder)
{
// not stubbed
}
@@ -45,23 +49,52 @@
VideoCollectionViewUtilsData::reset();
}
-int VideoCollectionViewUtils::saveSortingValues(int role, Qt::SortOrder order)
+int VideoCollectionViewUtils::saveSortingValues(int role, Qt::SortOrder order, VideoCollectionCommon::TCollectionLevels target)
{
- VideoCollectionViewUtilsData::mSortRole = role;
- VideoCollectionViewUtilsData::mSortOrder = order;
- return 0;
+ int status(0);
+ if(target == VideoCollectionCommon::ELevelCategory )
+ {
+ VideoCollectionViewUtilsData::mCollectionSortRole = role;
+ mCollectionsSortRole = role;
+ VideoCollectionViewUtilsData::mCollectionSortOrder = order;
+ mCollectionsSortOrder = order;
+ }
+ else if(target > VideoCollectionCommon::ELevelCategory &&
+ target <= VideoCollectionCommon::ELevelAlbum)
+ {
+ VideoCollectionViewUtilsData::mVideoSortRole = role;
+ mVideosSortRole = role;
+ VideoCollectionViewUtilsData::mVideoSortOrder = order;
+ mVideosSortOrder = order;
+ }
+ else
+ {
+ status = -1;
+ }
+ return status;
}
-int VideoCollectionViewUtils::loadSortingValues(int &role, Qt::SortOrder &order)
+int VideoCollectionViewUtils::loadSortingValues(int &role, Qt::SortOrder &order, VideoCollectionCommon::TCollectionLevels target)
{
if (VideoCollectionViewUtilsData::mLoadSortingValuesFails)
{
return -1;
}
-
- role = VideoCollectionViewUtilsData::mSortRole;
- order = VideoCollectionViewUtilsData::mSortOrder;
-
+ if(target == VideoCollectionCommon::ELevelCategory )
+ {
+ role = VideoCollectionViewUtilsData::mCollectionSortRole;
+ order = VideoCollectionViewUtilsData::mCollectionSortOrder;
+ }
+ else if(target > VideoCollectionCommon::ELevelCategory &&
+ target <= VideoCollectionCommon::ELevelAlbum)
+ {
+ role = VideoCollectionViewUtilsData::mVideoSortRole;
+ order = VideoCollectionViewUtilsData::mVideoSortOrder;
+ }
+ else
+ {
+ return -1;
+ }
return 0;
}
@@ -92,10 +125,11 @@
}
void VideoCollectionViewUtils::sortModel(VideoSortFilterProxyModel *model,
- bool async)
+ bool async, VideoCollectionCommon::TCollectionLevels target)
{
Q_UNUSED(model);
Q_UNUSED(async);
+ Q_UNUSED(target);
// not stubbed
}
--- a/videocollection/tsrc/stubs/src/videocollectionwrapper.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videocollectionwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -41,7 +41,7 @@
VideoCollectionWrapperData::reset();
}
-VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(int type)
+VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(VideoCollectionCommon::TModelType type)
{
VideoSortFilterProxyModel *model = 0;
if (!VideoCollectionWrapperData::mGetModelFails)
@@ -59,7 +59,7 @@
switch (type)
{
- case EAllVideos:
+ case VideoCollectionCommon::EModelTypeAllVideos:
{
model = VideoCollectionWrapperData::mAllVideosModel;
if (!model)
@@ -73,7 +73,7 @@
}
break;
}
- case ECollections:
+ case VideoCollectionCommon::EModelTypeCollections:
{
model = VideoCollectionWrapperData::mCollectionsModel;
if (!model)
@@ -87,7 +87,7 @@
}
break;
}
- case ECollectionContent:
+ case VideoCollectionCommon::EModelTypeCollectionContent:
{
model = VideoCollectionWrapperData::mCollectionContentModel;
if (!model)
@@ -101,7 +101,7 @@
}
break;
}
- case EGeneric:
+ case VideoCollectionCommon::EModelTypeGeneric:
{
model = VideoCollectionWrapperData::mGenericModel;
if (!model)
--- a/videocollection/tsrc/stubs/src/videohintwidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videohintwidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -16,6 +16,10 @@
*/
#include "videohintwidget.h"
+#include "videohintwidgetdata.h"
+
+int VideoHintWidgetData::mSettedHintLevel = -1;
+bool VideoHintWidgetData::mSettedButtonShowLevel = false;
VideoHintWidget::VideoHintWidget(VideoCollectionUiLoader *uiLoader,
QGraphicsItem *parent):
@@ -41,14 +45,12 @@
void VideoHintWidget::setLevel(HintLevel level)
{
- Q_UNUSED(level);
- // not stubbed
+ VideoHintWidgetData::mSettedHintLevel = (int)level;
}
void VideoHintWidget::setButtonShown(bool shown)
{
- Q_UNUSED(shown);
- // not stubbed
+ VideoHintWidgetData::mSettedButtonShowLevel = shown;
}
void VideoHintWidget::orientationChangedSlot(Qt::Orientation targetOrientation)
@@ -59,12 +61,12 @@
void VideoHintWidget::activate()
{
- // not stubbed
+ setVisible(true);
}
void VideoHintWidget::deactivate()
{
- // not stubbed
+ setVisible(false);
}
void VideoHintWidget::updateUiComponents()
--- a/videocollection/tsrc/stubs/src/videolistdatamodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistdatamodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -24,6 +24,7 @@
QModelIndex VideoListDataModelData::mLastIndex;
int VideoListDataModelData::mDataAccessCount = 0;
int VideoListDataModelData::mRowCount = 0;
+int VideoListDataModelData::mRowCountDecrement = 0;
VideoListDataModel::VideoListDataModel(QObject *parent) :
QAbstractItemModel(parent),
@@ -103,7 +104,12 @@
{
Q_UNUSED(parent);
- return VideoListDataModelData::mRowCount;
+ uint count = VideoListDataModelData::mRowCount - VideoListDataModelData::mRowCountDecrement;
+ if(VideoListDataModelData::mRowCountDecrement > 0)
+ {
+ VideoListDataModelData::mRowCountDecrement--;
+ }
+ return count;
}
QMap<int, QVariant> VideoListDataModel::itemData(const QModelIndex &index) const
@@ -135,12 +141,12 @@
return QString();
}
-QStringList VideoListDataModel::prepareLengthStrings(int index) const
+QString VideoListDataModel::prepareShortLengthString(int index) const
{
Q_UNUSED(index);
// not stubbed
- return QStringList();
+ return QString();
}
QVariant VideoListDataModel::data(const QModelIndex &index, int role) const
--- a/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistselectiondialog.cpp Mon May 03 12:32:50 2010 +0300
@@ -41,24 +41,18 @@
mListContainer(0),
mForcedCheck(false),
mModel(0),
- mListWidget(0)
+ mListWidget(0),
+ mPrimaryAction(0),
+ mSecondaryAction(0)
{
setDismissPolicy(HbDialog::NoDismiss);
setTimeout(HbDialog::NoTimeout);
// create primary action
- HbAction *action = new HbAction();
- if (action)
- {
- setPrimaryAction(action);
- }
+ mPrimaryAction = new HbAction();
// create secondary action
- action = new HbAction();
- if (action)
- {
- setSecondaryAction(action);
- }
+ mSecondaryAction = new HbAction();
}
VideoListSelectionDialog::~VideoListSelectionDialog()
@@ -83,7 +77,7 @@
// fill selection
VideoListSelectionDialogData::mMultiSelectionLaunchCount++;
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EGeneric);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeGeneric);
if (model)
{
for (int i = 0; i < VideoListSelectionDialogData::mSelectionCount; i++)
--- a/videocollection/tsrc/stubs/src/videolistview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistview.cpp Mon May 03 12:32:50 2010 +0300
@@ -25,6 +25,7 @@
int VideoListViewData::mBackCount = 0;
int VideoListViewData::mDeactivateViewCount = 0;
int VideoListViewData::mInitializeViewCount = 0;
+TMPXItemId VideoListViewData::mActivatedItemId = TMPXItemId::InvalidId();
VideoListView::VideoListView(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent) :
HbView(parent),
@@ -60,8 +61,11 @@
// not stubbed
}
-int VideoListView::activateView()
+int VideoListView::activateView(const TMPXItemId &itemId)
{
+ Q_UNUSED(itemId);
+
+ VideoListViewData::mActivatedItemId = itemId;
VideoListViewData::mActivateViewCount++;
return 0;
}
@@ -132,20 +136,6 @@
// not stubbed
}
-bool VideoListView::isActionChecked(const QString &name)
-{
- Q_UNUSED(name);
- // not stubbed
- return true;
-}
-
-void VideoListView::setActionChecked(bool setChecked, const QString &name)
-{
- Q_UNUSED(setChecked);
- Q_UNUSED(name);
- // not stubbed
-}
-
void VideoListView::openAllVideosViewSlot()
{
// not stubbed
@@ -212,6 +202,11 @@
// not stubbed
}
+void VideoListView::prepareBrowseServiceMenu()
+{
+ // not stubbed
+}
+
void VideoListView::handleAsyncStatusSlot(int statusCode, QVariant &additional)
{
Q_UNUSED(statusCode);
@@ -229,13 +224,6 @@
// not stubbed
}
-void VideoListView::widgetReadySlot(QGraphicsWidget *widget, const QString &name)
-{
- Q_UNUSED(widget);
- Q_UNUSED(name);
- // not stubbed
-}
-
void VideoListView::objectReadySlot(QObject *object, const QString &name)
{
Q_UNUSED(object);
--- a/videocollection/tsrc/stubs/src/videolistwidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videolistwidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -33,8 +33,7 @@
mCurrentLevel(VideoCollectionCommon::ELevelInvalid),
mSignalsConnected(false),
mIsService(false),
- mNavKeyBackAction(0),
- mNavKeyQuitAction(0),
+ mNavKeyAction(0),
mContextMenu(0),
mSelectionMode(HbAbstractItemView::NoSelection),
mScrollPositionTimer(0),
@@ -107,8 +106,7 @@
VideoCollectionCommon::TCollectionLevels VideoListWidget::getLevel()
{
- // not stubbed
- return VideoCollectionCommon::ELevelInvalid;
+ return mCurrentLevel;
}
VideoSortFilterProxyModel& VideoListWidget::getModel()
@@ -128,13 +126,19 @@
// not stubbed
}
-void VideoListWidget::longPressGesture (const QPointF &point)
+void VideoListWidget::longPressedSlot(HbAbstractViewItem *item, const QPointF &point)
{
Q_UNUSED(point);
// not stubbed
}
-void VideoListWidget::playItemSlot()
+void VideoListWidget::panGesture (const QPointF &point)
+{
+ Q_UNUSED(point);
+ // not stubbed
+}
+
+void VideoListWidget::openItemSlot()
{
// not stubbed
}
@@ -169,11 +173,6 @@
// not stubbed
}
-void VideoListWidget::playAllSlot()
-{
- // not stubbed
-}
-
void VideoListWidget::back()
{
// not stubbed
@@ -205,7 +204,7 @@
// not stubbed
}
-void VideoListWidget::debugNotImplementedYet()
+void VideoListWidget::setNavigationAction()
{
// not stubbed
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/videoservicebrowse.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of VideoServiceBrowse Stub
+*
+*/
+
+// Version : %version: %
+
+#include <hbapplication.h>
+
+#include "videoservices.h"
+#include "videoservicebrowse.h"
+#include "mpxhbvideocommondefs.h"
+#include "videoservicebrowsedata.h"
+
+int VideoServiceBrowseData::mBrowseCategory = 0;
+
+/*!
+ Constructor.
+ \param parent, Pointer to the video services.
+*/
+VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent)
+ : XQServiceProvider( "TestListView" )
+ , mRequestIndex( 0 )
+ , mServiceApp( parent )
+{
+ // not stubbed
+}
+
+/*!
+ Destructor.
+*/
+VideoServiceBrowse::~VideoServiceBrowse()
+{
+ // not stubbed
+}
+
+/*!
+ Complete pending service request.
+ \param None.
+ \return None.
+*/
+void VideoServiceBrowse::complete()
+{
+ // not stubbed
+}
+
+/*!
+ Get current browsing category.
+ \param None.
+ \return VideoServices::TVideoCategory.
+*/
+int VideoServiceBrowse::getBrowseCategory() const
+{
+ return VideoServiceBrowseData::mBrowseCategory;
+}
+
+/*!
+ Return context title of videos application.
+ \param None.
+ \return QString.
+*/
+QString VideoServiceBrowse::contextTitle() const
+{
+ // not stubbed
+ return QString();
+}
+
+/*!
+ Browse videos.
+ \param title, Title of the embedded Videos application.
+ \param category, Category which type of videos are browsed.
+ \return None.
+*/
+void VideoServiceBrowse::browseVideos(const QString &title, int category)
+{
+ // not stubbed
+}
+
+// End of file
--- a/videocollection/tsrc/stubs/src/videoservices.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videoservices.cpp Mon May 03 12:32:50 2010 +0300
@@ -16,33 +16,38 @@
*/
#include <qobject.h>
+#include "videoplayerappexport.h"
#include "videoservices.h"
#include "videoserviceurifetch.h"
+#include "videoservicebrowse.h"
+#include "xqserviceutilxtra.h"
-VideoServices *VideoServices::mInstance = 0;
+VideoServices* g_Instance = 0;
VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
{
- if(!mInstance)
+ static VideoServices* g_Instance = 0;
+
+ if(!g_Instance)
{
- mInstance = new VideoServices(engine);
+ g_Instance = new VideoServices(engine);
}
- else if(engine && !mInstance->engine())
+ else if(engine && !g_Instance->engine())
{
- mInstance->setEngine(engine);
+ g_Instance->setEngine(engine);
}
- mInstance->mReferenceCount++;
- return mInstance;
+ g_Instance->mReferenceCount++;
+ return g_Instance;
}
void VideoServices::decreaseReferenceCount()
{
- if(mInstance)
+ if(g_Instance)
{
- if(--mInstance->mReferenceCount == 0)
+ if(--g_Instance->mReferenceCount == 0)
{
- delete mInstance;
- mInstance = NULL;
+ delete g_Instance;
+ g_Instance = NULL;
}
}
}
@@ -65,11 +70,13 @@
mCurrentService(VideoServices::ENoService)
{
mServiceUriFetch = new VideoServiceUriFetch(this);
+ mServiceBrowse = new VideoServiceBrowse(this);
}
VideoServices::~VideoServices()
{
delete mServiceUriFetch;
+ delete mServiceBrowse;
}
VideoServices::TVideoService VideoServices::currentService()
@@ -77,6 +84,18 @@
return mCurrentService;
}
+int VideoServices::getBrowseCategory() const
+{
+ int category = 0;
+
+ if (mServiceBrowse)
+ {
+ category = mServiceBrowse->getBrowseCategory();
+ }
+
+ return category;
+}
+
void VideoServices::setCurrentService(VideoServices::TVideoService service)
{
mCurrentService = service;
@@ -93,3 +112,9 @@
// not stubbed
}
+void VideoServices::browsingEnded()
+{
+ // not stubbed
+}
+
+// End of file
--- a/videocollection/tsrc/stubs/src/videosortfilterproxymodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/src/videosortfilterproxymodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -20,6 +20,8 @@
#include "videocollectioncommon.h"
#include "videolistdatamodel.h"
+using namespace VideoCollectionCommon;
+
int VideoSortFilterProxyModelData::mSortRole = -1;
Qt::SortOrder VideoSortFilterProxyModelData::mSortOrder = Qt::AscendingOrder;
bool VideoSortFilterProxyModelData::mSortAsync = false;
@@ -37,13 +39,16 @@
TMPXItemId VideoSortFilterProxyModelData::mGenericFilterId = TMPXItemId::InvalidId();
bool VideoSortFilterProxyModelData::mGenericFilterValue = false;
TMPXItemId VideoSortFilterProxyModelData::mNewAlbumId = TMPXItemId::InvalidId();
+QString VideoSortFilterProxyModelData::mLastAlbumNameInRename;
+int VideoSortFilterProxyModelData::mRenameAlbumReturnValue = 0;
+QString VideoSortFilterProxyModelData::mLastAddedAlbumName = "";
-VideoSortFilterProxyModel::VideoSortFilterProxyModel(int type, QObject *parent):
+VideoSortFilterProxyModel::VideoSortFilterProxyModel(VideoCollectionCommon::TModelType type, QObject *parent):
QSortFilterProxyModel(parent),
mModel(0),
mCollectionClient(0),
mType(type),
- mLevel(-1),
+ mLevel(VideoCollectionCommon::ELevelInvalid),
mIdleSortTimer(0),
mWantedSortRole(VideoCollectionCommon::KeyDateTime)
{
@@ -73,7 +78,7 @@
// not stubbed
}
-int VideoSortFilterProxyModel::open(int level)
+int VideoSortFilterProxyModel::open(VideoCollectionCommon::TCollectionLevels level)
{
int err = 0;
@@ -94,6 +99,8 @@
VideoSortFilterProxyModelData::mSortRole = sortingRole;
VideoSortFilterProxyModelData::mSortOrder = order;
VideoSortFilterProxyModelData::mSortAsync = async;
+ setSortRole(sortingRole);
+ sort(0, order);
}
void VideoSortFilterProxyModel::getSorting(int &sortingRole,
@@ -152,6 +159,12 @@
// not stubbed
}
+void VideoSortFilterProxyModel::itemModifiedSlot(const TMPXItemId &itemId)
+{
+ Q_UNUSED(itemId);
+ // not stubbed
+}
+
bool VideoSortFilterProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const
{
@@ -203,9 +216,14 @@
return QString();
}
+TModelType VideoSortFilterProxyModel::getType()
+{
+ return mType;
+}
+
TMPXItemId VideoSortFilterProxyModel::addNewAlbum(const QString &title)
{
- Q_UNUSED(title);
+ VideoSortFilterProxyModelData::mLastAddedAlbumName = title;
return VideoSortFilterProxyModelData::mNewAlbumId;
}
@@ -263,6 +281,16 @@
VideoSortFilterProxyModelData::mLastItemId = albumId;
}
+int VideoSortFilterProxyModel::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+{
+ if(VideoSortFilterProxyModelData::mRemoveItemsFromAlbumReturnValue >= 0)
+ {
+ VideoSortFilterProxyModelData::mLastItemId = albumId;
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = newTitle;
+
+ }
+ return VideoSortFilterProxyModelData::mRenameAlbumReturnValue;
+}
TMPXItemId VideoSortFilterProxyModel::getOpenItem() const
{
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/stubs/src/xqserviceutil.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,40 @@
+/**
+* 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:
+*
+*/
+
+#include "hbaction.h"
+#include "xqserviceutilxtra.h"
+
+void XQServiceUtil::toBackground(bool value)
+{
+ Q_UNUSED(value);
+}
+
+bool XQServiceUtil::isEmbedded()
+{
+ return false;
+}
+
+bool XQServiceUtil::isService()
+{
+ bool service = false;
+ XQServiceUtilXtra* ptr = XQServiceUtilXtra::instance();
+ service = ptr->currentService();
+ ptr->decreaseReferenceCount();
+ return service;
+}
+
+// End of file
--- a/videocollection/tsrc/stubs/stubs.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/tsrc/stubs/stubs.pro Mon May 03 12:32:50 2010 +0300
@@ -13,6 +13,8 @@
#
# Description:
#
+
+DEFINES += XQSERVICEUTIL_H
CONFIG += qtestlib \
Hb \
@@ -23,8 +25,7 @@
-lbitgdi.dll \
-lxqplugins.dll \
-lmpxviewframeworkqt.dll \
- -lxqservice.dll \
- -lxqserviceutil.dll
+ -lxqservice.dll
HEADERS_TEMP = \
inc/hbabstractitemview.h \
@@ -33,6 +34,7 @@
inc/hbcheckbox.h \
inc/hbdeviceprofile.h \
inc/hbdialog.h \
+ inc/hbnotificationdialog.h \
inc/hbglobal.h \
inc/hbgroupbox.h \
inc/hbinputdialog.h \
@@ -61,13 +63,15 @@
inc/videocollectionwrapperdata.h \
inc/videolistdatamodeldata.h \
inc/videolistselectiondialogdata.h \
+ inc/videohintwidgetdata.h \
inc/videolistwidgetdata.h \
inc/videolistviewdata.h \
inc/videoplayerappexport.h \
inc/videosortfilterproxymodeldata.h \
inc/videothumbnailtestdata.h \
- inc/xqserviceutil.h \
inc/xqserviceutilxtra.h \
+ # We need stub for this because it has static data and HW compilation of moc file fails because of that.
+ inc/videoservices.h \
../../videocollectionview/inc/videocollectionuiloader.h \
../../videocollectionview/inc/videocollectionviewutils.h \
../../videocollectionview/inc/videohintwidget.h \
@@ -78,14 +82,15 @@
../../videocollectionwrapper/inc/videocollectionwrapper.h \
../../videocollectionwrapper/inc/videosortfilterproxymodel.h \
../../videocollectionwrapper/inc/videothumbnaildata.h \
- ../../../videoplayerapp/videoplayerengine/inc/videoservices.h \
../../../videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h \
+ ../../../videoplayerapp/videoplayerengine/inc/videoservicebrowse.h
SOURCES_TEMP = \
src/hbdocumentloader.cpp \
src/hbaction.cpp \
src/hbcheckbox.cpp \
src/hbdialog.cpp \
+ src/hbnotificationdialog.cpp \
src/hbinputdialog.cpp \
src/hbglobal.cpp \
src/hblabel.cpp \
@@ -98,6 +103,9 @@
src/hbstackedwidget.cpp \
src/hbstyleloader.cpp \
src/hbwidget.cpp \
+ src/hbview.cpp \
+ src/hbeffect.cpp \
+ src/xqserviceutil.cpp \
src/xqserviceutilxtra.cpp \
src/videocollectionuiloader.cpp \
src/videocollectionviewutils.cpp \
@@ -111,6 +119,7 @@
src/videothumbnaildata.cpp \
src/videoservices.cpp \
src/videoserviceurifetch.cpp \
+ src/videoservicebrowse.cpp
HEADERS += $$find(HEADERS_TEMP, ^(?!.*$$TESTEDCLASS).*$)
SOURCES += $$find(SOURCES_TEMP, ^(?!.*$$TESTEDCLASS).*$)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/rom/videoservicestestapp.iby Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: hbvideoplayer.iby
+*
+*/
+
+
+#ifndef __HBVIDEOSERVICESTESTAPP_IBY__
+#define __HBVIDEOSERVICESTESTAPP_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_EXE(videoservicestestapp)
+data=/epoc32/data/z/private/10003a3f/import/apps/videoservicestestapp_reg.rsc private/10003a3f/import/apps/videoservicestestapp_reg.rsc
+data=DATAZ_/APP_RESOURCE_DIR/videoservicestestapp.rsc APP_RESOURCE_DIR/videoservicestestapp.rsc
+
+
+#endif // __HBVIDEOSERVICESTESTAPP_IBY__
Binary file videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.der has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/sis/Nokia_RnDCert_02.key Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,15 @@
+-----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-----
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/sis/create_urel_sisx.bat Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,21 @@
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+REM Make qt videoplayer urel sisx file (contains hb -libraries)
+
+call makesis videoservicestestapp.pkg videoservicestestapp.sis
+call signsis videoservicestestapp.sis videoservicestestapp.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key
+call del videoservicestestapp.sis
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.pkg Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,30 @@
+; videoservicestestapp_template.pkg generated by qmake at 2010-02-12T08:26:39
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"videoservicestestapp"},(0x2002C341),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+(0x2001E61C),4,6,0,{"QtLibs pre-release"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/videoservicestestapp.exe" - "!:\sys\bin\videoservicestestapp.exe"
+"/epoc32/data/z/resource/apps/videoservicestestapp.rsc" - "!:\resource\apps\videoservicestestapp.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/videoservicestestapp_reg.rsc" - "!:\private\10003a3f\import\apps\videoservicestestapp_reg.rsc"
+
+; Manual PKG post-rules from PRO files
Binary file videocollection/tsrc/videoservicestestapp/sis/videoservicestestapp.sisx has changed
Binary file videocollection/videocollectionview/conf/videolistview.confml has changed
Binary file videocollection/videocollectionview/conf/videolistview_2002BC63.crml has changed
--- a/videocollection/videocollectionview/data/images/qtg_mono_remove_from_video_collection.svg Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generator: Mobile Designer 3.0 2.0 -->
-<svg width="40" height="40" viewBox="0 0 40 40"
- stroke-miterlimit="2" enable-background="new" zoomAndPan="disable"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:ev="http://www.w3.org/2001/xml-events"
- xml:space="preserve" version="1.1" baseProfile="Normal">
-
-<!-- Scene 1 -->
-<g id="Scene_1">
- <rect x="0" y="0" width="40" height="40" opacity="0.5019" fill="none"/>
- <path
- d="M16 28 c0 -0.33 0.02 -0.67 0.05 -1 h-3.05 v-16
- h12 v5.39 c0.96 -0.24 1.96 -0.39 3 -0.39 v-2
- h3 v2.39 c1.06 0.27 2.07 0.68 3 1.22 v-14.61
- h-3 v3 h-3 v-3 h-3 v5
- h-12 v-5 h-3 v3 h-3 v-3
- h-3 v32 h3 v-3 h3 v3
- h3 v-5 h3.18 c-0.1 -0.65 -0.17 -1.31 -0.17 -2
- Z M28 8 h3 v4 h-3 v-4 Z M10 30
- h-3 v-4 h3 v4 Z M10 24 h-3
- v-4 h3 v4 Z M10 18 h-3 v-4
- h3 v4 Z M10 12 h-3 v-4 h3
- v4 Z"/>
- <rect x="19.5" y="24.2" width="18.37" height="5.51"/>
-</g>
-
-</svg>
\ No newline at end of file
--- a/videocollection/videocollectionview/data/videocollectionview.qrc Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/data/videocollectionview.qrc Mon May 03 12:32:50 2010 +0300
@@ -5,7 +5,6 @@
</qresource>
<qresource prefix="/" >
<file>images/qtg_mono_video_all.svg</file>
- <file>images/qtg_mono_remove_from_video_collection.svg</file>
</qresource>
<qresource prefix="/" >
<file>effects/slide_in_to_left_and_fade_in.fxml</file>
--- a/videocollection/videocollectionview/inc/videocollectionuiloader.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionuiloader.h Mon May 03 12:32:50 2010 +0300
@@ -22,57 +22,9 @@
#include <hbdocumentloader.h>
#include <qhash.h>
#include <qmap.h>
-
-// Constants
-static const char* DOCML_VIDEOCOLLECTIONVIEW_FILE = ":/layout/collectionview.docml";
-static const char* DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST = "listsSection";
-static const char* DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT = "hintSection";
-static const char* DOCML_NAME_VIEW = "view";
-
-// Videocollection View
-static const char* DOCML_NAME_VC_HEADINGBANNER = "vc:mBanner";
-static const char* DOCML_NAME_VC_COLLECTIONWIDGET = "vc:mCollectionWidget";
-static const char* DOCML_NAME_VC_COLLECTIONCONTENTWIDGET = "vc:mCollectionContentWidget";
-static const char* DOCML_NAME_VC_VIDEOLISTWIDGET = "vc:mListWidget";
-static const char* DOCML_NAME_VC_VIDEOHINTWIDGET = "vc:mHintWidget";
-
-// Videocollection Options Menu
-static const char* DOCML_NAME_OPTIONS_MENU = "vc:mOptionsMenu";
-static const char* DOCML_NAME_SORT_MENU = "vc:mSortBy";
-
-static const char* DOCML_NAME_SORT_BY_DATE = "vc:mDate";
-static const char* DOCML_NAME_SORT_BY_NAME = "vc:mName";
-static const char* DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS = "vc:mNumberOfItems";
-static const char* DOCML_NAME_SORT_BY_RATING = "vc:mRating";
-static const char* DOCML_NAME_SORT_BY_SIZE = "vc:mSize";
+#include <qset.h>
-static const char* DOCML_NAME_ADD_TO_COLLECTION = "vc:mAddtoCollection";
-static const char* DOCML_NAME_CREATE_COLLECTION = "vc:mCreateNewCollection";
-static const char* DOCML_NAME_DELETE_MULTIPLE = "vc:mDeleteMultiple";
-
-// Videocollection hint widget
-static const char* DOCML_NAME_HINT_BUTTON = "vc:mHintButton";
-static const char* DOCML_NAME_HINT_LABEL = "vc:mHintTextLabel";
-static const char* DOCML_NAME_NO_VIDEOS_LABEL = "vc:mNoVideosLabel";
-
-// video multiselection dialog
-static const char* DOCML_VIDEOSELECTIONDIALOG_FILE = ":/layout/videolistselectiondialog.docml";
-static const char* DOCML_NAME_DIALOG = "mMultiSelectionDialog";
-static const char* DOCML_NAME_DLG_HEADINGLBL = "mHeadingLabel";
-static const char* DOCML_NAME_CHECK_CONTAINER = "mCheckBoxContainer";
-static const char* DOCML_NAME_MARKALL = "mCheckMarkAll";
-static const char* DOCML_NAME_LBL_SELECTION = "mSelectionCount";
-static const char* DOCML_NAME_LIST_CONTAINER = "mListContainer";
-
-// async loading timeout
-static const int ASYNC_FIND_TIMEOUT = 50; // ms
-
-// Effect constants
-static const char* EFFECT_SLIDE_IN_TO_LEFT_FILENAME = ":/effects/slide_in_to_left_and_fade_in.fxml";
-static const char* EFFECT_SLIDE_OUT_TO_LEFT_FILENAME = ":/effects/slide_out_to_left_and_fade_out.fxml";
-
-static const char* EFFECT_SLIDE_IN_TO_LEFT = "slide_in_to_left_and_fade_in";
-static const char* EFFECT_SLIDE_OUT_TO_LEFT = "slide_out_to_left_and_fade_out";
+#include "videocollectionuiloaderdef.h"
// Forward declarations
class QActionGroup;
@@ -85,7 +37,7 @@
{
Q_OBJECT
-private:
+public:
/** actions used in menus and toolbars */
enum ActionIds
{
@@ -104,51 +56,6 @@
ETBActionRemoveVideos
};
- /** VideoCollectionUiLoader parameter class */
- class Params
- {
- public:
- Params(const QString& name,
- bool isWidget = false,
- QObject *receiver = 0,
- const char *docml = 0,
- const char *section = 0,
- const char *member = 0):
- mName(name),
- mIsWidget(isWidget),
- mReceiver(receiver),
- mDocml(docml),
- mSection(section),
- mMember(member)
- {
- // nothing to do
- }
-
- bool isDuplicate(const Params& params) const
- {
- bool isSame(false);
-
- if (mName == params.mName &&
- mReceiver == params.mReceiver &&
- mDocml == params.mDocml &&
- mSection == params.mSection &&
- mMember == params.mMember)
- {
- isSame = true;
- }
-
- return isSame;
- }
-
- public:
- QString mName;
- bool mIsWidget;
- QObject *mReceiver;
- const char *mDocml;
- const char *mSection;
- const char *mMember;
- };
-
public:
/**
* C++ constructor.
@@ -161,19 +68,12 @@
virtual ~VideoCollectionUiLoader();
/**
- * Starts to load a specified UI section.
- *
- * @param uiSection, UI section to load.
- * @param receiver, Receiver of a ready signal.
- * @param widgetSlot, Slot which is called when a widget is ready.
- * @param objectSlot, Slot which is called when an object is ready.
- * @return None.
+ * Adds data to ui loader loading queue.
*/
- void startLoading(QSet<QString> uiSections,
+ void addData(QList<VideoCollectionUiLoaderParam> params,
QObject *receiver,
- const char *widgetSlot,
- const char *objectSlot);
-
+ const char *slot);
+
/**
* Returns the requested widget casted to correct type
*
@@ -206,23 +106,26 @@
/**
* load
*/
- QObjectList load( const QString &fileName, bool *ok = 0 );
+ void load(const QString &fileName, bool *ok = 0);
/**
* load
*/
- QObjectList load( const QString &fileName, const QString §ion , bool *ok = 0 );
-
-signals:
+ void load(const QString &fileName, const QString §ion , bool *ok = 0);
+
+public slots:
/**
- * Signals that widget has been loaded asynchonously.
- *
- * @param widget, Widget which was loaded.
- * @param name, Name of the widget in document.
- * @return None.
+ * Starts loading ui components belonging to the defined phase.
*/
- void widgetReady(QGraphicsWidget *widget, const QString &name);
-
+ void loadPhase(int loadPhase);
+
+private slots:
+ /**
+ * Remove object from list since it has been already deleted.
+ */
+ void removeOrphanFromList(QObject *object);
+
+signals:
/**
* Signals that object has been loaded asynchonously.
*
@@ -231,8 +134,9 @@
* @return None.
*/
void objectReady(QObject *object, const QString &name);
+
+protected:
-public:
/**
* Loads widget from document.
*
@@ -244,28 +148,47 @@
/**
* Loads object from document.
*
- * @param name, Widget name.
- * @return QGraphicsWidget*.
+ * @param name, Object name.
+ * @return QObject*.
*/
QObject* doFindObject(const QString &name);
-private:
/**
* Adds a ui section to async loading queue.
*/
- void addToQueue(Params ¶ms);
+ void addToQueue(VideoCollectionUiLoaderParam ¶m,
+ QObject *receiver,
+ const char *slot);
/**
- * Init a specific widget.
+ * Finds an object or widget from docml based on the parameter.
*/
- void initWidget(QGraphicsWidget *widget,
- const QString &name);
+ QObject* getObject(const VideoCollectionUiLoaderParam ¶m);
+
+ /**
+ * Loads and prepares docml and sections if found from param.
+ */
+ bool prepareDocmlAndSection(const char *docml, const char *section);
/**
* Init a specific object.
*/
- void initObject(QObject *object,
- const QString& name);
+ void initObject(QObject *object, const QString& name);
+
+ /**
+ * Execute ui loader request.
+ */
+ QObject* executeRequest(const VideoCollectionUiLoaderParam ¶m);
+
+ /**
+ * Gets index of the item in queue, if one found.
+ */
+ int indexInQueue(const QString &name);
+
+ /**
+ * Removes request from queue.
+ */
+ void removeFromQueue(const QString &name);
private:
/** from QObject */
@@ -283,19 +206,21 @@
/**
* Check that set params are valid.
*/
- bool isValid(const Params ¶ms);
+ bool isValid(const VideoCollectionUiLoaderParam ¶m);
+
+ /**
+ * Store object without a parent.
+ */
+ void storeOrphans(const QObjectList &list);
private:
/** async queue */
- QList<Params> mQueue;
+ QList<VideoCollectionUiLoaderParam> mQueue;
/** timer id */
int mTimerId;
- /** list of loaded widgets */
- QHash<QString, QGraphicsWidget*> mWidgets;
-
- /** list of loaded objects */
+ /** list of initialized objects */
QHash<QString, QObject*> mObjects;
/** menu actions */
@@ -304,14 +229,26 @@
/** toolbar actions */
QMap<ActionIds, HbAction*> mToolbarActions;
- /** loaded docml's */
- QList<QString> mDocmls;
+ /** loaded docmls */
+ QSet<QString> mDocmls;
+
+ /** loaded sections */
+ QSet<QString> mSections;
/** action group for "sort by" actions */
QActionGroup* mSortGroup;
/** is service */
bool mIsService;
+
+ /** load phases currently active */
+ QSet<int> mPhases;
+
+ /**
+ * objects without a parent - these needs to be deleted manually unless
+ * a parent is set.
+ */
+ QObjectList mOrphans;
};
#endif // _VIDEOCOLLECTIONUILOADER_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/inc/videocollectionuiloaderdef.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,151 @@
+/*
+* 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:
+*
+*/
+
+#ifndef VIDEOCOLLECTIONUILOADERDEF_H
+#define VIDEOCOLLECTIONUILOADERDEF_H
+
+// Constants
+static const char* DOCML_VIDEOCOLLECTIONVIEW_FILE = ":/layout/collectionview.docml";
+static const char* DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST = "listsSection";
+static const char* DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT = "hintSection";
+static const char* DOCML_NAME_VIEW = "view";
+
+// Videocollection View
+static const char* DOCML_NAME_VC_HEADINGBANNER = "vc:mBanner";
+static const char* DOCML_NAME_VC_COLLECTIONWIDGET = "vc:mCollectionWidget";
+static const char* DOCML_NAME_VC_COLLECTIONCONTENTWIDGET = "vc:mCollectionContentWidget";
+static const char* DOCML_NAME_VC_VIDEOLISTWIDGET = "vc:mListWidget";
+static const char* DOCML_NAME_VC_VIDEOHINTWIDGET = "vc:mHintWidget";
+
+// Videocollection Options Menu
+static const char* DOCML_NAME_OPTIONS_MENU = "vc:mOptionsMenu";
+static const char* DOCML_NAME_SORT_MENU = "vc:mSortBy";
+
+static const char* DOCML_NAME_SORT_BY_DATE = "vc:mDate";
+static const char* DOCML_NAME_SORT_BY_NAME = "vc:mName";
+static const char* DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS = "vc:mNumberOfItems";
+static const char* DOCML_NAME_SORT_BY_SIZE = "vc:mSize";
+
+static const char* DOCML_NAME_ADD_TO_COLLECTION = "vc:mAddtoCollection";
+static const char* DOCML_NAME_CREATE_COLLECTION = "vc:mCreateNewCollection";
+static const char* DOCML_NAME_DELETE_MULTIPLE = "vc:mDeleteMultiple";
+
+// Videocollection hint widget
+static const char* DOCML_NAME_HINT_BUTTON = "vc:mHintButton";
+static const char* DOCML_NAME_HINT_LABEL = "vc:mHintTextLabel";
+static const char* DOCML_NAME_NO_VIDEOS_LABEL = "vc:mNoVideosLabel";
+
+// video multiselection dialog
+static const char* DOCML_VIDEOSELECTIONDIALOG_FILE = ":/layout/videolistselectiondialog.docml";
+static const char* DOCML_NAME_DIALOG = "mMultiSelectionDialog";
+static const char* DOCML_NAME_DLG_HEADINGLBL = "mHeadingLabel";
+static const char* DOCML_NAME_CHECK_CONTAINER = "mCheckBoxContainer";
+static const char* DOCML_NAME_MARKALL = "mCheckMarkAll";
+static const char* DOCML_NAME_LBL_SELECTION = "mSelectionCount";
+static const char* DOCML_NAME_LIST_CONTAINER = "mListContainer";
+
+// async loading timeout
+static const int ASYNC_FIND_TIMEOUT = 50; // ms
+
+// Effect constants
+static const char* EFFECT_SLIDE_IN_TO_LEFT_FILENAME = ":/effects/slide_in_to_left_and_fade_in.fxml";
+static const char* EFFECT_SLIDE_OUT_TO_LEFT_FILENAME = ":/effects/slide_out_to_left_and_fade_out.fxml";
+
+static const char* EFFECT_SLIDE_IN_TO_LEFT = "slide_in_to_left_and_fade_in";
+static const char* EFFECT_SLIDE_OUT_TO_LEFT = "slide_out_to_left_and_fade_out";
+
+/** VideoCollectionUiLoader parameter class */
+class VideoCollectionUiLoaderParam
+{
+public:
+ enum // Loading phases
+ {
+ LoadPhasePrimary,
+ LoadPhaseSecondary
+ };
+
+public:
+ VideoCollectionUiLoaderParam(const QString& name,
+ const char *docml,
+ bool isWidget,
+ int loadPhase):
+ mName(name),
+ mIsWidget(isWidget),
+ mReceiver(0),
+ mDocml(docml),
+ mSection(0),
+ mMember(0),
+ mPhase(loadPhase)
+ {
+ // members already set
+ }
+
+ VideoCollectionUiLoaderParam(const QString& name,
+ const char *docml,
+ const char *section,
+ bool isWidget,
+ int loadPhase):
+ mName(name),
+ mIsWidget(isWidget),
+ mReceiver(0),
+ mDocml(docml),
+ mSection(section),
+ mMember(0),
+ mPhase(loadPhase)
+ {
+ // members already set
+ }
+
+ VideoCollectionUiLoaderParam(const QString& name,
+ const char *docml,
+ const char *section,
+ bool isWidget,
+ int loadPhase,
+ QObject *receiver,
+ const char *member):
+ mName(name),
+ mIsWidget(isWidget),
+ mReceiver(receiver),
+ mDocml(docml),
+ mSection(section),
+ mMember(member),
+ mPhase(loadPhase)
+ {
+ // members already set
+ }
+
+ bool operator==(const VideoCollectionUiLoaderParam ¶m) const
+ {
+ return mName == param.mName && mDocml == param.mDocml && mSection == param.mSection;
+ }
+
+ bool operator==(const QString &name) const
+ {
+ return mName == name;
+ }
+
+public:
+ QString mName;
+ bool mIsWidget;
+ QObject *mReceiver;
+ const char *mDocml;
+ const char *mSection;
+ const char *mMember;
+ int mPhase;
+};
+
+#endif//VIDEOCOLLECTIONUILOADERDEF_H
--- a/videocollection/videocollectionview/inc/videocollectionviewutils.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/inc/videocollectionviewutils.h Mon May 03 12:32:50 2010 +0300
@@ -19,6 +19,7 @@
#define __VIDEOCOLLECTIONVIEWUTILS_H__
#include <qobject.h>
+#include "videocollectioncommon.h"
class HbListView;
class VideoSortFilterProxyModel;
@@ -44,7 +45,7 @@
* @param order The sorting order (e.g. ascending or descending).
* @return Zero if operation succeeded, less than zero in error cases.
*/
- int saveSortingValues(int role, Qt::SortOrder order);
+ int saveSortingValues(int role, Qt::SortOrder order, VideoCollectionCommon::TCollectionLevels target);
/**
* Loads the sorting role and order from cenrep.
@@ -53,7 +54,7 @@
* @param order On return contains the sorting order
* @return Zero if operation succeeded, less than zero in error cases.
*/
- int loadSortingValues(int& role, Qt::SortOrder& order);
+ int loadSortingValues(int& role, Qt::SortOrder& order, VideoCollectionCommon::TCollectionLevels target);
/**
* Get service icon resource strings from cenrep.
@@ -81,7 +82,7 @@
/**
* Initilizes model sort values.
*/
- static void sortModel(VideoSortFilterProxyModel *model, bool async);
+ static void sortModel(VideoSortFilterProxyModel *model, bool async, VideoCollectionCommon::TCollectionLevels target);
public slots:
@@ -112,10 +113,12 @@
private:
/** current sorting role */
- int mSortRole;
+ int mVideosSortRole;
+ int mCollectionsSortRole;
/** current sorting order */
- Qt::SortOrder mSortOrder;
+ Qt::SortOrder mVideosSortOrder;
+ Qt::SortOrder mCollectionsSortOrder;
};
#endif //__VIDEOCOLLECTIONUIUTILS_H__
--- a/videocollection/videocollectionview/inc/videolistselectiondialog.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistselectiondialog.h Mon May 03 12:32:50 2010 +0300
@@ -256,8 +256,18 @@
/**
* List widget to show in selection
- * */
+ */
VideoListWidget *mListWidget;
+
+ /**
+ * Action to accept the selection dialog.
+ */
+ HbAction *mPrimaryAction;
+
+ /**
+ * Action to cancel the selection dialog.
+ */
+ HbAction *mSecondaryAction;
};
#endif //VIDEOLISTSELECTIONDIALOG_H
--- a/videocollection/videocollectionview/inc/videolistview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistview.h Mon May 03 12:32:50 2010 +0300
@@ -38,7 +38,7 @@
class VideoListSelectionDialog;
class HbMenu;
class VideoServices;
-
+class TMPXItemId;
/**
* Class acts as an container for widgets that are used to display different
@@ -78,9 +78,10 @@
* Activates current widget to be shown, enables menu and connects
* orientation change signals.
*
+ * @param itemId, Id of the widget which is to be activated
* @return 0 activation ok, < 0 if activation fails
*/
- int activateView();
+ int activateView(const TMPXItemId &itemId);
/**
* Deactivates current widget, disables menu and disconnects
@@ -215,6 +216,11 @@
*
*/
void aboutToShowMainMenuSlot();
+
+ /**
+ * Prepare menu when videos used through browsing service.
+ */
+ void prepareBrowseServiceMenu();
/**
* Slot is connected into hbInstance's primary window's
@@ -263,11 +269,6 @@
void finishCollectionClosedSlot(const HbEffect::EffectStatus &status);
/**
- * Slot which is called when a widget has been loaded.
- */
- void widgetReadySlot(QGraphicsWidget *widget, const QString &name);
-
- /**
* Slot which is called when an object has been loaded.
*/
void objectReadySlot(QObject *object, const QString &name);
@@ -280,25 +281,6 @@
void debugNotImplementedYet();
private:
-
- /**
- * Delayed load of multiselection dialog component
- *
- */
- void loadMultiSelection();
-
- /**
- * Delayed load videolistwidgets
- *
- */
- void loadLists(bool doAsync);
-
- /**
- * Delayed load of hint components
- *
- */
- void loadHint(bool doAsync);
-
/**
* Cleans all possibly created objects from this. In some cases there are no quarantees
* that they were created correctly, and thus is better to start again from clean slate.
@@ -349,14 +331,14 @@
void showAction(bool show, const QString &name);
/**
- * Check if menu action is checked.
+ * Activate to all videos view.
*/
- bool isActionChecked(const QString &name);
+ int activateVideosView();
/**
- * Sets an action as checked.
+ * Activate to collection content view.
*/
- void setActionChecked(bool setChecked, const QString &name);
+ int activateCollectionContentView(const TMPXItemId &itemId);
private:
@@ -393,21 +375,6 @@
bool mIsService;
/**
- * Boolean for knowing wether the hint component has been loaded or not.
- */
- bool mHintLoaded;
-
- /**
- * Boolean for knowing wether the list widgets have been loaded or not.
- */
- bool mListsLoaded;
-
- /**
- * Boolean for knowing wether the multiselection component has been loaded or not.
- */
- bool mMultiselectionLoaded;
-
- /**
* Boolean for knowing when the model is ready.
*/
bool mModelReady;
--- a/videocollection/videocollectionview/inc/videolistwidget.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/inc/videolistwidget.h Mon May 03 12:32:50 2010 +0300
@@ -150,13 +150,20 @@
void fileUri(const QString&);
protected slots:
+
/**
- * Signaled by the fw during long press and indicating that popupmenu
- * concerning particular item is to be opened.
+ * Signaled by the fw when item is long pressed.
+ * Popup menu for the particular item is opened.
* Saves current selected item's index to mCurrentIndex
*/
- void longPressGesture (const QPointF &point);
+ 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:
/**
@@ -172,12 +179,6 @@
void renameSlot();
/**
- * Signaled to play all items.
- *
- */
- void playAllSlot();
-
- /**
* Signaled to add an item into a collection.
*
*/
@@ -203,11 +204,10 @@
void openDetailsSlot();
/**
- * Signaled when the application has been lauched as a service and
- * playback is initialized from context menu.
- *
+ * Signaled when item's default functionality is initialized from context menu.
+ * Calls emitActivated for actually axecuting the functionality
*/
- void playItemSlot();
+ void openItemSlot();
/**
* slot is connected to view's doDelayeds -signal
@@ -255,13 +255,6 @@
*
*/
void fetchThumbnailsForVisibleItems();
-
- // TODO: following can be removed after all implementation ready
- /**
- * Slot is connected into item signals that are not yet implemented.
- * Slot shows "Not yet implemented" note
- */
- void debugNotImplementedYet();
private:
@@ -273,7 +266,8 @@
EActionAddToCollection,
EActionRemoveCollection,
EActionRename,
- EActionPlay
+ EActionPlay,
+ EActionOpen
};
/**
@@ -287,6 +281,11 @@
*
*/
void setContextMenu();
+
+ /**
+ * Method sets correct popup menu during browsing service.
+ */
+ void setBrowsingServiceContextMenu();
/**
* Method connects signals needed by the widget
@@ -300,6 +299,24 @@
*
*/
void disConnectSignals();
+
+ /**
+ * Return if this is a browsing service.
+ */
+ bool isBrowsingService() const;
+
+ /**
+ * Set navigation action.
+ */
+ void setNavigationAction();
+
+ /**
+ * handles single item activation. Either from
+ * user's single tap or from default action at context menu.
+ *
+ * @param index of item
+ */
+ void doActivateItem(const QModelIndex &index);
private:
@@ -336,14 +353,9 @@
bool mIsService;
/**
- * Navigation softkey action object for back.
+ * Navigation softkey action.
*/
- HbAction *mNavKeyBackAction;
-
- /**
- * Navigation softkey action object for quit.
- */
- HbAction *mNavKeyQuitAction;
+ HbAction *mNavKeyAction;
/**
* Item sensitive context menu
--- a/videocollection/videocollectionview/src/videocollectionuiloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionuiloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,9 @@
*
*/
+// Version : %version: 20 %
+
+// INCLUDE FILES
#include <qgraphicswidget.h>
#include <qaction.h>
#include <qactiongroup.h>
@@ -32,17 +35,19 @@
#include "videosortfilterproxymodel.h"
#include "videocollectionviewutils.h"
#include "videoservices.h"
+#include "videocollectiontrace.h"
// ---------------------------------------------------------------------------
// VideoCollectionUiLoader
// ---------------------------------------------------------------------------
//
-VideoCollectionUiLoader::VideoCollectionUiLoader():
- HbDocumentLoader(),
- mTimerId(0),
- mSortGroup(0),
- mIsService(false)
+VideoCollectionUiLoader::VideoCollectionUiLoader()
+ : HbDocumentLoader()
+ , mTimerId( 0 )
+ , mSortGroup( 0 )
+ , mIsService( false )
{
+ FUNC_LOG;
}
// ---------------------------------------------------------------------------
@@ -51,247 +56,132 @@
//
VideoCollectionUiLoader::~VideoCollectionUiLoader()
{
+ FUNC_LOG;
+
+ // delete objects without a parent
+ while (!mOrphans.isEmpty())
+ {
+ delete mOrphans.takeFirst();
+ }
+
+ // kill timer if running
if (mTimerId)
{
killTimer(mTimerId);
mTimerId = 0;
}
- // selection dialog needs to be deleted manually
- QGraphicsWidget *widget =
- HbDocumentLoader::findWidget(DOCML_NAME_DIALOG);
-
- VideoListSelectionDialog *dialog =
- qobject_cast<VideoListSelectionDialog*>(widget);
- delete dialog;
-
// clear queue and hash tables
mQueue.clear();
mDocmls.clear();
- mWidgets.clear();
+ mSections.clear();
mObjects.clear();
+ mPhases.clear();
}
// ---------------------------------------------------------------------------
// load
// ---------------------------------------------------------------------------
//
-QObjectList VideoCollectionUiLoader::load( const QString &fileName, bool *ok )
+void VideoCollectionUiLoader::load(const QString &fileName, bool *ok)
{
- QObjectList list;
+ FUNC_LOG;
if (!mDocmls.contains(fileName))
{
- mDocmls.append(fileName);
- list = HbDocumentLoader::load(fileName, ok);
- //TODO: save returned and delete on destructor
+ QObjectList list = HbDocumentLoader::load(fileName, ok);
+ if (ok && *ok)
+ {
+ mDocmls.insert(fileName);
+ }
+
+ // add objects without a parent to orphan list
+ storeOrphans(list);
}
- return list;
+ else
+ {
+ *ok = true;
+ }
}
// ---------------------------------------------------------------------------
// load
// ---------------------------------------------------------------------------
//
-QObjectList VideoCollectionUiLoader::load( const QString &fileName, const QString §ion , bool *ok )
+void VideoCollectionUiLoader::load(const QString &fileName,
+ const QString §ion,
+ bool *ok)
{
- return HbDocumentLoader::load(fileName, section, ok);
- //TODO: save returned and delete on destructor
+ FUNC_LOG;
+ if (!mSections.contains(section))
+ {
+ QObjectList list = HbDocumentLoader::load(fileName, section, ok);
+ if (ok && *ok)
+ {
+ mSections.insert(section);
+ }
+
+ // add objects without a parent to orphan list
+ storeOrphans(list);
+ }
+ else
+ {
+ *ok = true;
+ }
}
// ---------------------------------------------------------------------------
-// startLoading
+// addData
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionUiLoader::addData(
+ QList<VideoCollectionUiLoaderParam> params,
+ QObject *receiver,
+ const char *slot)
+{
+ FUNC_LOG;
+ // go through all parameters and add then in to the queue
+ foreach (VideoCollectionUiLoaderParam param, params)
+ {
+ addToQueue(param, receiver, slot);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// loadPhase
// ---------------------------------------------------------------------------
//
-void VideoCollectionUiLoader::startLoading(QSet<QString> uiSections,
- QObject *receiver,
- const char *widgetSlot,
- const char *objectSlot)
+void VideoCollectionUiLoader::loadPhase(int loadPhase)
{
- if (uiSections.contains(DOCML_NAME_VC_HEADINGBANNER))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_VC_HEADINGBANNER,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_VC_VIDEOLISTWIDGET))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_VC_VIDEOLISTWIDGET,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_OPTIONS_MENU))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_OPTIONS_MENU,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_ADD_TO_COLLECTION))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_ADD_TO_COLLECTION,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_CREATE_COLLECTION))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_CREATE_COLLECTION,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_DELETE_MULTIPLE))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_DELETE_MULTIPLE,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_VC_VIDEOHINTWIDGET))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_VC_VIDEOHINTWIDGET,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_HINT_BUTTON))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_HINT_BUTTON,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_NO_VIDEOS_LABEL))
+ FUNC_LOG;
+ if (!mPhases.contains(loadPhase))
{
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_NO_VIDEOS_LABEL,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_SORT_BY_DATE))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_SORT_BY_DATE,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
+ mPhases.insert(loadPhase);
+ if (!mTimerId)
+ {
+ runNext();
+ }
}
- if (uiSections.contains(DOCML_NAME_SORT_BY_NAME))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_SORT_BY_NAME,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_SORT_BY_SIZE))
+}
+
+// ---------------------------------------------------------------------------
+// removeOrphanFromList
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionUiLoader::removeOrphanFromList(QObject *object)
+{
+ FUNC_LOG;
+ // remove from orphan list
+ if (mOrphans.contains(object))
{
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_SORT_BY_SIZE,
- false, // is object
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- objectSlot);
- addToQueue(params);
+ mOrphans.removeOne(object);
}
- if (uiSections.contains(DOCML_NAME_SORT_MENU))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_SORT_MENU,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- 0,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_VC_COLLECTIONWIDGET))
+
+ // remove from initialized objects list
+ const QString &name = mObjects.key(object);
+ if (!name.isEmpty())
{
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_VC_COLLECTIONWIDGET,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET))
- {
- VideoCollectionUiLoader::Params params(
- DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
- true, // is widget
- receiver,
- DOCML_VIDEOCOLLECTIONVIEW_FILE,
- DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
- widgetSlot);
- addToQueue(params);
- }
- if (uiSections.contains(DOCML_NAME_DIALOG))
- {
- VideoCollectionUiLoader::Params params(DOCML_NAME_DIALOG,
- true, // is widget
- receiver,
- DOCML_VIDEOSELECTIONDIALOG_FILE,
- 0,
- widgetSlot);
- addToQueue(params);
+ // found from list, remove
+ mObjects.remove(name);
}
}
@@ -301,6 +191,7 @@
//
void VideoCollectionUiLoader::setIsService(bool isService)
{
+ FUNC_LOG;
mIsService = isService;
}
@@ -310,82 +201,36 @@
//
QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name)
{
+ FUNC_LOG;
QGraphicsWidget *widget = 0;
// 1. check from hash
- if (mWidgets.contains(name))
+ if (mObjects.contains(name))
{
- widget = mWidgets.value(name);
+ widget = qobject_cast<QGraphicsWidget*>(mObjects.value(name));
}
-
- // 2. load from document
+
+ // 2. load from document and initialize
else
{
- widget = HbDocumentLoader::findWidget(name);
- if (!widget)
+ // find object from queue
+ int index = indexInQueue(name);
+ if (index != -1)
{
- // check if the widget is being loaded and remove it from queue
- int count = mQueue.count();
- for (int i = 0; i < count; i++)
- {
- const Params& params = mQueue.at(i);
- if (params.mName.compare(name) == 0)
- {
- bool ok(true);
-
- if(!mDocmls.contains(params.mDocml))
- {
- load(params.mDocml, &ok);
-
- if (ok)
- {
- mDocmls.append(params.mDocml);
- }
- }
- if ((params.mSection != 0) && ok)
- {
- load(params.mDocml, params.mSection, &ok);
- }
- if(ok)
- {
- widget = HbDocumentLoader::findWidget(params.mName);
- }
- break;
- }
- }
+ // object found from queue, load and initialize object
+ const VideoCollectionUiLoaderParam ¶m = mQueue.at(index);
+ widget = qobject_cast<QGraphicsWidget*>(executeRequest(param));
+
+ // object in loading queue, remove it
+ removeFromQueue(name);
}
- if (widget)
+ else
{
- // initialize widget
- initWidget(widget, name);
-
- // add it to the hash
- mWidgets.insert(name, widget);
-
- // check if the widget is being loaded and remove it from queue
- int count = mQueue.count();
- for (int i = 0; i < count; i++)
- {
- const Params& params = mQueue.at(i);
- if (params.mName.compare(name) == 0)
- {
- if (connect(
- this, SIGNAL(widgetReady(QGraphicsWidget*, const QString&)),
- params.mReceiver, params.mMember))
- {
- emit widgetReady(widget, params.mName);
- disconnect(
- this, SIGNAL(widgetReady(QGraphicsWidget*, const QString&)),
- params.mReceiver, params.mMember);
- }
- mQueue.removeAt(i);
- runNext(); //removes timer if queue is empty
- break;
- }
- }
+ // assuming that docml and section has already been loaded
+ widget = HbDocumentLoader::findWidget(name);
}
}
-
+
return widget;
}
@@ -395,6 +240,7 @@
//
QObject* VideoCollectionUiLoader::doFindObject(const QString &name)
{
+ FUNC_LOG;
QObject *object = 0;
// 1. check from hash
@@ -402,75 +248,28 @@
{
object = mObjects.value(name);
}
-
- // 2. load from document and cancel async loading
+
+ // 2. load from document and initialize
else
{
- object = HbDocumentLoader::findObject(name);
- if (!object)
+ // find object from queue
+ int index = indexInQueue(name);
+ if (index != -1)
{
- // check if the object is being loaded and remove it from queue
- int count = mQueue.count();
- for (int i = 0; i < count; i++)
- {
- const Params& params = mQueue.at(i);
- if (params.mName.compare(name) == 0)
- {
- bool ok(true);
-
- if(!mDocmls.contains(params.mDocml))
- {
- load(params.mDocml, &ok);
-
- if (ok)
- {
- mDocmls.append(params.mDocml);
- }
- }
- if ((params.mSection != 0) && ok)
- {
- load(params.mDocml, params.mSection, &ok);
- }
- if(ok)
- {
- object = HbDocumentLoader::findObject(params.mName);
- }
- break;
- }
- }
+ // object found from queue, load and initialize object
+ const VideoCollectionUiLoaderParam ¶m = mQueue.at(index);
+ object = executeRequest(param);
+
+ // object in loading queue, remove it
+ removeFromQueue(name);
}
- if (object)
+ else
{
- // initialize widget
- initObject(object, name);
-
- // add it to the hash
- mObjects.insert(name, object);
-
- // check if the object is being loaded and remove it from queue
- int count = mQueue.count();
- for (int i = 0; i < count; i++)
- {
- const Params& params = mQueue.at(i);
- if (params.mName.compare(name) == 0)
- {
- if (connect(
- this, SIGNAL(objectReady(QObject*, const QString&)),
- params.mReceiver, params.mMember))
- {
- emit objectReady(object, params.mName);
- disconnect(
- this, SIGNAL(objectReady(QObject*, const QString&)),
- params.mReceiver, params.mMember);
- }
- mQueue.removeAt(i);
- runNext(); //removes timer if queue is empty
- break;
- }
- }
+ // assuming that docml and section has already been loaded
+ object = HbDocumentLoader::findObject(name);
}
}
-
+
return object;
}
@@ -478,39 +277,105 @@
// addToQueue
// ---------------------------------------------------------------------------
//
-void VideoCollectionUiLoader::addToQueue(Params ¶ms)
+void VideoCollectionUiLoader::addToQueue(VideoCollectionUiLoaderParam ¶m,
+ QObject *receiver,
+ const char *slot)
{
- if (isValid(params))
+ FUNC_LOG;
+
+ INFOQSTR_1("VideoCollectionUiLoader::addToQueue() name: %S", param.mName);
+
+ // set receiver if not already set
+ if (!param.mReceiver)
+ {
+ param.mReceiver = receiver;
+ }
+
+ // set slot if not already set
+ if (!param.mMember)
+ {
+ param.mMember = slot;
+ }
+
+ // check validity and hit it
+ if (isValid(param))
{
// add the params in async queue
- mQueue.append(params);
- runNext();
+ mQueue.append(param);
}
}
// ---------------------------------------------------------------------------
-// initWidget
+// getObject
+// ---------------------------------------------------------------------------
+//
+QObject* VideoCollectionUiLoader::getObject(
+ const VideoCollectionUiLoaderParam ¶m)
+{
+ FUNC_LOG;
+ QObject *object = 0;
+
+ if (param.mIsWidget)
+ {
+ object = HbDocumentLoader::findWidget(param.mName);
+ }
+ else
+ {
+ object = HbDocumentLoader::findObject(param.mName);
+ }
+
+ return object;
+}
+
+// ---------------------------------------------------------------------------
+// prepareDocmlAndSection
// ---------------------------------------------------------------------------
//
-void VideoCollectionUiLoader::initWidget(QGraphicsWidget *widget,
+bool VideoCollectionUiLoader::prepareDocmlAndSection(const char *docml,
+ const char *section)
+{
+ FUNC_LOG;
+ bool ok = true;
+
+ // prepare docml
+ if (docml && !mDocmls.contains(docml))
+ {
+ load(docml, &ok);
+ }
+
+ // prepare section
+ if (ok && section && !mSections.contains(section))
+ {
+ load(docml, section, &ok);
+ }
+
+ return ok;
+}
+
+// ---------------------------------------------------------------------------
+// initObject
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionUiLoader::initObject(QObject *object,
const QString &name)
{
- if (widget)
+ FUNC_LOG;
+ if (object)
{
+ INFOQSTR_1("VideoCollectionUiLoader::initObject() name: %S", name);
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
-
if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0)
{
- VideoListWidget *videoList = qobject_cast<VideoListWidget*>(widget);
+ VideoListWidget *videoList = qobject_cast<VideoListWidget*>(object);
if (videoList)
{
VideoSortFilterProxyModel *model =
- wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
if(model)
{
// open and sort model
model->open(VideoCollectionCommon::ELevelVideos);
- VideoCollectionViewUtils::sortModel(model, true);
+ VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelVideos);
// init widget
VideoServices *videoServices = 0;
@@ -525,14 +390,15 @@
else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0)
{
VideoSortFilterProxyModel *model = wrapper.getModel(
- VideoCollectionWrapper::ECollections);
+ VideoCollectionCommon::EModelTypeCollections);
if (model)
{
model->open(VideoCollectionCommon::ELevelCategory);
+ VideoCollectionViewUtils::sortModel(model, true, VideoCollectionCommon::ELevelCategory);
// initialize video collection widget
VideoListWidget *videoList =
- qobject_cast<VideoListWidget*>(widget);
+ qobject_cast<VideoListWidget*>(object);
if (videoList)
{
// init widget
@@ -548,10 +414,10 @@
else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0)
{
VideoSortFilterProxyModel *model = wrapper.getModel(
- VideoCollectionWrapper::ECollectionContent);
+ VideoCollectionCommon::EModelTypeCollectionContent);
if (model)
{
- VideoListWidget *videoList = qobject_cast<VideoListWidget*>(widget);
+ VideoListWidget *videoList = qobject_cast<VideoListWidget*>(object);
if (videoList)
{
// init widget
@@ -576,7 +442,7 @@
{
// by default, initialize the selection dialog to delete mode
VideoListSelectionDialog *dialog =
- qobject_cast<VideoListSelectionDialog*>(widget);
+ qobject_cast<VideoListSelectionDialog*>(object);
if (dialog)
{
dialog->setupContent(VideoListSelectionDialog::EDeleteVideos,
@@ -585,7 +451,7 @@
}
else if (name.compare(DOCML_NAME_SORT_MENU) == 0)
{
- HbMenu *menu = qobject_cast<HbMenu*>(widget);
+ HbMenu *menu = qobject_cast<HbMenu*>(object);
if (menu)
{
// create sort by menu action
@@ -617,7 +483,7 @@
}
else if (name.compare(DOCML_NAME_VC_VIDEOHINTWIDGET) == 0)
{
- VideoHintWidget *hintWidget = qobject_cast<VideoHintWidget*>(widget);
+ VideoHintWidget *hintWidget = qobject_cast<VideoHintWidget*>(object);
if (hintWidget)
{
hintWidget->initialize();
@@ -627,28 +493,16 @@
{
// ensure that all the actions related to options menu are loaded
// when options menu is loaded
- // when applicaton has been launched as a service,
- // do not load components which are not required
- if(!mIsService)
- {
- findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
- findObject<HbAction>(DOCML_NAME_CREATE_COLLECTION);
- findObject<HbAction>(DOCML_NAME_DELETE_MULTIPLE);
- }
+ // when applicaton has been launched as a service,
+ // do not load components which are not required
+ if(!mIsService)
+ {
+ findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
+ findObject<HbAction>(DOCML_NAME_CREATE_COLLECTION);
+ findObject<HbAction>(DOCML_NAME_DELETE_MULTIPLE);
+ }
}
- }
-}
-
-// ---------------------------------------------------------------------------
-// initObject
-// ---------------------------------------------------------------------------
-//
-void VideoCollectionUiLoader::initObject(QObject *object,
- const QString &name)
-{
- if (object)
- {
- if (name.compare(DOCML_NAME_ADD_TO_COLLECTION) == 0)
+ else if (name.compare(DOCML_NAME_ADD_TO_COLLECTION) == 0)
{
HbAction *action = qobject_cast<HbAction*>(object);
if (action)
@@ -708,126 +562,124 @@
}
// ---------------------------------------------------------------------------
+// executeRequest
+// ---------------------------------------------------------------------------
+//
+QObject* VideoCollectionUiLoader::executeRequest(
+ const VideoCollectionUiLoaderParam ¶m)
+{
+ FUNC_LOG;
+ QObject *object = getObject(param);
+ if (!object)
+ {
+ // object was not found, try preparing docml and section
+ bool ok = prepareDocmlAndSection(param.mDocml, param.mSection);
+ if (ok)
+ {
+ // try to get the object again
+ object = getObject(param);
+ }
+ }
+
+ // initialize object if it was found from docml
+ if (object)
+ {
+ if (!mObjects.contains(param.mName))
+ {
+ // initialize object
+ initObject(object, param.mName);
+
+ // insert object in hash table
+ mObjects.insert(param.mName, object);
+ }
+
+ bool ok = connect(
+ this, SIGNAL(objectReady(QObject*, const QString&)),
+ param.mReceiver, param.mMember);
+ if (ok)
+ {
+ // signal client and disconnect
+ emit objectReady(object, param.mName);
+ disconnect(
+ this, SIGNAL(objectReady(QObject*, const QString&)),
+ param.mReceiver, param.mMember);
+ }
+ }
+
+ return object;
+}
+
+// ---------------------------------------------------------------------------
+// indexInQueue
+// ---------------------------------------------------------------------------
+//
+int VideoCollectionUiLoader::indexInQueue(const QString &name)
+{
+ FUNC_LOG;
+ int index = -1;
+
+ int count = mQueue.count();
+ for (int i = 0; i < count; i++)
+ {
+ const VideoCollectionUiLoaderParam ¶m = mQueue.at(i);
+ if (param.mName == name)
+ {
+ // found from queue
+ index = i;
+ break;
+ }
+ }
+
+ return index;
+}
+
+// ---------------------------------------------------------------------------
+// removeFromQueue
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionUiLoader::removeFromQueue(const QString &name)
+{
+ FUNC_LOG;
+ int count = mQueue.count();
+ for (int i = 0; i < count; i++)
+ {
+ const VideoCollectionUiLoaderParam ¶m = mQueue.at(i);
+ if (param.mName == name)
+ {
+ mQueue.removeAt(i);
+ break;
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
// timerEvent
// ---------------------------------------------------------------------------
//
void VideoCollectionUiLoader::timerEvent(QTimerEvent *event)
{
+ FUNC_LOG;
if (event)
{
if (event->timerId() == mTimerId)
{
- // get current request from queue
- const Params ¶ms = mQueue.at(0);
-
- // load the widget / object
- if (params.mIsWidget)
+ // get current request from queue and execute it
+ int count = mQueue.count();
+ for (int i = 0; i < count; i++)
{
- // correct timer id, emit signal for receiver
- bool ok = connect(
- this, SIGNAL(widgetReady(QGraphicsWidget*, const QString&)),
- params.mReceiver, params.mMember);
- if (ok)
+ const VideoCollectionUiLoaderParam ¶m = mQueue.at(i);
+ if (mPhases.contains(param.mPhase))
{
- QGraphicsWidget *widget =
- HbDocumentLoader::findWidget(params.mName);
- if (!widget)
- {
- // widget not found, try to load the docml
- if(!mDocmls.contains(params.mDocml))
- {
- load(params.mDocml, &ok);
-
- if (ok)
- {
- mDocmls.append(params.mDocml);
- }
- }
- if ((params.mSection != 0) && ok)
- {
- load(params.mDocml, params.mSection, &ok);
- }
- if(ok)
- {
- widget = HbDocumentLoader::findWidget(params.mName);
- }
- }
- if (widget)
- {
- // widget found, add it to the hash
- if (!mWidgets.contains(params.mName))
- {
- // initialize widget
- initWidget(widget, params.mName);
-
- // insert widget in hash table
- mWidgets.insert(params.mName, widget);
- }
- emit widgetReady(widget, params.mName);
- }
+ // load and initialize
+ executeRequest(param);
+
+ // remove the current request from queue and run next
+ removeFromQueue(param.mName);
+ break;
}
-
- // disconnect
- disconnect(
- this, SIGNAL(widgetReady(QGraphicsWidget*, const QString&)),
- params.mReceiver, params.mMember);
}
- else
- {
- // correct timer id, emit signal for receiver
- bool ok = connect(
- this, SIGNAL(objectReady(QObject*, const QString&)),
- params.mReceiver, params.mMember);
- if (ok)
- {
- QObject *object =
- HbDocumentLoader::findObject(params.mName);
- if (!object)
- {
- // widget not found, try to load the docml
- if(!mDocmls.contains(params.mDocml))
- {
- load(params.mDocml, &ok);
-
- if (ok)
- {
- mDocmls.append(params.mDocml);
- }
- }
- if ((params.mSection != 0) && ok)
- {
- load(params.mDocml, params.mSection, &ok);
- }
- if(ok)
- {
- object = HbDocumentLoader::findObject(params.mName);
- }
- }
- if (object)
- {
- // object found, add it to the hash
- if (!mObjects.contains(params.mName))
- {
- // initialize object
- initObject(object, params.mName);
-
- // add object in hash table
- mObjects.insert(params.mName, object);
- }
- emit objectReady(object, params.mName);
- }
- }
-
- // disconnect
- disconnect(
- this, SIGNAL(objectReady(QObject*, const QString&)),
- params.mReceiver, params.mMember);
- }
+ runNext();
}
-
- // remove the request from the queue and run next request if any
- mQueue.removeAt(0);
- runNext();
}
}
@@ -837,6 +689,7 @@
//
QObject* VideoCollectionUiLoader::createObject( const QString& type, const QString &name )
{
+ FUNC_LOG;
QObject* object = 0;
if ( type == VideoListView::staticMetaObject.className() )
@@ -870,7 +723,20 @@
//
void VideoCollectionUiLoader::runNext()
{
- if (mQueue.count())
+ FUNC_LOG;
+ bool runNext = false;
+ int count = mQueue.count();
+ for (int i = 0; i < count; i++)
+ {
+ const VideoCollectionUiLoaderParam ¶m = mQueue.at(i);
+ if (mPhases.contains(param.mPhase))
+ {
+ runNext = true;
+ break;
+ }
+ }
+
+ if (runNext)
{
if (!mTimerId)
{
@@ -893,21 +759,22 @@
// isValid
// ---------------------------------------------------------------------------
//
-bool VideoCollectionUiLoader::isValid(const Params ¶ms)
+bool VideoCollectionUiLoader::isValid(const VideoCollectionUiLoaderParam ¶m)
{
bool valid = true;
- if (params.mName.length() &&
- params.mDocml &&
- params.mMember &&
- params.mReceiver)
+ if (param.mName.length() &&
+ param.mDocml &&
+ param.mMember &&
+ param.mReceiver)
{
// check if the param is already in the queue
int count = mQueue.count();
for (int i = 0; i < count; i++)
{
- if (mQueue.at(i).isDuplicate(params))
+ if (mQueue.at(i) == param)
{
+ INFO("VideoCollectionUiLoader::isValid() already in queue.");
valid = false;
break;
}
@@ -916,20 +783,39 @@
// check that the item has not already been loaded
if (valid)
{
- if (params.mIsWidget)
- {
- valid = !mWidgets.contains(params.mName);
- }
- else
- {
- valid = !mObjects.contains(params.mName);
- }
+ valid = !mObjects.contains(param.mName);
}
}
else
{
+ INFO("VideoCollectionUiLoader::isValid() params missing.");
valid = false;
}
return valid;
}
+
+// ---------------------------------------------------------------------------
+// storeOrphans
+// ---------------------------------------------------------------------------
+//
+void VideoCollectionUiLoader::storeOrphans(const QObjectList &list)
+{
+ FUNC_LOG;
+ foreach (QObject *object, list)
+ {
+ if (!mOrphans.contains(object))
+ {
+ // add to list
+ mOrphans.append(object);
+
+ // connect to "destroyed" signal
+ connect(
+ object, SIGNAL(destroyed(QObject*)),
+ this, SLOT(removeOrphanFromList(QObject*)));
+ }
+ }
+}
+
+// end of file
+
--- a/videocollection/videocollectionview/src/videocollectionviewplugin.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionviewplugin.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,28 +15,35 @@
*
*/
+// Version : %version: %
+
// INCLUDE FILES
#include <xqplugin.h>
#include <xqserviceutil.h>
#include <hbaction.h>
#include <hbapplication.h>
#include <hbinstance.h>
+#include <mpxitemid.h>
+#include "videoservices.h"
+#include "vcxmyvideosdefs.h"
#include "videocollectionviewplugin.h"
#include "videolistview.h"
#include "videocollectionuiloader.h"
#include "mpxhbvideocommondefs.h"
+#include "videocollectiontrace.h"
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
VideoCollectionViewPlugin::VideoCollectionViewPlugin()
- : mUiLoader(0),
- mView(0),
- mActivated(false),
- mIsService(false)
+ : mUiLoader( 0 )
+ , mView( 0 )
+ , mActivated( false )
+ , mIsService( false )
{
+ FUNC_LOG;
}
// ---------------------------------------------------------------------------
@@ -45,6 +52,7 @@
//
VideoCollectionViewPlugin::~VideoCollectionViewPlugin()
{
+ FUNC_LOG;
destroyView();
}
@@ -54,6 +62,7 @@
//
void VideoCollectionViewPlugin::createView()
{
+ FUNC_LOG;
mActivated = false;
if ( !mView ) {
@@ -66,16 +75,17 @@
if (XQServiceUtil::isService())
{
- mIsService = true;
+ INFO("VideoCollectionViewPlugin::createView() service flag set to true.");
+ mIsService = true;
}
mUiLoader->setIsService(mIsService);
bool ok(false);
- QList<QObject *> objects = mUiLoader->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
-
- if (!ok)
+ mUiLoader->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+
+ if (!ok)
{
return;
}
@@ -84,13 +94,13 @@
if(!mView)
{
- // TODO: handle error: creating view
+ ERROR(-1, "VideoCollectionViewPlugin::createView() failed to create view.");
return;
}
if(!connect( mView, SIGNAL(command(int)), this, SIGNAL(command(int)) ) ||
!connect( this, SIGNAL(doDelayeds()), mView, SLOT(doDelayedsSlot()) )) {
- // TODO: handle error: connecting signal
+ ERROR(-1, "VideoCollectionViewPlugin::createView() failed to connect signals.");
delete mView;
mView = 0;
return;
@@ -107,6 +117,7 @@
//
void VideoCollectionViewPlugin::timerEvent(QTimerEvent *event)
{
+ FUNC_LOG;
if (event)
{
if (event->timerId() == mTimerId)
@@ -126,6 +137,7 @@
//
void VideoCollectionViewPlugin::destroyView()
{
+ FUNC_LOG;
deactivateView();
disconnect();
@@ -141,11 +153,35 @@
//
void VideoCollectionViewPlugin::activateView()
{
- if ( !mActivated ) {
+ FUNC_LOG;
+ if (!mActivated)
+ {
HbMainWindow *wnd = mView->mainWindow();
if(wnd)
{
- mView->activateView();
+ TMPXItemId itemId = TMPXItemId::InvalidId();
+ bool isService = XQServiceUtil::isService();
+ if (isService)
+ {
+ VideoServices *videoServices = VideoServices::instance();
+ if (videoServices)
+ {
+ VideoServices::TVideoService serviceType =
+ videoServices->currentService();
+ if (serviceType == VideoServices::EBrowse)
+ {
+ // activate browsing service
+ itemId.iId1 = videoServices->getBrowseCategory();
+ itemId.iId2 = KVcxMvcMediaTypeCategory;
+ }
+ }
+ }
+ int err = mView->activateView(itemId);
+ if (err != 0)
+ {
+ // TODO: what to do if error?
+ return;
+ }
mActivated = true;
}
}
@@ -157,6 +193,7 @@
//
void VideoCollectionViewPlugin::deactivateView()
{
+ FUNC_LOG;
if ( mActivated ) {
mView->deactivateView();
mActivated = false;
@@ -169,17 +206,19 @@
//
QGraphicsWidget* VideoCollectionViewPlugin::getView()
{
+ FUNC_LOG;
return mView;
}
// ---------------------------------------------------------------------------
// Slot: Orientation change
-// // TODO: can be removed
// ---------------------------------------------------------------------------
//
-void VideoCollectionViewPlugin::orientationChange( Qt::Orientation /* orientation */ )
+void VideoCollectionViewPlugin::orientationChange( Qt::Orientation orientation)
{
+ FUNC_LOG;
// view handles orientation individually
+ Q_UNUSED(orientation);
}
// ---------------------------------------------------------------------------
@@ -188,6 +227,7 @@
//
void VideoCollectionViewPlugin::back()
{
+ FUNC_LOG;
if ( mActivated ) {
mView->back();
}
--- a/videocollection/videocollectionview/src/videocollectionviewutils.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videocollectionviewutils.cpp Mon May 03 12:32:50 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -12,26 +12,33 @@
* Contributors:
*
* Description: video collection view plugin's ui utils class
-*
+*
*/
+// Version : %version: 37 %
+
+// INCLUDE FILES
+#include <hbglobal.h>
#include <hblistview.h>
#include <hbscrollbar.h>
#include <hblistviewitem.h>
#include <hbdialog.h>
#include <hbmessagebox.h>
+#include <hbnotificationdialog.h>
#include <centralrepository.h>
#include "videocollectioncommon.h"
#include "videocollectionviewutils.h"
#include "videosortfilterproxymodel.h"
+#include "videocollectiontrace.h"
const int KVideoCollectionViewCenrepUid(0x2002BC63);
const int KVideoCollectionViewCenrepServiceIconKey(0x2);
const int KVideoCollectionViewCenrepServiceIconPressedKey(0x3);
-const int KVideoCollectionViewCenrepServiceUriKey(0x4);
-const int KVideoCollectionViewCenrepSortingRoleKey(0x5);
-const int KVideoCollectionViewCenrepSortingOrderKey(0x6);
+const int KVideoCollectionViewCenrepVideoSortingRoleKey(0x5);
+const int KVideoCollectionViewCenrepVideoSortingOrderKey(0x6);
+const int KVideoCollectionViewCenrepCollectionsSortingRoleKey(0x7);
+const int KVideoCollectionViewCenrepCollectionsSortingOrderKey(0x8);
// ---------------------------------------------------------------------------
// instance
@@ -39,6 +46,7 @@
//
VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
{
+ FUNC_LOG;
static VideoCollectionViewUtils _popupInstance;
return _popupInstance;
}
@@ -48,10 +56,13 @@
// ---------------------------------------------------------------------------
//
VideoCollectionViewUtils::VideoCollectionViewUtils():
- mSortRole(-1),
- mSortOrder(Qt::AscendingOrder)
+ mVideosSortRole(-1),
+ mCollectionsSortRole(-1),
+ mVideosSortOrder(Qt::AscendingOrder),
+ mCollectionsSortOrder(Qt::AscendingOrder)
{
-
+ FUNC_LOG;
+
}
// ---------------------------------------------------------------------------
@@ -60,6 +71,7 @@
//
VideoCollectionViewUtils::~VideoCollectionViewUtils()
{
+ FUNC_LOG;
}
@@ -67,24 +79,45 @@
// saveSortingValues
// ---------------------------------------------------------------------------
//
-int VideoCollectionViewUtils::saveSortingValues(int role, Qt::SortOrder order)
+int VideoCollectionViewUtils::saveSortingValues(int role, Qt::SortOrder order, VideoCollectionCommon::TCollectionLevels target)
{
+ FUNC_LOG;
+ INFO_3("VideoCollectionViewUtils::saveSortingValues() saving: role: %d, order: %d, target: %d", role, order, target);
+
int status = -1;
- CRepository *cenRep = 0;
- TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
- if(cenRep)
- {
- status = cenRep->Set(KVideoCollectionViewCenrepSortingRoleKey, static_cast<TInt>(role));
- if(status == KErrNone)
- {
- status = cenRep->Set(KVideoCollectionViewCenrepSortingOrderKey, static_cast<TInt>(order));
- }
- delete cenRep;
- }
-
- mSortRole = role;
- mSortOrder = order;
-
+ if (target != VideoCollectionCommon::ELevelInvalid)
+ {
+ CRepository *cenRep = 0;
+ TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
+
+ int *rolePtr = &mVideosSortRole;
+ Qt::SortOrder *orderPtr = &mVideosSortOrder;
+
+ int roleKey(KVideoCollectionViewCenrepVideoSortingRoleKey);
+ int orderKey(KVideoCollectionViewCenrepVideoSortingOrderKey);
+
+ if(target == VideoCollectionCommon::ELevelCategory)
+ {
+ rolePtr = &mCollectionsSortRole;
+ orderPtr = &mCollectionsSortOrder;
+
+ roleKey = KVideoCollectionViewCenrepCollectionsSortingRoleKey;
+ orderKey = KVideoCollectionViewCenrepCollectionsSortingOrderKey;
+ }
+
+ if(cenRep)
+ {
+ status = cenRep->Set(roleKey, static_cast<TInt>(role));
+ if(status == KErrNone)
+ {
+ status = cenRep->Set(orderKey, static_cast<TInt>(order));
+ }
+ delete cenRep;
+ }
+
+ *rolePtr = role;
+ *orderPtr = order;
+ }
return status;
}
@@ -92,45 +125,72 @@
// loadSortingValues
// ---------------------------------------------------------------------------
//
-int VideoCollectionViewUtils::loadSortingValues(int &role, Qt::SortOrder &order)
+int VideoCollectionViewUtils::loadSortingValues(int &role, Qt::SortOrder &order, VideoCollectionCommon::TCollectionLevels target)
{
+ FUNC_LOG;
int err(0);
-
- if (mSortRole == -1)
+
+ if ((target > VideoCollectionCommon::ELevelCategory) &&
+ (mVideosSortRole != -1))
+ {
+ role = mVideosSortRole;
+ order = mVideosSortOrder;
+ }
+ else if ((target == VideoCollectionCommon::ELevelCategory) &&
+ (mCollectionsSortRole != -1))
{
- CRepository *cenRep = 0;
- TRAP(err, cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
- if(cenRep)
+ role = mCollectionsSortRole;
+ order = mCollectionsSortOrder;
+ }
+ else if (target != VideoCollectionCommon::ELevelInvalid)
+ {
+ int *rolePtr = &mVideosSortRole;
+ Qt::SortOrder *orderPtr = &mVideosSortOrder;
+ int roleKey(KVideoCollectionViewCenrepVideoSortingRoleKey);
+ int orderKey(KVideoCollectionViewCenrepVideoSortingOrderKey);
+
+ if(target == VideoCollectionCommon::ELevelCategory)
{
- int sortRole(-1);
- int sortOrder(-1);
- err = cenRep->Get(KVideoCollectionViewCenrepSortingRoleKey, sortRole);
- if(err == KErrNone)
- {
- mSortRole = sortRole;
- err = cenRep->Get(KVideoCollectionViewCenrepSortingOrderKey, sortOrder);
- if(err == KErrNone)
- {
- mSortOrder = static_cast<Qt::SortOrder>(sortOrder);
- }
- }
- delete cenRep;
+ roleKey = KVideoCollectionViewCenrepCollectionsSortingRoleKey;
+ orderKey = KVideoCollectionViewCenrepCollectionsSortingOrderKey;
+ rolePtr = &mCollectionsSortRole;
+ orderPtr = &mCollectionsSortOrder;
}
+
+ CRepository *cenRep = 0;
+ TRAP(err, cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
+ if(cenRep)
+ {
+ int sortRole(-1);
+ int sortOrder(-1);
+ err = cenRep->Get(roleKey, sortRole);
+ if(err == KErrNone)
+ {
+ err = cenRep->Get(orderKey, sortOrder);
+ if(err == KErrNone)
+ {
+ *orderPtr = static_cast<Qt::SortOrder>(sortOrder);
+ *rolePtr = sortRole;
+ }
+ }
+ delete cenRep;
+ }
+
+ role = *rolePtr;
+ order = *orderPtr;
}
-
- role = mSortRole;
- order = mSortOrder;
-
- return err;
+ INFO_3("VideoCollectionViewUtils::loadSortingValues() loaded: role: %d, order: %d, target: %d", role, order, target);
+ return err;
}
// ---------------------------------------------------------------------------
// getServiceIconStrings
// ---------------------------------------------------------------------------
//
-int VideoCollectionViewUtils::getServiceIconStrings(QString& icon,
+int VideoCollectionViewUtils::getServiceIconStrings(QString& icon,
QString& iconPressed)
{
+ FUNC_LOG;
int status = -1;
CRepository *cenRep = 0;
TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
@@ -146,14 +206,14 @@
{
QString iconTemp((QChar*)iconValue.Ptr(),iconValue.Length());
QString pressedTemp((QChar*)pressedValue.Ptr(),pressedValue.Length());
-
+
icon = iconTemp;
iconPressed = pressedTemp;
}
}
delete cenRep;
}
- return status;
+ return status;
}
// ---------------------------------------------------------------------------
@@ -162,6 +222,7 @@
//
QString VideoCollectionViewUtils::getServiceUriString()
{
+ FUNC_LOG;
QString uri;
CRepository *cenRep = 0;
TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
@@ -175,7 +236,7 @@
}
delete cenRep;
}
- return uri;
+ return uri;
}
// ---------------------------------------------------------------------------
@@ -184,6 +245,7 @@
//
void VideoCollectionViewUtils::initListView(HbListView *view)
{
+ FUNC_LOG;
if (view)
{
HbListViewItem *prototype = view->listItemPrototype();
@@ -194,7 +256,7 @@
}
view->setItemRecycling(true);
view->setClampingStyle(HbScrollArea::BounceBackClamping);
- view->setScrollingStyle(HbScrollArea::PanOrFlick);
+ view->setScrollingStyle(HbScrollArea::PanWithFollowOn);
view->setFrictionEnabled(true);
view->setUniformItemSizes(true);
view->setSelectionMode(HbAbstractItemView::NoSelection);
@@ -214,19 +276,29 @@
//
void VideoCollectionViewUtils::sortModel(
VideoSortFilterProxyModel *model,
- bool async)
+ bool async,
+ VideoCollectionCommon::TCollectionLevels target)
{
+ FUNC_LOG;
if (model)
{
// setup sorting order for model
int sortRole(VideoCollectionCommon::KeyDateTime);
+
+ // default for categories
+ if(target == VideoCollectionCommon::ELevelCategory)
+ {
+ sortRole = VideoCollectionCommon::KeyTitle;
+ }
+
Qt::SortOrder sortOrder(Qt::AscendingOrder);
-
+
// return value ignored, as in case of error the sortRole and sortOrder variables
// stay at their predefined values, and in error cases those are the sorting values
// that are used.
VideoCollectionViewUtils &self = VideoCollectionViewUtils::instance();
- self.loadSortingValues(sortRole, sortOrder);
+ self.loadSortingValues(sortRole, sortOrder, target);
+
model->doSorting(sortRole, sortOrder, async);
}
}
@@ -237,6 +309,7 @@
//
void VideoCollectionViewUtils::showStatusMsgSlot(int statusCode, QVariant &additional)
{
+ FUNC_LOG;
QString msg("");
QString format("");
bool error(true);
@@ -253,14 +326,14 @@
msg = hbTrId("txt_videos_info_unable_to_delete_some_items_which");
break;
case VideoCollectionCommon::statusSingleRemoveFail:
- format = tr("Unable to remove collection %1."); //localisation
+ format = hbTrId("txt_videos_info_unable_to_remove_collection_1");
if(additional.isValid())
{
msg = format.arg(additional.toString());
}
break;
case VideoCollectionCommon::statusMultiRemoveFail:
- msg = tr("Unable to remove some collections."); //localisation
+ msg = hbTrId("txt_videos_info_unable_to_remove_some_collections");
break;
case VideoCollectionCommon::statusVideosAddedToCollection:
format = hbTrId("txt_videos_dpopinfo_videos_added_to_1");
@@ -271,7 +344,7 @@
error = false;
break;
case VideoCollectionCommon::statusAllVideosAlreadyInCollection:
- msg = tr("All videos already added to this collection."); //localisation
+ 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");
@@ -282,9 +355,9 @@
error = false;
break;
default: // no msg to show
- return;
+ return;
}
-
+
if(msg.count() > 0)
{
if(error)
@@ -293,9 +366,13 @@
}
else
{
- HbMessageBox::information(msg);
+ HbNotificationDialog *infoNote = new HbNotificationDialog();
+ infoNote->setAttribute(Qt::WA_DeleteOnClose);
+ // only title can be two rows for HbNotificationDialog
+ infoNote->setTitleTextWrapping(Hb::TextWordWrap);
+ infoNote->setTitle(msg);
+ infoNote->show();
}
-
- }
+ }
}
--- a/videocollection/videocollectionview/src/videohintwidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videohintwidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,9 @@
*
*/
+// Version : %version: 13 %
+
+// INCLUDE FILES
#include <hbpushbutton.h>
#include <hblabel.h>
#include <qgraphicsitem.h>
@@ -23,20 +26,22 @@
#include "videohintwidget.h"
#include "videocollectionuiloader.h"
#include "videocollectionviewutils.h"
+#include "videocollectiontrace.h"
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
-VideoHintWidget::VideoHintWidget(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent) :
-HbWidget(parent),
-mUiLoader(uiLoader),
-mServiceIcon(0),
-mAddVideosIcon(0),
-mCurrentLevel(AllVideos),
-mButtonShown(false),
-mActivated(false)
+VideoHintWidget::VideoHintWidget( VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent )
+ : HbWidget( parent )
+ , mUiLoader( uiLoader )
+ , mServiceIcon( 0 )
+ , mAddVideosIcon( 0 )
+ , mCurrentLevel( AllVideos )
+ , mButtonShown( false )
+ , mActivated( false )
{
+ FUNC_LOG;
// NOP
}
@@ -46,6 +51,7 @@
//
VideoHintWidget::~VideoHintWidget()
{
+ FUNC_LOG;
delete mServiceIcon;
delete mAddVideosIcon;
}
@@ -56,6 +62,7 @@
//
int VideoHintWidget::initialize()
{
+ FUNC_LOG;
VideoCollectionViewUtils& utils = VideoCollectionViewUtils::instance();
return utils.getServiceIconStrings(mServiceIconString, mServiceIconPressedString);
}
@@ -66,6 +73,8 @@
//
void VideoHintWidget::setLevel(HintLevel level)
{
+ FUNC_LOG;
+ INFO_1("VideoHintWidget::setLevel() level: %d", level);
mCurrentLevel = level;
if(mActivated) {
updateUiComponents();
@@ -78,6 +87,8 @@
//
void VideoHintWidget::setButtonShown(bool shown)
{
+ FUNC_LOG;
+ INFO_1("VideoHintWidget::setButtonShown() shown: %d", shown);
mButtonShown = shown;
if(mActivated) {
updateUiComponents();
@@ -90,6 +101,7 @@
//
void VideoHintWidget::orientationChangedSlot(Qt::Orientation targetOrientation)
{
+ FUNC_LOG;
Q_UNUSED(targetOrientation);
updateUiComponents();
}
@@ -100,6 +112,7 @@
//
void VideoHintWidget::activate()
{
+ FUNC_LOG;
if (!mActivated)
{
if(mServiceIconString.isEmpty() ||
@@ -116,7 +129,7 @@
mServiceIcon = new HbIcon(mServiceIconString);
mServiceIcon->setIconName(mServiceIconPressedString, QIcon::Normal, QIcon::On);
- mAddVideosIcon = new HbIcon(":/images/mono_video_addvideos.svg");
+ mAddVideosIcon = new HbIcon("qtg_mono_add_to_video_collection");
updateUiComponents();
@@ -132,6 +145,7 @@
//
void VideoHintWidget::deactivate()
{
+ FUNC_LOG;
if (mActivated)
{
mActivated = false;
@@ -168,6 +182,7 @@
//
void VideoHintWidget::updateUiComponents()
{
+ FUNC_LOG;
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
if (mainWnd)
{
--- a/videocollection/videocollectionview/src/videolistselectiondialog.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistselectiondialog.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,10 @@
*
*/
-#include <QGraphicsItem>
+// Version : %version: 22 %
+
+// INCLUDE FILES
+#include <qgraphicsitem.h>
#include <hblabel.h>
#include <hbcheckbox.h>
#include <hbaction.h>
@@ -31,6 +34,7 @@
#include "videocollectionwrapper.h"
#include "videocollectionviewutils.h"
#include "videocollectionclient.h"
+#include "videocollectiontrace.h"
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
@@ -46,38 +50,39 @@
// VideoListSelectionDialog
// ---------------------------------------------------------------------------
//
-VideoListSelectionDialog::VideoListSelectionDialog(VideoCollectionUiLoader *uiLoader,
- QGraphicsItem *parent) :
-HbDialog(parent),
-mUiLoader(uiLoader),
-mTypeOfSelection(-1),
-mHeading(0),
-mCheckboxContainer(0),
-mItemCount(0),
-mCheckBox(0),
-mListContainer(0),
-mForcedCheck(false),
-mModel(0),
-mListWidget(0)
+VideoListSelectionDialog::VideoListSelectionDialog( VideoCollectionUiLoader *uiLoader,
+ QGraphicsItem *parent)
+ : HbDialog( parent )
+ , mUiLoader( uiLoader )
+ , mTypeOfSelection( -1 )
+ , mHeading( 0 )
+ , mCheckboxContainer( 0 )
+ , mItemCount( 0 )
+ , mCheckBox( 0 )
+ , mListContainer( 0 )
+ , mForcedCheck( false )
+ , mModel( 0 )
+ , mListWidget( 0 )
+ , mPrimaryAction( 0 )
+ , mSecondaryAction( 0 )
{
+ FUNC_LOG;
setDismissPolicy(HbDialog::NoDismiss);
setTimeout(HbDialog::NoTimeout);
// create model for list widget
mModel =
VideoCollectionWrapper::instance().getModel(
- VideoCollectionWrapper::EGeneric);
+ VideoCollectionCommon::EModelTypeGeneric);
if (mModel)
{
// create list widget
mListWidget = new VideoListWidget(mUiLoader);
- if (mListWidget)
+ if(mListWidget->initialize(*mModel) < 0)
{
- if(mListWidget->initialize(*mModel) < 0)
- {
- delete mListWidget;
- mListWidget = 0;
- }
+ ERROR(-1, "VideoListSelectionDialog::VideoListSelectionDialog() failed to init list widget");
+ delete mListWidget;
+ mListWidget = 0;
}
}
}
@@ -88,6 +93,7 @@
//
VideoListSelectionDialog::~VideoListSelectionDialog()
{
+ FUNC_LOG;
delete mListWidget;
}
@@ -97,6 +103,8 @@
//
void VideoListSelectionDialog::setupContent(int type, TMPXItemId activeItem)
{
+ FUNC_LOG;
+ INFO_1("VideoListSelectionDialog::setupContent() type: %d", type);
if(type < EDeleteVideos || type > ESelectCollection)
{
return;
@@ -105,6 +113,7 @@
mTypeOfSelection = type;
if(!initDialog())
{
+ ERROR(-1, "VideoListSelectionDialog::setupContent() dialog init failed.");
return;
}
mSelection.clear();
@@ -140,9 +149,10 @@
//
bool VideoListSelectionDialog::initDialog()
{
+ FUNC_LOG;
if(!mModel)
{
- mModel = VideoCollectionWrapper::instance().getModel(VideoCollectionWrapper::EGeneric);
+ mModel = VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeGeneric);
if (!mModel)
{
return false;
@@ -158,6 +168,7 @@
mListWidget = new VideoListWidget(mUiLoader);
if(mListWidget->initialize(*mModel) < 0)
{
+ ERROR(-1, "VideoListSelectionDialog::initDialog() failed to setup VideoListWidget.");
delete mListWidget;
mListWidget = 0;
mListContainer = 0;
@@ -178,7 +189,6 @@
{
mCheckboxContainer = mUiLoader->findWidget<HbWidget>(DOCML_NAME_CHECK_CONTAINER);
}
-
if(!mItemCount)
{
mItemCount = mUiLoader->findWidget<HbLabel>(DOCML_NAME_LBL_SELECTION);
@@ -188,16 +198,20 @@
{
mCheckBox = mUiLoader->findWidget<HbCheckBox >(DOCML_NAME_MARKALL);
}
- if(!primaryAction())
+ // HbDialog connects actions to finished signal by default.
+ if(!mPrimaryAction)
{
- setPrimaryAction(new HbAction(hbTrId("txt_common_button_ok"), this));
+ mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok"));
+ addAction(mPrimaryAction);
}
- if(!secondaryAction())
+ if(!mSecondaryAction)
{
- setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), this));
+ mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
+ addAction(mSecondaryAction);
}
- if(!mListWidget || !mListContainer || !mHeading || !mCheckBox || !primaryAction() || !secondaryAction())
+ if(!mListContainer || !mHeading || !mCheckBox)
{
+ ERROR(-1, "VideoListSelectionDialog::initDialog() !mListContainer || !mHeading || !mCheckBox");
return false;
}
return true;
@@ -209,37 +223,37 @@
//
void VideoListSelectionDialog::activateSelection()
{
+ FUNC_LOG;
// "add to collection" and "remove from collection -selections needs
// additional functionality for primary key
if(mTypeOfSelection == EAddToCollection ||
mTypeOfSelection == ERemoveFromCollection)
{
- primaryAction()->disconnect(SIGNAL(triggered()));
- connect(primaryAction(), SIGNAL(triggered()), this, SLOT(primaryActionTriggeredSlot()));
+ mPrimaryAction->disconnect(SIGNAL(triggered()));
+ connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(primaryActionTriggeredSlot()));
}
QString headingTxt("");
QString primaryTxt("");
// create texts
switch(mTypeOfSelection)
{
- case EDeleteVideos:
- primaryTxt = hbTrId("txt_common_button_delete");
- break;
- case EAddToCollection:
- primaryTxt = hbTrId("txt_common_button_add");
- break;
- case ERemoveFromCollection:
- primaryTxt = hbTrId("txt_common_button_remove");
- break;
- case ESelectCollection:
- primaryTxt = hbTrId("txt_videos_button_new");
- break;
- default:
- break;
+ case EDeleteVideos:
+ primaryTxt = hbTrId("txt_common_button_delete");
+ break;
+ case EAddToCollection:
+ primaryTxt = hbTrId("txt_common_button_add");
+ break;
+ case ERemoveFromCollection:
+ primaryTxt = hbTrId("txt_common_button_remove");
+ break;
+ case ESelectCollection:
+ primaryTxt = hbTrId("txt_videos_button_new");
+ break;
+ default:
+ break;
}
- HbAction *primary = primaryAction();
- primary->setText(primaryTxt);
+ mPrimaryAction->setText(primaryTxt);
if(mTypeOfSelection == ESelectCollection)
{
@@ -250,7 +264,7 @@
// 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
- primary->setDisabled(true);
+ mPrimaryAction->setDisabled(true);
}
else
{
@@ -263,12 +277,12 @@
// 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
- primary->setDisabled(false);
+ mPrimaryAction->setDisabled(false);
}
mHeading->setPlainText(headingTxt);
// sort to make sure dialog has correctly filtered content
// at the same order as in view
- VideoCollectionViewUtils::sortModel(mModel, false);
+ VideoCollectionViewUtils::sortModel(mModel, false, mListWidget->getLevel());
}
// ---------------------------------------------------------------------------
@@ -277,6 +291,7 @@
//
void VideoListSelectionDialog::exec()
{
+ FUNC_LOG;
// clear checkbox
mCheckBox->setChecked(false);
@@ -294,8 +309,9 @@
}
else
{
+ INFO("VideoListSelectionDialog::exec(): nothing to show, finishing.")
// no items, finish right away
- finishedSlot(primaryAction());
+ finishedSlot(mPrimaryAction);
}
}
@@ -305,9 +321,11 @@
//
void VideoListSelectionDialog::finishedSlot(HbAction *action)
{
+ FUNC_LOG;
disconnectSignals();
- if(action == secondaryAction())
+ if(action == mSecondaryAction)
{
+ INFO("VideoListSelectionDialog::exec(): secondary action triggered.")
return;
}
QString albumName("");
@@ -318,14 +336,14 @@
albumName = queryNewAlbumSelected();
if(mSelectedAlbumId == TMPXItemId::InvalidId())
{
- // user cancelled new album creation
+ // user canceled new album creation
return;
}
}
mTypeOfSelection = EAddToCollection;
-
}
-
+
+ // Must be checked again if type was ESelectCollection
if(mTypeOfSelection == EAddToCollection)
{
if(mSelectedAlbumId != TMPXItemId::InvalidId() && mSelectedVideos.count())
@@ -374,11 +392,12 @@
//
void VideoListSelectionDialog::markAllStateChangedSlot(int state)
{
+ FUNC_LOG;
if(mForcedCheck)
{
return;
}
- if( state == Qt::Checked)
+ if(state == Qt::Checked)
{
mListWidget->selectAll();
}
@@ -394,8 +413,10 @@
//
void VideoListSelectionDialog::selectionChangedSlot(const QItemSelection &selected, const QItemSelection &deselected)
{
- if(!primaryAction() || mTypeOfSelection == ESelectCollection)
+ FUNC_LOG;
+ if(!mPrimaryAction || mTypeOfSelection == ESelectCollection)
{
+ INFO("VideoListSelectionDialog::selectionChangedSlot(): no primary action or we are selecting collection.")
return;
}
@@ -411,11 +432,11 @@
if(mSelection.indexes().count() > 0)
{
- primaryAction()->setDisabled(false);
+ mPrimaryAction->setDisabled(false);
}
else
{
- primaryAction()->setDisabled(true);
+ mPrimaryAction->setDisabled(true);
}
updateCounterSlot();
@@ -427,12 +448,13 @@
//
void VideoListSelectionDialog::singleItemSelectedSlot(const QModelIndex &index)
{
+ FUNC_LOG;
if(mTypeOfSelection == ESelectCollection)
{
if(index.isValid())
- {
+ {
mSelectedAlbumId = mModel->getMediaIdAtIndex(index);
- primaryAction()->trigger();
+ mPrimaryAction->trigger();
}
}
}
@@ -443,21 +465,22 @@
//
void VideoListSelectionDialog::modelReadySlot()
{
-
+ FUNC_LOG;
if(mTypeOfSelection == ESelectCollection)
{
- primaryAction()->setDisabled(false);
+ mPrimaryAction->setDisabled(false);
if(!mModel->rowCount())
{
// in case there are no user defined albums,
// start input dialog right away by accepting dialog
- primaryAction()->trigger();
+ INFO("VideoListSelectionDialog::selectionChangedSlot(): no albums, starting album creation.")
+ mPrimaryAction->trigger();
return;
}
}
if(mTypeOfSelection != ESelectCollection)
{
- primaryAction()->setDisabled(true);
+ mPrimaryAction->setDisabled(true);
}
updateCounterSlot();
}
@@ -468,6 +491,7 @@
//
void VideoListSelectionDialog::updateCounterSlot()
{
+ FUNC_LOG;
if(!mItemCount)
{
return;
@@ -486,7 +510,6 @@
mCheckBox->setChecked(false);
}
mForcedCheck = false;
-
}
// ---------------------------------------------------------------------------
@@ -495,10 +518,11 @@
//
void VideoListSelectionDialog::primaryActionTriggeredSlot()
{
+ FUNC_LOG;
// reconnect primary action
- primaryAction()->disconnect(SIGNAL(triggered()));
- connect(primaryAction(), SIGNAL(triggered()), this, SLOT(close()));
-
+ mPrimaryAction->disconnect(SIGNAL(triggered()));
+ connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
+
// update video items selection here before content changes.
int count = mSelection.indexes().count();
TMPXItemId id = TMPXItemId::InvalidId();
@@ -513,11 +537,13 @@
if(mSelectedAlbumId != TMPXItemId::InvalidId())
{
- primaryAction()->trigger();
+ INFO("VideoListSelectionDialog::primaryActionTriggeredSlot(): closing dialog.")
+ mPrimaryAction->trigger();
return;
}
else if(mTypeOfSelection == EAddToCollection)
{
+ INFO("VideoListSelectionDialog::primaryActionTriggeredSlot(): activating collection selection.")
// videos for collection selected, but collection
// not yet selected, activate selection for it
mTypeOfSelection = ESelectCollection;
@@ -531,6 +557,7 @@
//
void VideoListSelectionDialog::connectSignals()
{
+ FUNC_LOG;
// dialog finished
connect(this, SIGNAL(finished(HbAction*)), this, SLOT(finishedSlot(HbAction*)));
@@ -540,7 +567,7 @@
connect(mListWidget->selectionModel(), SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),
this, SLOT(selectionChangedSlot(const QItemSelection&, const QItemSelection &)));
-
+
// model changes signals
connect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
connect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
@@ -555,6 +582,7 @@
//
void VideoListSelectionDialog::disconnectSignals()
{
+ FUNC_LOG;
disconnect(this, SIGNAL(finished(HbAction*)), this, SLOT(finishedSlot(HbAction*)));
disconnect(mListWidget, SIGNAL(activated(const QModelIndex&)),
@@ -562,13 +590,13 @@
disconnect(mListWidget->selectionModel(), SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),
this, SLOT(selectionChangedSlot(const QItemSelection&, const QItemSelection &)));
-
+
// model changes signals
disconnect(mModel->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelReadySlot()));
disconnect(mModel->sourceModel(), SIGNAL(modelChanged()), this, SLOT(updateCounterSlot()));
// mark all state changes
- disconnect(mCheckBox, SIGNAL(stateChanged(int)), this, SLOT(markAllStateChangedSlot(int)));
+ disconnect(mCheckBox, SIGNAL(stateChanged(int)), this, SLOT(markAllStateChangedSlot(int)));
}
// ---------------------------------------------------------------------------
@@ -577,12 +605,13 @@
//
QString VideoListSelectionDialog::getSelectedName()
{
+ FUNC_LOG;
QString name;
if(mSelectedAlbumId.iId2 > KVcxMvcMediaTypeVideo)
{
VideoSortFilterProxyModel *model =
VideoCollectionWrapper::instance().getModel(
- VideoCollectionWrapper::ECollections);
+ VideoCollectionCommon::EModelTypeCollections);
if(!model)
{
return name;
@@ -590,7 +619,7 @@
QModelIndex index = model->indexOfId(mSelectedAlbumId);
if(index.isValid())
{
- name = model->data(index, Qt::DisplayRole).toStringList().first();
+ name = model->data(index, VideoCollectionCommon::KeyTitle).toString();
}
}
@@ -603,6 +632,7 @@
//
QString VideoListSelectionDialog::queryNewAlbumSelected()
{
+ FUNC_LOG;
mSelectedAlbumId = TMPXItemId::InvalidId();
bool ok = false;
QString label(hbTrId("txt_videos_title_enter_name"));
--- a/videocollection/videocollectionview/src/videolistview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,8 +15,11 @@
*
*/
+// Version : %version: 97 %
+
+// INCLUDE FILES
#include <xqserviceutil.h>
-#include <QActionGroup>
+#include <qactiongroup.h>
#include <hbinstance.h>
#include <hbmainwindow.h>
#include <hbmessagebox.h>
@@ -42,32 +45,27 @@
#include "videosortfilterproxymodel.h"
#include "videocollectionuiloader.h"
#include "mpxhbvideocommondefs.h"
-
-// remove these
-#include <QDebug>
+#include "videocollectiontrace.h"
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
-VideoListView::VideoListView(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent) :
-HbView(parent),
-mUiUtils(VideoCollectionViewUtils::instance()),
-mWrapper(VideoCollectionWrapper::instance()),
-mUiLoader(uiLoader),
-mIsService(false),
-mHintLoaded(false),
-mListsLoaded(false),
-mMultiselectionLoaded(false),
-mModelReady(false),
-mTransitionOngoing(false),
-mHintLevel(VideoHintWidget::AllVideos),
-mVideoServices(0),
-mCurrentList(0),
-mToolbarViewsActionGroup(0),
-mToolbarCollectionActionGroup(0)
+VideoListView::VideoListView( VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent )
+ : HbView( parent )
+ , mUiUtils( VideoCollectionViewUtils::instance() )
+ , mWrapper( VideoCollectionWrapper::instance() )
+ , mUiLoader( uiLoader )
+ , mIsService( false )
+ , mModelReady( false )
+ , mTransitionOngoing( false )
+ , mHintLevel( VideoHintWidget::AllVideos )
+ , mVideoServices( 0 )
+ , mCurrentList( 0 )
+ , mToolbarViewsActionGroup( 0 )
+ , mToolbarCollectionActionGroup( 0 )
{
- // NOP
+ FUNC_LOG;
}
// ---------------------------------------------------------------------------
@@ -76,7 +74,7 @@
//
VideoListView::~VideoListView()
{
- qDebug() << "VideoListView::~VideoListView()";
+ FUNC_LOG;
toolBar()->clearActions();
@@ -96,6 +94,7 @@
//
int VideoListView::initializeView()
{
+ FUNC_LOG;
if(!mUiLoader)
{
cleanup();
@@ -104,12 +103,14 @@
if (XQServiceUtil::isService() && !mVideoServices)
{
- mIsService = true;
+ INFO("VideoListView::initializeView() service flag set to true.");
+ mIsService = true;
mVideoServices = VideoServices::instance();
if (!mVideoServices)
{
+ ERROR(-1, "VideoListView::initializeView() getting services instance failed.");
cleanup();
return -1;
}
@@ -119,49 +120,104 @@
}
}
- // start open all videos model
- VideoSortFilterProxyModel *model =
- mWrapper.getModel(VideoCollectionWrapper::EAllVideos);
- if (model)
- {
- model->open(VideoCollectionCommon::ELevelVideos);
- }
- else
- {
- cleanup();
- return -1;
- }
+ // start loading objects and widgets
+ QList<VideoCollectionUiLoaderParam> params;
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_VIDEOLISTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_OPTIONS_MENU,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_ADD_TO_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_CREATE_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_DELETE_MULTIPLE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_HEADINGBANNER,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_MENU,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_DATE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_NAME,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_SIZE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_COLLECTIONWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary)); // widget
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_DIALOG,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_VIDEOHINTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_HINT_BUTTON,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_NO_VIDEOS_LABEL,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ mUiLoader->addData(params,
+ this,
+ SLOT(objectReadySlot(QObject*, const QString&)));
+ mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ params.clear();
- // start loading widgets
- QSet<QString> uiItems;
- uiItems.insert(DOCML_NAME_VC_VIDEOLISTWIDGET);
- uiItems.insert(DOCML_NAME_VC_HEADINGBANNER);
- uiItems.insert(DOCML_NAME_OPTIONS_MENU);
- if(!mIsService)
- {
- uiItems.insert(DOCML_NAME_ADD_TO_COLLECTION);
- uiItems.insert(DOCML_NAME_CREATE_COLLECTION);
- uiItems.insert(DOCML_NAME_DELETE_MULTIPLE);
- }
- uiItems.insert(DOCML_NAME_SORT_MENU);
- uiItems.insert(DOCML_NAME_SORT_BY_DATE);
- uiItems.insert(DOCML_NAME_SORT_BY_NAME);
- uiItems.insert(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS);
- uiItems.insert(DOCML_NAME_SORT_BY_RATING);
- uiItems.insert(DOCML_NAME_SORT_BY_SIZE);
- mUiLoader->startLoading(uiItems,
- this,
- SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)),
- SLOT(objectReadySlot(QObject*, const QString&)));
- uiItems.clear();
-
- // TODO: create toolbar temporarily here until it has been moved to docml
- if (createToolbar() != 0)
- {
- cleanup();
- return -1;
- }
-
return 0;
}
@@ -171,6 +227,7 @@
//
void VideoListView::titleReadySlot(const QString& title)
{
+ FUNC_LOG;
setTitle(title);
}
@@ -178,119 +235,51 @@
// activateView()
// ---------------------------------------------------------------------------
//
-int VideoListView::activateView()
+int VideoListView::activateView(const TMPXItemId &itemId)
{
- VideoListWidget *videoList =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_VIDEOLISTWIDGET);
- if (videoList)
+ FUNC_LOG;
+
+ int err = 0;
+
+ // activate collection to correct view
+ if (itemId == TMPXItemId::InvalidId())
{
- VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
- if (mCurrentList)
- {
- level = mCurrentList->getLevel();
- }
- else
- {
- mCurrentList = videoList;
- }
-
- int result = mCurrentList->activate(level);
- if(result < 0)
- {
- // activate failed, deactivate view so we get rid of dangling connections.
- deactivateView();
- return -1;
- }
-
- HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
- if (mainWnd)
- {
- mainWnd->setOrientation(Qt::Vertical, false);
- if(!connect(
- mainWnd, SIGNAL(aboutToChangeOrientation()),
- this, SLOT( aboutToChangeOrientationSlot())) ||
- !connect(
- mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
- this, SLOT(orientationChangedSlot(Qt::Orientation))) ||
- !connect(
- &mWrapper, SIGNAL(asyncStatus(int, QVariant&)),
- this, SLOT(handleAsyncStatusSlot(int, QVariant&))) ||
- !connect(
- mCurrentList->getModel().sourceModel(), SIGNAL(modelChanged()),
- this, SLOT(layoutChangedSlot())) ||
- !connect(
- mCurrentList->getModel().sourceModel(), SIGNAL(modelReady()),
- this, SLOT(modelReadySlot())))
- {
- // deactivate view so we get rid of dangling connections.
- deactivateView();
- return -1;
- }
- }
- else
- {
- return -1;
- }
+ err = activateVideosView();
}
else
{
- return -1;
+ err = activateCollectionContentView(itemId);
}
- return 0;
-}
-
-
-// ---------------------------------------------------------------------------
-// loadMultiSelection
-// ---------------------------------------------------------------------------
-//
-void VideoListView::loadMultiSelection()
-{
- if(!mIsService)
+ // connect signals if everything went ok
+ if (err == 0)
{
- if(!mMultiselectionLoaded)
- {
- QSet<QString> uiItems;
- uiItems.insert(DOCML_NAME_DIALOG);
- mUiLoader->startLoading(uiItems,
- this,
- SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)),
- SLOT(objectReadySlot(QObject*, const QString&)));
- uiItems.clear();
- mMultiselectionLoaded = true;
- }
+ HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
+ mainWnd->setOrientation(Qt::Vertical, false);
+ if (!connect(
+ mainWnd, SIGNAL(aboutToChangeOrientation()),
+ this, SLOT( aboutToChangeOrientationSlot())) ||
+ !connect(
+ mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
+ this, SLOT(orientationChangedSlot(Qt::Orientation))) ||
+ !connect(
+ &mWrapper, SIGNAL(asyncStatus(int, QVariant&)),
+ this, SLOT(handleAsyncStatusSlot(int, QVariant&))) ||
+ !connect(
+ mCurrentList->getModel().sourceModel(), SIGNAL(modelChanged()),
+ this, SLOT(layoutChangedSlot())) ||
+ !connect(
+ mCurrentList->getModel().sourceModel(), SIGNAL(modelReady()),
+ this, SLOT(modelReadySlot())))
+ {
+ ERROR(-1, "VideoListView::activateView() failed to connect signals.");
+ // deactivate view so we get rid of dangling connections.
+ deactivateView();
+ err = -1;
+ }
}
-}
-
-// ---------------------------------------------------------------------------
-// loadLists
-// ---------------------------------------------------------------------------
-//
-void VideoListView::loadLists(bool doAsync)
-{
- if(!mListsLoaded)
- {
- QSet<QString> uiItems;
- uiItems.insert(DOCML_NAME_VC_COLLECTIONWIDGET);
- uiItems.insert(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
- mUiLoader->startLoading(uiItems,
- this,
- SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)),
- SLOT(objectReadySlot(QObject*, const QString&)));
- uiItems.clear();
-
- if(!doAsync)
- {
- VideoListWidget* widget(0);
- widget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
- widget->setVisible(false);
- widget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
- widget->setVisible(false);
- }
- mListsLoaded = true;
- }
+
+ return err;
}
// ---------------------------------------------------------------------------
@@ -299,9 +288,8 @@
//
void VideoListView::doDelayedsSlot()
{
- loadLists(true);
- loadMultiSelection();
- loadHint(true);
+ FUNC_LOG;
+ mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
emit doDelayeds();
}
@@ -311,6 +299,7 @@
//
void VideoListView::modelReadySlot()
{
+ FUNC_LOG;
mModelReady = true;
// since the reset signal arrives after
@@ -325,6 +314,7 @@
//
void VideoListView::layoutChangedSlot()
{
+ FUNC_LOG;
updateSubLabel();
if(mModelReady)
@@ -339,6 +329,7 @@
//
void VideoListView::deactivateView()
{
+ FUNC_LOG;
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
mainWnd->unsetOrientation();
@@ -382,7 +373,7 @@
//
void VideoListView::back()
{
- // NOP
+ FUNC_LOG;
}
// ---------------------------------------------------------------------------
@@ -391,6 +382,7 @@
//
void VideoListView::cleanup()
{
+ FUNC_LOG;
delete mToolbarViewsActionGroup;
mToolbarViewsActionGroup = 0;
@@ -407,6 +399,7 @@
//
int VideoListView::createToolbar()
{
+ FUNC_LOG;
// Create actiongroup and add all actions to it. This ensures that only one is
// active at certain moment.
@@ -415,17 +408,6 @@
mToolbarViewsActionGroup = new QActionGroup(this);
mToolbarCollectionActionGroup = new QActionGroup(this);
- if(!mToolbarViewsActionGroup || !mToolbarCollectionActionGroup)
- {
- delete mToolbarViewsActionGroup;
- mToolbarViewsActionGroup = 0;
-
- delete mToolbarCollectionActionGroup;
- mToolbarCollectionActionGroup = 0;
-
- return -1;
- }
-
// create toolbar item actions
// All Videos tab
@@ -448,7 +430,7 @@
// Remove Videos tab
mToolbarActions[ETBActionRemoveVideos] =
- createAction(":/images/qtg_mono_remove_from_video_collection.svg",
+ createAction("qtg_mono_remove_from_video_collection",
mToolbarCollectionActionGroup, SLOT(removeVideosFromCollectionSlot()));
}
@@ -457,10 +439,11 @@
if( !bar
|| !mToolbarActions[ETBActionAllVideos]
|| !mToolbarActions[ETBActionCollections]
- || (!mToolbarActions[ETBActionServices] && !mIsService)
- || (!mToolbarActions[ETBActionAddVideos] && !mIsService)
- || (!mToolbarActions[ETBActionRemoveVideos] && !mIsService))
+ || ( !mIsService && (!mToolbarActions[ETBActionServices]
+ || !mToolbarActions[ETBActionAddVideos]
+ || !mToolbarActions[ETBActionRemoveVideos])))
{
+ ERROR(-1, "VideoListView::createToolbar() failed to create all actions or the toolbar.");
delete mToolbarActions[ETBActionAllVideos];
delete mToolbarActions[ETBActionCollections];
delete mToolbarActions[ETBActionServices];
@@ -482,7 +465,6 @@
mToolbarActions[ETBActionAllVideos]->setChecked(true);
bar->addActions(mToolbarViewsActionGroup->actions());
- bar->setVisible(true);
}
return 0;
@@ -495,10 +477,8 @@
HbAction* VideoListView::createAction(QString icon,
QActionGroup* actionGroup, const char *slot)
{
+ FUNC_LOG;
HbAction* action = new HbAction(actionGroup);
- if(!action) {
- return 0;
- }
HbIcon hbIcon(icon);
action->setIcon(hbIcon);
@@ -514,125 +494,83 @@
}
// ---------------------------------------------------------------------------
-// loadHint
-// ---------------------------------------------------------------------------
-//
-void VideoListView::loadHint(bool doAsync)
-{
- if(!mHintLoaded)
- {
- QSet<QString> uiItems;
- uiItems.insert(DOCML_NAME_VC_VIDEOHINTWIDGET);
- uiItems.insert(DOCML_NAME_HINT_BUTTON);
- uiItems.insert(DOCML_NAME_NO_VIDEOS_LABEL);
- mUiLoader->startLoading(uiItems,
- this,
- SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)),
- SLOT(objectReadySlot(QObject*, const QString&)));
- uiItems.clear();
-
- if(!doAsync)
- {
- HbPushButton* button = mUiLoader->findWidget<HbPushButton>(DOCML_NAME_HINT_BUTTON);
- }
- mHintLoaded = true;
- }
-}
-
-// ---------------------------------------------------------------------------
// showHint
// ---------------------------------------------------------------------------
//
void VideoListView::showHint(bool show)
{
+ FUNC_LOG;
if(!mCurrentList)
{
return;
}
VideoSortFilterProxyModel &model = mCurrentList->getModel();
-
- HbGroupBox *subLabel =
- mUiLoader->findWidget<HbGroupBox>(DOCML_NAME_VC_HEADINGBANNER);
-
- if((!mHintLoaded && !show) || (!mHintLoaded && model.rowCount() != 0))
- {
- if(subLabel)
- {
- subLabel->show();
- }
- return;
- }
- else if(!mHintLoaded)
- {
- loadHint(false);
- }
-
+
+ // prepare hint widget
VideoHintWidget *hintWidget =
mUiLoader->findWidget<VideoHintWidget>(
DOCML_NAME_VC_VIDEOHINTWIDGET);
-
if (hintWidget)
{
hintWidget->setLevel(mHintLevel);
- }
-
- if (mModelReady &&
- model.rowCount() == 0 &&
- hintWidget)
- {
- show ? hintWidget->activate() : hintWidget->deactivate();
- }
- else if (hintWidget)
- {
- show = false;
- hintWidget->deactivate();
- }
-
- if(show && mToolbarViewsActionGroup && mToolbarCollectionActionGroup)
- {
- if(!mIsService)
- {
- mToolbarActions[ETBActionRemoveVideos]->setVisible(false);
- }
- if(mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl)
+ if (mModelReady &&
+ model.rowCount() == 0)
+ {
+ show ? hintWidget->activate() : hintWidget->deactivate();
+ }
+ else
{
- if(!mIsService)
- {
- mToolbarActions[ETBActionAddVideos]->setVisible(false);
- }
- hintWidget->setButtonShown(false);
- }
- else
+ show = false;
+ hintWidget->deactivate();
+ }
+ if(show)
+ {
+ bool showHintBtns = (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl);
+ hintWidget->setButtonShown(showHintBtns);
+ }
+ else
{
hintWidget->setButtonShown(true);
}
- }
- else if(mToolbarViewsActionGroup && mToolbarCollectionActionGroup)
+ }
+
+ if (mToolbarViewsActionGroup && mToolbarCollectionActionGroup && !mIsService)
{
- if(!mIsService)
- {
- if(mToolbarActions[ETBActionRemoveVideos]->isVisible() == false)
- {
- mToolbarActions[ETBActionRemoveVideos]->setVisible(true);
- }
- if(mToolbarActions[ETBActionAddVideos]->isVisible() == false)
- {
- mToolbarActions[ETBActionAddVideos]->setVisible(true);
- }
- }
- hintWidget->setButtonShown(true);
+ if (show)
+ {
+ mToolbarActions[ETBActionRemoveVideos]->setVisible(false);
+
+ if(mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl)
+ {
+ mToolbarActions[ETBActionAddVideos]->setVisible(false);
+ }
+ }
+ else
+ {
+ if(mToolbarActions[ETBActionRemoveVideos]->isVisible() == false)
+ {
+ mToolbarActions[ETBActionRemoveVideos]->setVisible(true);
+ }
+ if(mToolbarActions[ETBActionAddVideos]->isVisible() == false)
+ {
+ mToolbarActions[ETBActionAddVideos]->setVisible(true);
+ }
+ }
}
-
+
+ // prepare sublabel
+ HbGroupBox *subLabel =
+ mUiLoader->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER);
if (subLabel)
{
if (show &&
- subLabel->isVisible() &&
mCurrentList->getLevel() == VideoCollectionCommon::ELevelVideos)
{
subLabel->hide();
}
- else if (!subLabel->isVisible())
+ else
{
subLabel->show();
}
@@ -645,6 +583,7 @@
//
void VideoListView::setHintLevel(VideoHintWidget::HintLevel level)
{
+ FUNC_LOG;
mHintLevel = level;
}
@@ -654,6 +593,7 @@
//
void VideoListView::updateSubLabel()
{
+ FUNC_LOG;
VideoSortFilterProxyModel *model = 0;
if(mCurrentList)
{
@@ -663,33 +603,27 @@
if (model)
{
int itemCount = model->rowCount();
- VideoListWidget *videoListWidget =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_VIDEOLISTWIDGET);
-
- VideoListWidget *collectionWidget =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_COLLECTIONWIDGET);
-
- VideoListWidget *collectionContentWidget =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
HbGroupBox *subLabel =
mUiLoader->findWidget<HbGroupBox>(
DOCML_NAME_VC_HEADINGBANNER);
- if(subLabel)
+ if(subLabel && mCurrentList)
{
- if (mCurrentList == videoListWidget)
+ if (mCurrentList->getLevel() == VideoCollectionCommon::ELevelVideos)
{
- subLabel->setHeading(hbTrId("txt_videos_subtitle_ln_videos", itemCount));
+ // no need to update sublabel if there are no items in videolist
+ // hint widget is shown instead
+ if (itemCount)
+ {
+ subLabel->setHeading(hbTrId("txt_videos_subtitle_ln_videos", itemCount));
+ }
}
- else if (mCurrentList == collectionWidget)
+ else if (mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory)
{
subLabel->setHeading(hbTrId("txt_videos_subtitle_ln_collections", itemCount));
}
- else if(mCurrentList == collectionContentWidget)
+ else
{
subLabel->setHeading(hbTrId("txt_videos_subtitle_1_l2").arg(mCollectionName).arg(itemCount));
}
@@ -703,6 +637,7 @@
//
void VideoListView::showAction(bool show, const QString &name)
{
+ FUNC_LOG;
HbAction *action = mUiLoader->findObject<HbAction>(name);
if (!action)
{
@@ -722,55 +657,130 @@
}
// ---------------------------------------------------------------------------
-// isActionChecked()
+// activateVideosView()
// ---------------------------------------------------------------------------
//
-bool VideoListView::isActionChecked(const QString &name)
+int VideoListView::activateVideosView()
{
- bool isChecked = false;
-
- HbAction *action = mUiLoader->findObject<HbAction>(name);
- if (!action)
+ FUNC_LOG;
+ VideoListWidget *videoList =
+ mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_VIDEOLISTWIDGET);
+ if (videoList)
{
- // must be menu widget
- HbMenu *menu = mUiLoader->findWidget<HbMenu>(name);
- if (menu)
+ VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
+ if (mCurrentList)
+ {
+ level = mCurrentList->getLevel();
+ }
+ else
{
- action = menu->menuAction();
+ mCurrentList = videoList;
+ }
+
+ int result = mCurrentList->activate(level);
+ if(result < 0)
+ {
+ ERROR(result, "VideoListView::activateVideosView() failed to activate.");
+ // activate failed, deactivate view so we get rid of dangling connections.
+ deactivateView();
+ return -1;
+ }
+
+ if (createToolbar() != 0)
+ {
+ ERROR(result, "VideoListView::activateVideosView() failed to create toolbar.");
+ deactivateView();
+ return -1;
}
}
-
- // check if action is checked
- if (action)
+ else
{
- isChecked = action->isChecked();
+ return -1;
}
- return isChecked;
+ return 0;
}
// ---------------------------------------------------------------------------
-// isActionChecked()
+// activateCollectionContentView()
// ---------------------------------------------------------------------------
//
-void VideoListView::setActionChecked(bool setChecked, const QString &name)
+int VideoListView::activateCollectionContentView(const TMPXItemId &itemId)
{
- HbAction *action = mUiLoader->findObject<HbAction>(name);
- if (!action)
+ FUNC_LOG;
+ int err = 0;
+
+ if (itemId.iId2 == KVcxMvcMediaTypeCategory ||
+ itemId.iId2 == KVcxMvcMediaTypeAlbum)
{
- // must be menu widget
- HbMenu *menu = mUiLoader->findWidget<HbMenu>(name);
- if (menu)
+ // currently only captured and downloaded categories are supported
+ switch (itemId.iId1)
{
- action = menu->menuAction();
+ case KVcxMvcCategoryIdDownloads:
+ case KVcxMvcCategoryIdCaptured:
+ {
+ VideoListWidget *collectionContentWidget =
+ mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
+ if (collectionContentWidget)
+ {
+ // no need to deactivate since there cannot be previous widget
+ mCurrentList = collectionContentWidget;
+
+ // hide toolbar
+ HbToolBar *toolBar = this->toolBar();
+ if (toolBar)
+ {
+ toolBar->hide();
+ }
+
+ // resolve collection name
+ if (itemId.iId1 == KVcxMvcCategoryIdDownloads)
+ {
+ mCollectionName = hbTrId("txt_videos_dblist_downloaded");
+ }
+ else if (itemId.iId1 == KVcxMvcCategoryIdCaptured)
+ {
+ mCollectionName = hbTrId("txt_videos_dblist_captured");
+ }
+
+ // activate collection content widget
+ mCurrentList->activate(VideoCollectionCommon::ELevelDefaultColl);
+
+ // open the model
+ VideoSortFilterProxyModel &model = mCurrentList->getModel();
+ model.openItem(itemId);
+
+ // sort model
+ model.doSorting(VideoCollectionCommon::KeyDateTime, Qt::AscendingOrder);
+
+ // set hint level to collections
+ setHintLevel(VideoHintWidget::Collection);
+ }
+ else
+ {
+ ERROR(-1, "VideoListView::activateVideosView() failed to get collection content widget.");
+ err = -1;
+ }
+ break;
+ }
+ default:
+ {
+ // by default open videos view
+ err = activateVideosView();
+ break;
+ }
}
+
+ }
+ else
+ {
+ // open videos view
+ err = activateVideosView();
}
- // update action check state
- if (action)
- {
- action->setChecked(setChecked);
- }
+ return err;
}
// ---------------------------------------------------------------------------
@@ -779,11 +789,7 @@
//
void VideoListView::openAllVideosViewSlot()
{
- if(!mListsLoaded)
- {
- loadLists(false);
- }
-
+ FUNC_LOG;
VideoListWidget *videoListWidget =
mUiLoader->findWidget<VideoListWidget>(
DOCML_NAME_VC_VIDEOLISTWIDGET);
@@ -813,11 +819,7 @@
//
void VideoListView::openCollectionViewSlot()
{
- if(!mListsLoaded)
- {
- loadLists(false);
- }
-
+ FUNC_LOG;
VideoListWidget *collectionWidget =
mUiLoader->findWidget<VideoListWidget>(
DOCML_NAME_VC_COLLECTIONWIDGET);
@@ -833,7 +835,8 @@
mCurrentList->activate(VideoCollectionCommon::ELevelCategory);
VideoSortFilterProxyModel &model = mCurrentList->getModel();
- VideoCollectionViewUtils::sortModel(&model, false);
+
+ VideoCollectionViewUtils::sortModel(&model, false, mCurrentList->getLevel());
// the collection view is not empty, so we can hide the hint in advance.
showHint(false);
@@ -848,6 +851,7 @@
int start,
int end)
{
+ FUNC_LOG;
Q_UNUSED(end);
if(!mCurrentList)
{
@@ -875,6 +879,7 @@
//
void VideoListView::openServicesViewSlot()
{
+ FUNC_LOG;
debugNotImplementedYet();
}
@@ -884,17 +889,23 @@
//
void VideoListView::startSorting()
{
+ FUNC_LOG;
HbMenu *optionsMenu =
mUiLoader->findWidget<HbMenu>(
DOCML_NAME_OPTIONS_MENU);
- if (optionsMenu)
+ if (optionsMenu && mCurrentList)
{
// get sorting role from active action
- HbAction *action = optionsMenu->activeAction()->menu()->activeAction();
- if(action)
- {
- doSorting(mSortingRoles[action]);
- }
+ HbAction* action = optionsMenu->activeAction();
+ HbMenu* sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
+ if(action == sortMenu->menuAction()) // make sure that active action is the sort menu.
+ {
+ HbAction* action = sortMenu->activeAction();
+ if(action)
+ {
+ doSorting(mSortingRoles[action]);
+ }
+ }
}
}
@@ -904,6 +915,7 @@
//
void VideoListView::doSorting(int role)
{
+ FUNC_LOG;
// sort model
Qt::SortOrder order(Qt::AscendingOrder);
VideoSortFilterProxyModel &model = mCurrentList->getModel();
@@ -913,8 +925,13 @@
}
model.doSorting(role, order);
+ if (mCurrentList == mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET))
+ {
+ mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET)->getModel().doSorting(role, order);
+ }
+
// save sorting values
- mUiUtils.saveSortingValues(role, order);
+ mUiUtils.saveSortingValues(role, order, mCurrentList->getLevel());
}
// -------------------------------------------------------------------------------------------------
@@ -924,6 +941,7 @@
//
void VideoListView::aboutToChangeOrientationSlot()
{
+ FUNC_LOG;
// this method is required for changing from to mediawall
}
@@ -934,6 +952,7 @@
//
void VideoListView::orientationChangedSlot( Qt::Orientation orientation )
{
+ FUNC_LOG;
// this method is required for changing from to mediawall
// in landscape we need to hide the title and the toolbar. (also required for the mediawall?)
@@ -947,16 +966,12 @@
//
void VideoListView::deleteItemsSlot()
{
+ FUNC_LOG;
if(!mCurrentList)
{
return;
}
- if(!mMultiselectionLoaded)
- {
- loadMultiSelection();
- }
-
VideoListSelectionDialog *dialog =
mUiLoader->findWidget<VideoListSelectionDialog>(
DOCML_NAME_DIALOG);
@@ -974,13 +989,13 @@
//
void VideoListView::createCollectionSlot()
{
+ FUNC_LOG;
if(!mCurrentList)
{
return;
}
VideoSortFilterProxyModel &model = mCurrentList->getModel();
-
bool ok = false;
// query a name for the collection
@@ -1010,16 +1025,12 @@
//
void VideoListView::addVideosToCollectionSlot()
{
+ FUNC_LOG;
if(!mCurrentList)
{
return;
}
- if(!mMultiselectionLoaded)
- {
- loadMultiSelection();
- }
-
VideoListSelectionDialog *dialog =
mUiLoader->findWidget<VideoListSelectionDialog>(
DOCML_NAME_DIALOG);
@@ -1061,6 +1072,7 @@
//
void VideoListView::removeVideosFromCollectionSlot()
{
+ FUNC_LOG;
if(!mCurrentList)
{
return;
@@ -1073,17 +1085,12 @@
return;
}
- if(!mMultiselectionLoaded)
- {
- loadMultiSelection();
- }
-
VideoListSelectionDialog *dialog =
mUiLoader->findWidget<VideoListSelectionDialog>(
DOCML_NAME_DIALOG);
if (!dialog)
{
- // fatal: no selection dialog
+ ERROR(-1, "VideoListView::removeVideosFromCollectionSlot() failed to load selection dialog.");
return;
}
TMPXItemId collectionId = mCurrentList->getModel().getOpenItem();
@@ -1100,6 +1107,14 @@
//
void VideoListView::aboutToShowMainMenuSlot()
{
+ if (mIsService &&
+ mVideoServices &&
+ mVideoServices->currentService() == VideoServices::EBrowse)
+ {
+ prepareBrowseServiceMenu();
+ return;
+ }
+
if (!mCurrentList ||
!mToolbarViewsActionGroup ||
!mToolbarCollectionActionGroup)
@@ -1114,12 +1129,11 @@
showAction(false, DOCML_NAME_SORT_BY_DATE);
showAction(false, DOCML_NAME_SORT_BY_NAME);
showAction(false, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS);
- showAction(false, DOCML_NAME_SORT_BY_RATING);
showAction(false, DOCML_NAME_SORT_BY_SIZE);
showAction(false, DOCML_NAME_SORT_MENU);
VideoSortFilterProxyModel &model = mCurrentList->getModel();
- if (!model.rowCount(QModelIndex()))
+ if (!model.rowCount())
{
return;
}
@@ -1135,25 +1149,17 @@
firstAction == mToolbarActions[ETBActionAllVideos])
{
showAction(true, DOCML_NAME_SORT_MENU);
+
showAction(true, DOCML_NAME_SORT_BY_DATE);
- if (isActionChecked(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS))
- {
- //TODO: when changing between videos and categories, sorting order needs to be changed, if new
- // view does not have the previously active sorting order supported
- showAction(true, DOCML_NAME_SORT_BY_DATE);
- }
- else
- {
- HbAction* action = mSortingRoles.key(role);
- if (action)
- {
- action->setChecked(true);
- }
- }
-
showAction(true, DOCML_NAME_SORT_BY_NAME);
showAction(true, DOCML_NAME_SORT_BY_SIZE);
+ HbAction* action = mSortingRoles.key(role);
+ if (action)
+ {
+ action->setChecked(true);
+ }
+
if (!mIsService)
{
showAction(true, DOCML_NAME_ADD_TO_COLLECTION);
@@ -1169,47 +1175,27 @@
}
showAction(true, DOCML_NAME_SORT_MENU);
showAction(true, DOCML_NAME_SORT_BY_NAME);
+ showAction(true, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS);
- if (isActionChecked(DOCML_NAME_SORT_BY_DATE) ||
- isActionChecked(DOCML_NAME_SORT_BY_SIZE))
- {
- //TODO: when changing between videos and categories, sorting order needs to be changed, if new
- // view does not have the previously active sorting order supported
- setActionChecked(true, DOCML_NAME_SORT_BY_NAME);
- }
- else
- {
- HbAction* action = mSortingRoles.key(role);
- if (action)
- {
- action->setChecked(true);
- }
- }
-
- showAction(true, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS);
+ HbAction* action = mSortingRoles.key(role);
+ if (action)
+ {
+ action->setChecked(true);
+ }
}
else if(firstAction != mToolbarActions[ETBActionAllVideos])
{
showAction(true, DOCML_NAME_SORT_MENU);
showAction(true, DOCML_NAME_SORT_BY_DATE);
- if (isActionChecked(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS))
- {
- //TODO: when changing between videos and categories, sorting order needs to be changed, if new
- // view does not have the previously active sorting order supported
- showAction(true, DOCML_NAME_SORT_BY_DATE);
- }
- else
- {
- HbAction* action = mSortingRoles.key(role);
- if (action)
- {
- action->setChecked(true);
- }
- }
-
showAction(true, DOCML_NAME_SORT_BY_NAME);
showAction(true, DOCML_NAME_SORT_BY_SIZE);
+ HbAction* action = mSortingRoles.key(role);
+ if (action)
+ {
+ action->setChecked(true);
+ }
+
if (!mIsService)
{
showAction(true, DOCML_NAME_DELETE_MULTIPLE);
@@ -1218,11 +1204,59 @@
}
// -------------------------------------------------------------------------------------------------
+// prepareBrowseServiceMenu
+// -------------------------------------------------------------------------------------------------
+//
+void VideoListView::prepareBrowseServiceMenu()
+{
+ if (!mCurrentList)
+ {
+ return;
+ }
+
+ // hide all actions by default
+ showAction(false, DOCML_NAME_ADD_TO_COLLECTION);
+ showAction(false, DOCML_NAME_CREATE_COLLECTION);
+ showAction(false, DOCML_NAME_DELETE_MULTIPLE);
+ showAction(false, DOCML_NAME_SORT_BY_DATE);
+ showAction(false, DOCML_NAME_SORT_BY_NAME);
+ showAction(false, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS);
+ showAction(false, DOCML_NAME_SORT_BY_SIZE);
+ showAction(false, DOCML_NAME_SORT_MENU);
+
+ VideoSortFilterProxyModel &model = mCurrentList->getModel();
+ if (!model.rowCount())
+ {
+ return;
+ }
+
+ // show delete action
+ showAction(true, DOCML_NAME_DELETE_MULTIPLE);
+
+ // show sort actions
+ showAction(true, DOCML_NAME_SORT_MENU);
+ showAction(true, DOCML_NAME_SORT_BY_DATE);
+ showAction(true, DOCML_NAME_SORT_BY_NAME);
+ showAction(true, DOCML_NAME_SORT_BY_SIZE);
+
+ // set current sort action selected
+ int role;
+ Qt::SortOrder order;
+ model.getSorting(role, order);
+ HbAction* action = mSortingRoles.key(role);
+ if (action)
+ {
+ action->setChecked(true);
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
// handleAsyncStatusSlot
// -------------------------------------------------------------------------------------------------
//
void VideoListView::handleAsyncStatusSlot(int statusCode, QVariant &additional)
{
+ FUNC_LOG;
// show msg from status
mUiUtils.showStatusMsgSlot(statusCode, additional);
}
@@ -1235,6 +1269,7 @@
const QString& collection,
const QModelIndex &index)
{
+ FUNC_LOG;
if(mTransitionOngoing)
{
return;
@@ -1244,11 +1279,8 @@
// clear toolbar actions.
toolBar()->clearActions();
}
-
- // update collection specific information
- mCollectionName = collection;
- if(collectionOpened)
+ if(collectionOpened)
{
if(!index.isValid())
{
@@ -1260,43 +1292,46 @@
mUiLoader->findWidget<VideoListWidget>(
DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
- if (mCurrentList &&
- mCurrentList != collectionContentWidget)
+ if (!mCurrentList || mCurrentList == collectionContentWidget)
+ {
+ // no currentlist or currentlist is already list
+ // we're about to transit
+ return;
+ }
+
+ // get item id before deactivating
+ TMPXItemId itemId = TMPXItemId::InvalidId();
+ itemId = mCurrentList->getModel().getMediaIdAtIndex(index);
+
+ // only category or album can be activated here
+ if(itemId == TMPXItemId::InvalidId() ||
+ (itemId.iId2 != KVcxMvcMediaTypeCategory &&
+ itemId.iId2 != KVcxMvcMediaTypeAlbum))
{
- // get item id before deactivating
- TMPXItemId itemId = TMPXItemId::InvalidId();
- itemId = mCurrentList->getModel().getMediaIdAtIndex(index);
-
- // only category or album can be activated here
- if(itemId == TMPXItemId::InvalidId() ||
- (itemId.iId2 != KVcxMvcMediaTypeCategory &&
- itemId.iId2 != KVcxMvcMediaTypeAlbum))
- {
- return;
- }
-
- // Send level that is opened with the effect.
- QVariant nextLevel;
- if(itemId.iId2 == KVcxMvcMediaTypeCategory)
- {
- nextLevel = QVariant(VideoCollectionCommon::ELevelDefaultColl);
- }
- else if(itemId.iId2 == KVcxMvcMediaTypeAlbum)
- {
- nextLevel = QVariant(VideoCollectionCommon::ELevelAlbum);
- }
-
- // Start fetching content.
- collectionContentWidget->getModel().openItem(itemId);
-
- HbEffect::start(collectionContentWidget,
- EFFECT_SLIDE_IN_TO_LEFT,
- this,
- "finishCollectionOpenedSlot",
- nextLevel);
-
- mTransitionOngoing = true;
+ return;
+ }
+
+ // Send level that is opened with the effect.
+ QVariant nextLevel;
+ if(itemId.iId2 == KVcxMvcMediaTypeCategory)
+ {
+ nextLevel = QVariant(VideoCollectionCommon::ELevelDefaultColl);
}
+ else if(itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ {
+ nextLevel = QVariant(VideoCollectionCommon::ELevelAlbum);
+ }
+
+ // Start fetching content.
+ collectionContentWidget->getModel().openItem(itemId);
+
+ HbEffect::start(collectionContentWidget,
+ EFFECT_SLIDE_IN_TO_LEFT,
+ this,
+ "finishCollectionOpenedSlot",
+ nextLevel);
+
+ mTransitionOngoing = true;
}
else
{
@@ -1312,6 +1347,8 @@
mTransitionOngoing = true;
}
+ // update collection specific information
+ mCollectionName = collection;
}
// -------------------------------------------------------------------------------------------------
@@ -1320,6 +1357,7 @@
//
void VideoListView::finishCollectionOpenedSlot(const HbEffect::EffectStatus &status)
{
+ FUNC_LOG;
Q_UNUSED(status);
mTransitionOngoing = false;
@@ -1340,8 +1378,11 @@
VideoCollectionCommon::TCollectionLevels level =
static_cast<VideoCollectionCommon::TCollectionLevels>(status.userData.toInt());
- mCurrentList->activate(level);
-
+ mCurrentList->activate(level);
+
+ VideoCollectionViewUtils::sortModel(&mCurrentList->getModel(), false, VideoCollectionCommon::ELevelVideos);
+ mCurrentList->getModel().invalidate();
+
// update hint widget
setHintLevel(VideoHintWidget::Collection);
showHint();
@@ -1361,6 +1402,7 @@
//
void VideoListView::finishCollectionClosedSlot(const HbEffect::EffectStatus &status)
{
+ FUNC_LOG;
Q_UNUSED(status);
mTransitionOngoing = false;
@@ -1377,51 +1419,44 @@
}
// -------------------------------------------------------------------------------------------------
-// widgetReadySlot
+// objectReadySlot
// -------------------------------------------------------------------------------------------------
//
-void VideoListView::widgetReadySlot(QGraphicsWidget *widget, const QString &name)
+void VideoListView::objectReadySlot(QObject *object, const QString &name)
{
+ FUNC_LOG;
if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0)
{
- connect(widget, SIGNAL(command(int)), this, SIGNAL(command(int)));
- connect(this, SIGNAL(doDelayeds()), widget, SLOT(doDelayedsSlot()));
+ connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
+ connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
}
else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0)
{
connect(
- widget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
+ object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- connect(this, SIGNAL(doDelayeds()), widget, SLOT(doDelayedsSlot()));
+ connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
emit(doDelayeds());
}
else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0)
{
- connect(widget, SIGNAL(command(int)), this, SIGNAL(command(int)));
+ connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
connect(
- widget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
+ object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)),
this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- connect(this, SIGNAL(doDelayeds()), widget, SLOT(doDelayedsSlot()));
+ connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot()));
emit(doDelayeds());
}
else if (name.compare(DOCML_NAME_OPTIONS_MENU) == 0)
{
connect(
- widget, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMainMenuSlot()));
+ object, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMainMenuSlot()));
}
else if (name.compare(DOCML_NAME_HINT_BUTTON) == 0)
{
- connect(widget, SIGNAL(clicked(bool)), this, SLOT(openServicesViewSlot()));
+ connect(object, SIGNAL(clicked(bool)), this, SLOT(openServicesViewSlot()));
}
-}
-
-// -------------------------------------------------------------------------------------------------
-// objectReadySlot
-// -------------------------------------------------------------------------------------------------
-//
-void VideoListView::objectReadySlot(QObject *object, const QString &name)
-{
- if (name.compare(DOCML_NAME_SORT_BY_DATE) == 0)
+ else if (name.compare(DOCML_NAME_SORT_BY_DATE) == 0)
{
HbAction *action = qobject_cast<HbAction*>(object);
if (action)
@@ -1436,7 +1471,7 @@
if (action)
{
connect(action, SIGNAL(triggered()), this, SLOT(startSorting()));
- mSortingRoles[action] = Qt::DisplayRole;
+ mSortingRoles[action] = VideoCollectionCommon::KeyTitle;
}
}
else if (name.compare(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS) == 0)
@@ -1444,9 +1479,8 @@
HbAction *action = qobject_cast<HbAction*>(object);
if (action)
{
- // TODO: implement
- connect(action, SIGNAL(triggered()), this, SLOT(debugNotImplementedYet()));
- mSortingRoles[action] = 0;
+ connect(action, SIGNAL(triggered()), this, SLOT(startSorting()));
+ mSortingRoles[action] = VideoCollectionCommon::KeyNumberOfItems;
}
}
else if (name.compare(DOCML_NAME_SORT_BY_SIZE) == 0)
@@ -1487,6 +1521,7 @@
// Just for testing, remove this
void VideoListView::debugNotImplementedYet()
{
+ FUNC_LOG;
HbMessageBox::information(tr("Not implemented yet"));
}
--- a/videocollection/videocollectionview/src/videolistwidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistwidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,7 @@
*
*/
+#include "videocollectiontrace.h"
#include "videolistwidget.h"
#include <qcoreapplication.h>
@@ -27,6 +28,7 @@
#include <hbmainwindow.h>
#include <hblistviewitem.h>
#include <hbmessagebox.h>
+#include <hbinputdialog.h>
#include <vcxmyvideosdefs.h>
#include "videocollectionviewutils.h"
@@ -52,14 +54,13 @@
mCurrentLevel(VideoCollectionCommon::ELevelInvalid),
mSignalsConnected(false),
mIsService(false),
-mNavKeyBackAction(0),
-mNavKeyQuitAction(0),
+mNavKeyAction(0),
mContextMenu(0),
mSelectionMode(HbAbstractItemView::NoSelection),
mScrollPositionTimer(0),
mUiLoader(uiLoader)
{
- // NOP
+ FUNC_LOG_ADDR(this);
}
// ---------------------------------------------------------------------------
@@ -68,16 +69,15 @@
//
VideoListWidget::~VideoListWidget()
{
+ FUNC_LOG_ADDR(this);
delete mScrollPositionTimer;
mScrollPositionTimer = 0;
mContextMenuActions.clear();
disconnect();
delete mContextMenu;
mContextMenu = 0;
- delete mNavKeyBackAction;
- mNavKeyBackAction = 0;
- delete mNavKeyQuitAction;
- mNavKeyQuitAction = 0;
+ delete mNavKeyAction;
+ mNavKeyAction = 0;
}
// ---------------------------------------------------------------------------
@@ -86,6 +86,7 @@
//
int VideoListWidget::initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices)
{
+ FUNC_LOG_ADDR(this);
mModel = &model;
mVideoServices = videoServices;
@@ -98,11 +99,6 @@
// init list view
VideoCollectionViewUtils::initListView(this);
- // Navigation keys.
- mNavKeyBackAction = new HbAction(Hb::BackNaviAction);
-
- mNavKeyQuitAction = new HbAction(Hb::QuitNaviAction);
-
mScrollPositionTimer = new QTimer();
mScrollPositionTimer->setSingleShot(true);
@@ -122,6 +118,7 @@
//
int VideoListWidget::activate()
{
+ FUNC_LOG_ADDR(this);
return activate(mCurrentLevel);
}
@@ -131,6 +128,9 @@
//
int VideoListWidget::activate(VideoCollectionCommon::TCollectionLevels level)
{
+ FUNC_LOG_ADDR(this);
+ INFO_2("VideoListWidget::activate() [0x%x]: level: %d", this, level);
+
if(!mModel)
{
return -1;
@@ -139,31 +139,16 @@
mCurrentLevel = level;
setVisible(true);
- if ( connectSignals() < 0)
+ setNavigationAction();
+
+ if (connectSignals() < 0)
{
+ ERROR_1(-1, "VideoListWidget::activate() [0x%x]: connecting signals failed.", this);
return -1;
}
- HbView *currentView = hbInstance->allMainWindows().value(0)->currentView();
-
- // Set navigation key only when widget is not in selection mode.
- if(currentView && mSelectionMode == HbAbstractItemView::NoSelection)
- {
- if(level != VideoCollectionCommon::ELevelDefaultColl &&
- level != VideoCollectionCommon::ELevelAlbum)
- {
- if(mNavKeyQuitAction)
- {
- currentView->setNavigationAction(mNavKeyQuitAction);
- }
- }
- else if(mNavKeyBackAction)
- {
- currentView->setNavigationAction(mNavKeyBackAction);
- }
- }
// open model to the current level in case not in album or category
- if(level != VideoCollectionCommon::ELevelAlbum &&
+ if (level != VideoCollectionCommon::ELevelAlbum &&
level != VideoCollectionCommon::ELevelDefaultColl)
{
mModel->open(level);
@@ -183,6 +168,7 @@
//
void VideoListWidget::deactivate()
{
+ FUNC_LOG_ADDR(this);
if(mContextMenu)
{
mContextMenu->hide();
@@ -190,7 +176,7 @@
setVisible(false);
disConnectSignals();
-
+
// Free allocated memory for list thumbnails and disable background fetching.
VideoThumbnailData &thumbnailData = VideoThumbnailData::instance();
thumbnailData.enableBackgroundFetching(false);
@@ -203,6 +189,7 @@
//
VideoCollectionCommon::TCollectionLevels VideoListWidget::getLevel()
{
+ FUNC_LOG_ADDR(this);
return mCurrentLevel;
}
@@ -212,6 +199,10 @@
//
int VideoListWidget::connectSignals()
{
+ FUNC_LOG_ADDR(this);
+
+ int retval(0);
+
if (!mSignalsConnected)
{
if(!connect(this, SIGNAL(scrollingStarted()), this, SLOT(scrollingStartedSlot())) ||
@@ -219,14 +210,33 @@
!connect(this, SIGNAL(scrollPositionChanged(const QPointF &)),
this, SLOT(scrollPositionChangedSlot(const QPointF &))) ||
!connect(mScrollPositionTimer, SIGNAL(timeout()), this, SLOT(scrollPositionTimerSlot())) ||
- !connect(mNavKeyBackAction, SIGNAL(triggered()), this, SLOT(back())) ||
- !connect(mNavKeyQuitAction, SIGNAL(triggered()), qApp, SLOT(quit())))
+ !connect(this, SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
+ this, SLOT(longPressedSlot(HbAbstractViewItem *, const QPointF &))))
{
return -1;
}
+
+ if (!isBrowsingService())
+ {
+ if(VideoCollectionCommon::EModelTypeCollectionContent == mModel->getType())
+ {
+ if (!connect(mNavKeyAction, SIGNAL(triggered()), this, SLOT(back())))
+ {
+ retval = -1;
+ }
+ }
+ else
+ {
+ if (!connect(mNavKeyAction, SIGNAL(triggered()), qApp, SLOT(quit())))
+ {
+ retval = -1;
+ }
+ }
+ }
+
mSignalsConnected = true;
}
- return 0;
+ return retval;
}
// ---------------------------------------------------------------------------
@@ -235,23 +245,129 @@
//
void VideoListWidget::disConnectSignals()
{
- disconnect(this, SIGNAL(scrollingStarted()), this, SLOT(scrollingStartedSlot()));
- disconnect(this, SIGNAL(scrollingEnded()), this, SLOT(scrollingEndedSlot()));
- disconnect(this, SIGNAL(scrollPositionChanged(const QPointF&)),
- this, SLOT(scrollPositionChangedSlot(const QPointF&)));
- disconnect(mScrollPositionTimer, SIGNAL(timeout()), this, SLOT(scrollPositionTimerSlot()));
- disconnect(mNavKeyBackAction, SIGNAL(triggered()), this, SLOT(back()));
- disconnect(mNavKeyQuitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ FUNC_LOG_ADDR(this);
+
+ // safe to disconnect these always
+ disconnect(
+ this, SIGNAL(scrollingStarted()),
+ this, SLOT(scrollingStartedSlot()));
+ disconnect(
+ this, SIGNAL(scrollingEnded()),
+ this, SLOT(scrollingEndedSlot()));
+ disconnect(
+ this, SIGNAL(scrollPositionChanged(const QPointF&)),
+ this, SLOT(scrollPositionChangedSlot(const QPointF&)));
+ disconnect(this, SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
+ this, SLOT(longPressedSlot(HbAbstractViewItem *, const QPointF &)));
+
+ // check that scroll position timer is created
+ if (mScrollPositionTimer)
+ {
+ disconnect(
+ mScrollPositionTimer, SIGNAL(timeout()),
+ this, SLOT(scrollPositionTimerSlot()));
+ }
+
+ // check that model and navigation action exists
+ if (!isBrowsingService())
+ {
+ if (mModel &&
+ mModel->getType() == VideoCollectionCommon::EModelTypeCollectionContent)
+ {
+ if (mNavKeyAction)
+ {
+ disconnect(
+ mNavKeyAction, SIGNAL(triggered()),
+ this, SLOT(back()));
+ }
+ }
+ else
+ {
+ if (mNavKeyAction)
+ {
+ disconnect(
+ mNavKeyAction, SIGNAL(triggered()),
+ qApp, SLOT(quit()));
+ }
+ }
+ }
mSignalsConnected = false;
}
// ---------------------------------------------------------------------------
+// isBrowsingService
+// ---------------------------------------------------------------------------
+//
+bool VideoListWidget::isBrowsingService() const
+{
+ FUNC_LOG_ADDR(this);
+
+ bool isBrowsingService = false;
+
+ if (mIsService &&
+ mVideoServices &&
+ mVideoServices->currentService() == VideoServices::EBrowse)
+ {
+ isBrowsingService = true;
+ }
+
+ return isBrowsingService;
+
+}
+
+// ---------------------------------------------------------------------------
+// setNavigationAction
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::setNavigationAction()
+{
+ FUNC_LOG_ADDR(this);
+
+ // Create navigation action if not already created
+ if (!mNavKeyAction)
+ {
+ if (isBrowsingService())
+ {
+ mNavKeyAction = new HbAction(Hb::QuitNaviAction);
+ if (mNavKeyAction)
+ {
+ connect(
+ mNavKeyAction, SIGNAL(triggered()),
+ mVideoServices, SLOT(browsingEnded()));
+ }
+ }
+ else if (mModel)
+ {
+ if (VideoCollectionCommon::EModelTypeCollectionContent == mModel->getType())
+ {
+ mNavKeyAction = new HbAction(Hb::BackNaviAction);
+ }
+ else
+ {
+ mNavKeyAction = new HbAction(Hb::QuitNaviAction);
+ }
+ }
+ }
+
+ // Set navigation action only when widget is not in selection mode
+ if (mSelectionMode == HbAbstractItemView::NoSelection)
+ {
+ HbView *currentView = hbInstance->allMainWindows().value(0)->currentView();
+ if (currentView)
+ {
+ currentView->setNavigationAction(mNavKeyAction);
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
// deleteItemSlot
// ---------------------------------------------------------------------------
//
void VideoListWidget::deleteItemSlot()
{
+ FUNC_LOG_ADDR(this);
if(!mModel)
{
return;
@@ -259,12 +375,12 @@
QVariant variant;
QModelIndex index = currentIndex();
- variant = mModel->data(index, Qt::DisplayRole);
+ variant = mModel->data(index, VideoCollectionCommon::KeyTitle);
if (variant.isValid())
{
QString text = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
- variant.toStringList().first());
+ variant.toString());
if(HbMessageBox::question(text))
{
QModelIndexList list;
@@ -280,6 +396,7 @@
//
void VideoListWidget::createContextMenu()
{
+ FUNC_LOG_ADDR(this);
if(mContextMenu)
{
return;
@@ -289,15 +406,36 @@
if (mContextMenu)
{
mContextMenu->setDismissPolicy(HbPopup::TapAnywhere);
- if (mIsService)
+
+ VideoServices::TVideoService service = VideoServices::ENoService;
+ if (mIsService &&
+ mVideoServices)
+ {
+ service = mVideoServices->currentService();
+ }
+
+ if (service == VideoServices::EUriFetcher)
{
mContextMenuActions[EActionPlay] =
- mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot()));
+ mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(openItemSlot()));
+ 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(openItemSlot()));
+ 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(openItemSlot()));
+ 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] =
@@ -320,6 +458,7 @@
//
void VideoListWidget::setContextMenu()
{
+ FUNC_LOG_ADDR(this);
if(!mContextMenu)
{
createContextMenu();
@@ -327,7 +466,7 @@
if (!mContextMenu)
{
- // failed to create context menu, return
+ ERROR_1(-1, "VideoListWidget::setContextMenu() [0x%x]: failed to create context menu.", this);
return;
}
@@ -343,32 +482,36 @@
}
if(menuActionCount != mContextMenuActions.values().count() || mContextMenuActions.values().count() == 0)
{
- // fatal error, some action(s) was not created before.
+ ERROR_1(-1, "VideoListWidget::setContextMenu() [0x%x]: all actions have not been created.", this);
delete mContextMenu;
mContextMenu = 0;
mContextMenuActions.clear();
return;
}
- HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
+ if (isBrowsingService())
+ {
+ setBrowsingServiceContextMenu();
+ return;
+ }
+
if(mCurrentLevel == VideoCollectionCommon::ELevelVideos ||
mCurrentLevel == VideoCollectionCommon::ELevelDefaultColl)
- {
+ {
if (!mIsService)
{
mContextMenuActions[EActionAddToCollection]->setVisible(true);
mContextMenuActions[EActionDelete]->setVisible(true);
}
- else
- {
- mContextMenuActions[EActionPlay]->setVisible(true);
- }
+ mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
}
else if(mCurrentLevel == VideoCollectionCommon::ELevelCategory)
{
- if(!mIsService)
+ mContextMenuActions[EActionOpen]->setVisible(true);
+ TMPXItemId mpxId = mModel->getMediaIdAtIndex(currentIndex());
+ if(!mIsService && mpxId.iId2 == KVcxMvcMediaTypeAlbum)
{
mContextMenuActions[EActionRename]->setVisible(true);
mContextMenuActions[EActionRemoveCollection]->setVisible(true);
@@ -381,14 +524,22 @@
mContextMenuActions[EActionRemove]->setVisible(true);
mContextMenuActions[EActionDelete]->setVisible(true);
}
- else
- {
- mContextMenuActions[EActionPlay]->setVisible(true);
- }
+ mContextMenuActions[EActionPlay]->setVisible(true);
mContextMenuActions[EActionDetails]->setVisible(true);
}
}
+// ---------------------------------------------------------------------------
+// setBrowsingServiceContextMenu
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::setBrowsingServiceContextMenu()
+{
+ FUNC_LOG_ADDR(this);
+ mContextMenuActions[EActionPlay]->setVisible(true);
+ mContextMenuActions[EActionDelete]->setVisible(true);
+ mContextMenuActions[EActionDetails]->setVisible(true);
+}
// ---------------------------------------------------------------------------
// getModel
@@ -396,6 +547,7 @@
//
VideoSortFilterProxyModel& VideoListWidget::getModel()
{
+ FUNC_LOG_ADDR(this);
return *mModel;
}
@@ -406,7 +558,8 @@
//
void VideoListWidget::emitActivated (const QModelIndex &modelIndex)
{
- // surprisingly interenting feature: after long press also single press
+ FUNC_LOG_ADDR(this);
+ // surprisingly interesting feature: after long press also single press
// is executed. as a workaround the following hack check is needed.
// otherwise after the context menu is shown also single press action
// is executed.
@@ -416,43 +569,57 @@
// do not activate context menu if it is already visible
return;
}
-
if(mSelectionMode != HbAbstractItemView::NoSelection)
{
// no custom functionality defined
emit activated(modelIndex);
return;
}
+ if(mIsService &&
+ mVideoServices &&
+ mVideoServices->currentService() == VideoServices::EUriFetcher &&
+ mCurrentLevel != VideoCollectionCommon::ELevelCategory)
+ {
+ QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath);
+ if ( variant.isValid() )
+ {
+ QString itemPath = variant.value<QString>();
+ emit(fileUri(itemPath));
+ }
+ }
+ else
+ {
+ doActivateItem(modelIndex);
+ }
+}
- if (!mModel || !modelIndex.isValid())
+// ---------------------------------------------------------------------------
+// doActivateItem
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::doActivateItem(const QModelIndex &index)
+{
+ FUNC_LOG_ADDR(this);
+ if (!mModel || !index.isValid())
{
return;
}
if (mCurrentLevel == VideoCollectionCommon::ELevelCategory)
{
- QVariant variant = mModel->data(modelIndex, Qt::DisplayRole);
+ QVariant variant = mModel->data(index, VideoCollectionCommon::KeyTitle);
if (variant.isValid())
{
// signal view that item has been activated
emit(collectionOpened(true,
- variant.toStringList().first(),
- modelIndex));
+ variant.toString(),
+ index));
}
return;
}
- if(mIsService && (mCurrentLevel != VideoCollectionCommon::ELevelCategory))
- {
- QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath);
- if ( variant.isValid() )
- {
- QString itemPath = variant.value<QString>();
- emit(fileUri(itemPath));
- }
- }
else
{
- mModel->openItem(mModel->getMediaIdAtIndex(modelIndex));
+ mModel->openItem(mModel->getMediaIdAtIndex(index));
}
}
@@ -461,9 +628,9 @@
// called by the fw when user long presses some item
// ---------------------------------------------------------------------------
//
-//
void VideoListWidget::setSelectionMode(int mode)
{
+ FUNC_LOG_ADDR(this);
HbAbstractItemView::SelectionMode selMode = HbAbstractItemView::NoSelection;
if(mode >= HbAbstractItemView::NoSelection && mode <= HbAbstractItemView::ContiguousSelection)
{
@@ -475,42 +642,54 @@
}
// ---------------------------------------------------------------------------
-// longPressGesture
+// longPressedSlot
// called by the fw when user long presses some item
// ---------------------------------------------------------------------------
//
-//
-void VideoListWidget::longPressGesture (const QPointF &point)
+void VideoListWidget::longPressedSlot(HbAbstractViewItem *item, const QPointF &point)
{
+ FUNC_LOG_ADDR(this);
if(mSelectionMode != HbAbstractItemView::NoSelection)
{
// do not activate context menu during selection mode
return;
}
- HbAbstractViewItem *viewItem = itemAtPosition(point);
- if (viewItem)
+ if(item)
{
- QModelIndex index = viewItem->modelIndex();
+ QModelIndex index = item->modelIndex();
if(mModel && index.isValid())
- {
- TMPXItemId mpxId = mModel->getMediaIdAtIndex(index);
- // Only videos and user created albums have context menu.
- if((mpxId.iId2 == KVcxMvcMediaTypeVideo) ||
- (!mIsService && mpxId.iId2 == KVcxMvcMediaTypeAlbum ))
+ {
+ setContextMenu();
+ // if menu not yet exists, it has been created
+ // setup might fail causing menu to be removed
+ if(mContextMenu)
{
- setContextMenu();
- // if menu not yet exists, it has been created
- // setup might fail causing menu to be removed
- if(mContextMenu)
- {
- mContextMenu->setPreferredPos(point);
- mContextMenu->show();
- }
+ mContextMenu->setPreferredPos(point);
+ mContextMenu->show();
}
}
}
- HbListView::longPressGesture(point);
+}
+
+// ---------------------------------------------------------------------------
+// panGesture
+// ---------------------------------------------------------------------------
+//
+void VideoListWidget::panGesture(const QPointF &point)
+{
+ FUNC_LOG_ADDR(this);
+ if (mContextMenu)
+ {
+ if (!mContextMenu->isVisible())
+ {
+ HbListView::panGesture(point);
+ }
+ }
+ else
+ {
+ HbListView::panGesture(point);
+ }
}
// ---------------------------------------------------------------------------
@@ -519,6 +698,7 @@
//
void VideoListWidget::doDelayedsSlot()
{
+ FUNC_LOG_ADDR(this);
if (!mContextMenu)
{
createContextMenu();
@@ -529,9 +709,10 @@
// playItemSlot
// ---------------------------------------------------------------------------
//
-void VideoListWidget::playItemSlot()
+void VideoListWidget::openItemSlot()
{
- mModel->openItem(mModel->getMediaIdAtIndex(currentIndex()));
+ FUNC_LOG_ADDR(this);
+ doActivateItem(currentIndex());
}
// ---------------------------------------------------------------------------
@@ -540,6 +721,7 @@
//
void VideoListWidget::openDetailsSlot()
{
+ FUNC_LOG_ADDR(this);
if(mModel && mModel->fetchItemDetails(currentIndex()) == 0 )
{
emit command(MpxHbVideoCommon::ActivateVideoDetailsView);
@@ -552,7 +734,33 @@
//
void VideoListWidget::renameSlot()
{
- debugNotImplementedYet();
+ FUNC_LOG_ADDR(this);
+ if(!mModel)
+ {
+ return;
+ }
+
+ QModelIndex index = currentIndex();
+ QVariant variant = mModel->data(index, VideoCollectionCommon::KeyTitle);
+ TMPXItemId itemId = mModel->getMediaIdAtIndex(index);
+
+ if(variant.isValid() && itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ {
+ bool ok = false;
+ QString label(hbTrId("txt_videos_title_enter_name"));
+ QString albumName = variant.toString();
+ QString newAlbumName;
+
+ // Query a name for the collection
+ newAlbumName = HbInputDialog::getText(label, albumName, &ok);
+ // Rename only when name has changed.
+ if(ok && newAlbumName.length() && newAlbumName.trimmed() != albumName)
+ {
+ // Resolve collection true name and rename the album
+ newAlbumName = mModel->resolveAlbumName(newAlbumName);
+ mModel->renameAlbum(itemId, newAlbumName);
+ }
+ }
}
// ---------------------------------------------------------------------------
@@ -561,11 +769,13 @@
//
void VideoListWidget::addToCollectionSlot()
{
+ FUNC_LOG_ADDR(this);
VideoListSelectionDialog *dialog =
mUiLoader->findWidget<VideoListSelectionDialog>(
DOCML_NAME_DIALOG);
if (!dialog || !mModel)
{
+ ERROR_1(-1, "VideoListWidget::addToCollectionSlot() [0x%x]: failed to get selection dialog or model is null.", this);
return;
}
TMPXItemId itemId = mModel->getMediaIdAtIndex(currentIndex());
@@ -582,6 +792,7 @@
//
void VideoListWidget::removeFromCollectionSlot()
{
+ FUNC_LOG_ADDR(this);
if(!mModel)
{
return;
@@ -603,6 +814,7 @@
//
void VideoListWidget::removeCollectionSlot()
{
+ FUNC_LOG_ADDR(this);
if(!mModel)
{
return;
@@ -610,12 +822,12 @@
QVariant variant;
QModelIndex index = currentIndex();
- variant = mModel->data(index, Qt::DisplayRole);
+ variant = mModel->data(index, VideoCollectionCommon::KeyTitle);
if (variant.isValid())
{
- QString text = tr("Do you want to remove collection \"%1\"?").arg( //TODO: localisation
- variant.toStringList().first());
+ QString text = hbTrId("txt_videos_info_do_you_want_to_remove_collection").arg(
+ variant.toString());
if(HbMessageBox::question(text))
{
QModelIndexList list;
@@ -626,25 +838,18 @@
}
// ---------------------------------------------------------------------------
-// playAllSlot
-// ---------------------------------------------------------------------------
-//
-void VideoListWidget::playAllSlot()
-{
- debugNotImplementedYet();
-}
-
-// ---------------------------------------------------------------------------
// back
// ---------------------------------------------------------------------------
//
void VideoListWidget::back()
{
- // Empty the proxy model causing the items to be removed from list widget.
- mModel->setAlbumInUse(TMPXItemId::InvalidId());
+ FUNC_LOG_ADDR(this);
+
if(mModel)
{
- emit collectionOpened(false, QString(), QModelIndex());
+ // Empty the proxy model causing the items to be removed from list widget.
+ mModel->setAlbumInUse(TMPXItemId::InvalidId());
+ emit collectionOpened(false, QString(), QModelIndex());
}
}
@@ -654,6 +859,7 @@
//
void VideoListWidget::scrollingStartedSlot()
{
+ FUNC_LOG_ADDR(this);
VideoThumbnailData::instance().enableThumbnailCreation(false);
}
@@ -663,8 +869,11 @@
//
void VideoListWidget::scrollingEndedSlot()
{
+ FUNC_LOG_ADDR(this);
if(mScrollPositionTimer)
- mScrollPositionTimer->stop();
+ {
+ mScrollPositionTimer->stop();
+ }
VideoThumbnailData::instance().enableThumbnailCreation(true);
fetchThumbnailsForVisibleItems();
}
@@ -686,6 +895,7 @@
//
void VideoListWidget::scrollPositionTimerSlot()
{
+ FUNC_LOG_ADDR(this);
fetchThumbnailsForVisibleItems();
}
@@ -695,6 +905,7 @@
//
void VideoListWidget::fetchThumbnailsForVisibleItems()
{
+ FUNC_LOG_ADDR(this);
const QList<HbAbstractViewItem *> itemsVisible = visibleItems();
if(itemsVisible.count() > 0)
@@ -704,13 +915,4 @@
}
}
-// ---------------------------------------------------------------------------
-// debugNotImplementedYet
-// ---------------------------------------------------------------------------
-//
-void VideoListWidget::debugNotImplementedYet()
-{
- HbMessageBox::information(tr("Not implemented yet"));
-}
-
// end of file
--- a/videocollection/videocollectionview/tsrc/testcollectionview/inc/testcollectionview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testcollectionview/inc/testcollectionview.h Mon May 03 12:32:50 2010 +0300
@@ -31,8 +31,11 @@
public:
- TestCollectionView();
-
+
+
+ // test functions for the test framework
+private slots:
+
/**
* call to init a testcase
*/
@@ -43,13 +46,10 @@
*/
void cleanup();
- // test functions for the test framework
-private slots:
-
/**
* called before anything else when test starts
*/
- void initTestCase();
+ void initTestCase();
/**
* will be called after testing ends
@@ -64,13 +64,16 @@
void testGetView();
void testBack();
void testOrientationChange();
+ void testTimerEvent();
signals:
void commandSignal(int);
private:
+
VideoCollectionViewPlugin* mTestView;
+
};
--- a/videocollection/videocollectionview/tsrc/testcollectionview/src/testcollectionview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testcollectionview/src/testcollectionview.cpp Mon May 03 12:32:50 2010 +0300
@@ -14,11 +14,15 @@
* Description: tester for methods in VideoSortFilterProxyModel
*
*/
+
+#include "xqserviceutilxtra.h"
+
#include <hbaction.h>
#include <qpointer.h>
#include <hbapplication.h>
#include <hbinstance.h>
#include <hblabel.h>
+#include <vcxmyvideosdefs.h>
#include "videocollectionuiloader.h"
#include "testcollectionview.h"
@@ -27,9 +31,12 @@
#include "videolistviewdata.h"
#include "videocollectionuiloaderdata.h"
+#include "videoservicebrowsedata.h"
+#include "videolistviewdata.h"
#define private public
#include "videocollectionviewplugin.h"
+#include "videoservices.h"
#undef private
// ---------------------------------------------------------------------------
@@ -62,14 +69,6 @@
}
-// ---------------------------------------------------------------------------
-// TestCollectionView
-// ---------------------------------------------------------------------------
-//
-TestCollectionView::TestCollectionView()
- : mTestView(0)
-{
-}
// ---------------------------------------------------------------------------
// initTestCase
@@ -95,10 +94,13 @@
//
void TestCollectionView::init()
{
- cleanup();
+
VideoCollectionUiLoaderData::reset();
VideoListViewData::reset();
-
+ VideoServiceBrowseData::reset();
+ VideoListViewData::reset();
+
+ mTestView = 0;
mTestView = new VideoCollectionViewPlugin();
mTestView->createView();
@@ -131,7 +133,7 @@
}
// ---------------------------------------------------------------------------
-// Slot: test create view
+// testCreateView
// ---------------------------------------------------------------------------
//
void TestCollectionView::testCreateView()
@@ -140,12 +142,9 @@
VideoCollectionUiLoaderData::reset();
VideoListViewData::reset();
+ // finding view object from docml fails
VideoCollectionUiLoaderData::mFindFailure = true;
-
mTestView = new VideoCollectionViewPlugin();
-
- QVERIFY( mTestView->mView == 0 );
-
mTestView->createView();
QVERIFY( mTestView->mView == 0 );
@@ -154,18 +153,23 @@
delete mTestView;
VideoCollectionUiLoaderData::mFindFailure = false;
-
mTestView = new VideoCollectionViewPlugin();
-
- QVERIFY( mTestView->mView == 0 );
-
mTestView->createView();
-
QVERIFY( mTestView->mView != 0 );
QVERIFY( mTestView->mUiLoader != 0);
QCOMPARE( VideoListViewData::mInitializeViewCount, 1 );
QVERIFY( mTestView->mActivated == false );
-
+
+ // second create without view object (for coverity)
+ delete mTestView->mView;
+ mTestView->mView = 0;
+ mTestView->createView();
+ QVERIFY( mTestView->mView != 0 );
+ QVERIFY( mTestView->mUiLoader != 0);
+ QCOMPARE( VideoListViewData::mInitializeViewCount, 2 );
+ QVERIFY( mTestView->mActivated == false );
+
+ // make sure command signaling works
connect( this, SIGNAL(commandSignal(int)), mTestView->mView, SIGNAL(command(int)));
QSignalSpy commandSpy(mTestView, SIGNAL(command(int)));
emit commandSignal(5);
@@ -174,47 +178,81 @@
QCOMPARE( arguments.at(0).toInt(), 5 );
disconnect();
+ // view exists
VideoListView* current = mTestView->mView;
-
mTestView->createView();
-
- QCOMPARE( mTestView->mView, current );
-
+ QCOMPARE( mTestView->mView, current );
HbMainWindow *window = hbInstance->allMainWindows().value(0);
if (window)
{
window->addView(current);
}
-
- cleanup();
}
// ---------------------------------------------------------------------------
-// Slot: test activate view
+// testActivateView
// ---------------------------------------------------------------------------
//
void TestCollectionView::testActivateView()
{
- init();
-
+ XQServiceUtilXtra *serviceUtil = XQServiceUtilXtra::instance();
+ VideoServices *videoServices = VideoServices::instance();
+
+ // activate view two times
mTestView->activateView();
QVERIFY( mTestView->mActivated == true );
QCOMPARE( VideoListViewData::mActivateViewCount, 1 );
-
mTestView->activateView();
QCOMPARE( VideoListViewData::mActivateViewCount, 1 );
+ cleanup();
+
+ // activate view as service:
+ // -browse service
+ // -captured category
+ init();
+ serviceUtil->setCurrentService(true);
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ VideoServiceBrowseData::mBrowseCategory = KVcxMvcCategoryIdCaptured;
+ mTestView->activateView();
+ QCOMPARE(VideoListViewData::mActivateViewCount, 1);
+ QVERIFY(VideoListViewData::mActivatedItemId.iId1 == KVcxMvcCategoryIdCaptured);
+ QVERIFY(VideoListViewData::mActivatedItemId.iId2 == KVcxMvcMediaTypeCategory);
+ cleanup();
+
+ // activate view as browse service:
+ // -browse service
+ // -downloads category
+ init();
+ serviceUtil->setCurrentService(true);
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ VideoServiceBrowseData::mBrowseCategory = KVcxMvcCategoryIdDownloads;
+ mTestView->activateView();
+ QCOMPARE(VideoListViewData::mActivateViewCount, 1);
+ QVERIFY(VideoListViewData::mActivatedItemId.iId1 == KVcxMvcCategoryIdDownloads);
+ QVERIFY(VideoListViewData::mActivatedItemId.iId2 == KVcxMvcMediaTypeCategory);
+ cleanup();
+ // activate view as browse service:
+ // -uri fetch service
+ init();
+ serviceUtil->setCurrentService(true);
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ mTestView->activateView();
+ QCOMPARE(VideoListViewData::mActivateViewCount, 1);
+ QVERIFY(VideoListViewData::mActivatedItemId == TMPXItemId::InvalidId());
cleanup();
+
+ // final cleanup
+ serviceUtil->decreaseReferenceCount();
+ videoServices->decreaseReferenceCount();
}
// ---------------------------------------------------------------------------
-// Slot: test deactivate view
+// testDeactivateView
// ---------------------------------------------------------------------------
//
void TestCollectionView::testDeactivateView()
{
- init();
-
mTestView->deactivateView();
QCOMPARE( VideoListViewData::mDeactivateViewCount, 0 );
QVERIFY( mTestView->mActivated == false );
@@ -228,18 +266,14 @@
mTestView->deactivateView();
QCOMPARE( VideoListViewData::mDeactivateViewCount, 1 );
QVERIFY( mTestView->mActivated == false );
-
- cleanup();
}
// ---------------------------------------------------------------------------
-// Slot: test destroy view
+// testDestroyView
// ---------------------------------------------------------------------------
//
void TestCollectionView::testDestroyView()
{
- init();
-
// remove view from mainwindow so that we don't get hanging pointers there, as
// the test is creating and destroying view several times.
HbMainWindow *window = hbInstance->allMainWindows().value(0);
@@ -264,20 +298,15 @@
QVERIFY( mTestView->mActivated == false );
QVERIFY( mTestView->mView == 0 );
QVERIFY( mTestView->mUiLoader == 0);
-
- cleanup();
}
// ---------------------------------------------------------------------------
-// Slot: test get view
+// testGetView
// ---------------------------------------------------------------------------
//
void TestCollectionView::testGetView()
{
- cleanup();
- mTestView = new VideoCollectionViewPlugin();
-
- QVERIFY( mTestView->getView() == 0 );
+ QVERIFY( mTestView->getView() == mTestView->mView );
mTestView->createView();
QVERIFY( mTestView->getView() == mTestView->mView );
mTestView->activateView();
@@ -285,30 +314,26 @@
mTestView->deactivateView();
QVERIFY( mTestView->getView() == mTestView->mView );
mTestView->destroyView();
- QVERIFY( mTestView->getView() == 0 );
-
- cleanup();
+ QVERIFY( mTestView->getView() == 0 );
+ // need to create view to handle cleaning up correctly
+ mTestView->createView();
}
// ---------------------------------------------------------------------------
-// Slot: test get view
+// testBack
// ---------------------------------------------------------------------------
//
void TestCollectionView::testBack()
{
- init();
-
mTestView->back();
QCOMPARE( VideoListViewData::mBackCount, 0 );
mTestView->activateView();
mTestView->back();
QCOMPARE( VideoListViewData::mBackCount, 1 );
-
- cleanup();
}
// ---------------------------------------------------------------------------
-// Slot: test orientation change
+// testOrientationChange
// ---------------------------------------------------------------------------
//
void TestCollectionView::testOrientationChange()
@@ -316,9 +341,29 @@
// there's nothing to be tested for this.
// slot is probably going to be removed. This is here just to have the
// function decision coverage on correct level.
- init();
mTestView->orientationChange(Qt::Horizontal);
- cleanup();
+
+}
+
+// ---------------------------------------------------------------------------
+// testTimerEvent
+// ---------------------------------------------------------------------------
+//
+void TestCollectionView::testTimerEvent()
+{
+ QSignalSpy commandSpy(mTestView, SIGNAL(command(int)));
+ QSignalSpy delayedSpy(mTestView, SIGNAL(doDelayeds()));
+
+ QEvent event(QEvent::Timer);
+ QApplication::sendEvent(mTestView, &event);
+ QVERIFY(commandSpy.count() == 0);
+ QVERIFY(delayedSpy.count() == 0);
+
+ QTimerEvent timerEvent(mTestView->mTimerId);
+ QApplication::sendEvent(mTestView, &timerEvent);
+ QVERIFY(commandSpy.count() == 1);
+ QVERIFY(delayedSpy.count() == 1);
+
}
--- a/videocollection/videocollectionview/tsrc/testcollectionview/testcollectionview.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testcollectionview/testcollectionview.pro Mon May 03 12:32:50 2010 +0300
@@ -18,6 +18,9 @@
TARGET =
+CONFIG += qtestlib \
+ Hb
+
DEPENDPATH += . \
inc \
src \
--- a/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Mon May 03 12:32:50 2010 +0300
@@ -22,6 +22,7 @@
// INCLUDES
#include <QtTest/QtTest>
#include "hbmessagebox.h"
+#include "hbeffect.h"
class VideoListView;
class VideoSortFilterProxyModel;
@@ -46,7 +47,12 @@
/**
* Set row count in model.
*/
- void setRowCount(int count);
+ void setRowCount(int count, VideoSortFilterProxyModel *model = 0);
+
+ /**
+ * Check if action is visible.
+ */
+ bool isActionVisible(const char *name) const;
// Test functions for the test framework.
@@ -68,11 +74,6 @@
void testInitializeView();
/**
- * Tests creating menu of the view.
- */
- void testCreateListMenu();
-
- /**
* Tests menus.
*/
void testMenus();
@@ -86,7 +87,7 @@
* Tests activatView.
*/
void testActivateView();
-
+
/**
* Tests deactivateView.
*/
@@ -113,11 +114,6 @@
void testAboutToShowMainMenuSlot();
/**
- * Tests openSortByMenuSlot
- */
- void testOpenSortByMenuSlot();
-
- /**
* Tests handleStatusSlot.
*/
void testHandleStatusSlot();
@@ -161,20 +157,82 @@
* Tests showHint
*/
void testShowHint();
+
+ /**
+ * Tests titleReadySlot
+ */
+ void testTitleReadySlot();
+ /**
+ * Tests doDelayedsSlot
+ */
+ void testDoDelayedsSlot();
+
+ /**
+ * Tests openNewAlbumSlot
+ */
+ void testOpenNewAlbumSlot();
+
+ /**
+ * Tests aboutToChangeOrientationSlot
+ */
+ void testAboutToChangeOrientationSlot();
+
+ /**
+ * Tests orientationChangedSlot
+ */
+ void testOrientationChangedSlot();
+
+ /**
+ * Tests createCollectionSlot
+ */
+ void testCreateCollectionSlot();
+
+ /**
+ * Tests addVideosToCollectionSlot
+ */
+ void testAddVideosToCollectionSlot();
+
+ /**
+ * Tests removeVideosFromCollectionSlot
+ */
+ void testRemoveVideosFromCollectionSlot();
+
+ /**
+ * Tests finishCollectionOpenedSlot
+ */
+ void testFinishCollectionOpenedSlot();
+
+ /**
+ * Tests finishCollectionClosedSlot
+ */
+ void testFinishCollectionClosedSlot();
+
signals:
// Signals needed in tests.
void testSignal();
+
+ void testSignal2();
void testSignal(int);
+
+ void testSignal(const QString &);
void testLayoutChangedSignal();
- void testCollectionOpenedSignal(bool, const QString&);
+ void testCollectionOpenedSignal(bool, const QString&, const QModelIndex&);
void testStatusSignal(int, QVariant&);
+ void testObjectReadySignal(QObject*, const QString);
+
+ void testSignal(const QModelIndex &parent, int start, int end);
+
+ void testSignal(Qt::Orientation);
+
+ void testSignal(const HbEffect::EffectStatus &status);
+
private:
VideoCollectionUiLoader* mUiLoader;
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,31 +15,46 @@
*
*/
+// Version : %version: 36 %
+
+#define private public
+#include "videoservices.h"
+#include "videosortfilterproxymodel.h"
+#include "videolistwidget.h"
+#include "videolistview.h"
+#undef private
+
+#include <qdebug.h>
+#include <xqserviceutil.h>
#include <QtTest/QtTest>
-#include <hbapplication.h>
-#include <hbinstance.h>
+#include "hbapplication.h"
+#include "hbeffect.h"
+#include "hbinstance.h"
+#include "hbmenu.h"
+#include "hbmenudata.h"
+#include "hbtoolbar.h"
+#include "hbaction.h"
+#include "hbstackedwidget.h"
+#include "hbgroupbox.h"
+#include "hbdocumentloader.h"
+#include "hbview.h"
+#include "hblistview.h"
+#include "hbinputdialog.h"
#include <qactiongroup.h>
-#include <hbmenu.h>
-#include <hbtoolbar.h>
-#include <hbaction.h>
#include <videocollectioncommon.h>
-#include <hbstackedwidget.h>
-#include <hbgroupbox.h>
-#include <hbdocumentloader.h>
#include <qhash.h>
#include <qmap.h>
-#include <hbview.h>
-#include <hblistview.h>
#include <mpxitemid.h>
#include <vcxmyvideosdefs.h>
+#include "videocollectionuiloader.h"
#include "videocollectionwrapper.h"
#include "testlistview.h"
#include "videocollectionviewutils.h"
#include "videolistselectiondialog.h"
-#include "videosortfilterproxymodel.h"
#include "videocollectionwrapper.h"
#include "videohintwidget.h"
+#include "videohintwidgetdata.h"
#include "videolistwidgetdata.h"
#include "videocollectionwrapperdata.h"
#include "videocollectionviewutilsdata.h"
@@ -47,12 +62,7 @@
#include "videosortfilterproxymodeldata.h"
#include "videocollectionuiloaderdata.h"
#include "videolistdatamodeldata.h"
-
-#define private public
-#include "videolistwidget.h"
-#include "videocollectionuiloader.h"
-#include "videolistview.h"
-#undef private
+#include "xqserviceutilxtra.h"
// ---------------------------------------------------------------------------
// main
@@ -62,6 +72,7 @@
{
HbApplication app(argc, argv);
HbMainWindow window;
+ hbInstance->mWindowses.append(&window);
TestListView tv;
@@ -88,17 +99,18 @@
//
void TestListView::init(bool initTestView)
{
+ XQServiceUtilXtra::service = false;
mUiLoader = new VideoCollectionUiLoader();
mUiLoader->reset();
bool ok(false);
- QList<QObject *> objects = mUiLoader->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ mUiLoader->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
if (!ok)
{
return;
}
- mTestView = mUiLoader->findObject<VideoListView>( DOCML_NAME_VIEW );
+ mTestView = mUiLoader->findWidget<VideoListView>( DOCML_NAME_VIEW );
QVERIFY(mTestView);
if(initTestView)
{
@@ -118,11 +130,11 @@
//
void TestListView::cleanup()
{
- delete mTestView;
- mTestView = 0;
+ delete mUiLoader;
+ mUiLoader = 0;
mWrapper = 0;
-
+ mTestView = 0;
disconnect();
VideoListWidgetData::reset();
@@ -130,6 +142,7 @@
VideoCollectionViewUtilsData::reset();
VideoListSelectionDialogData::reset();
VideoSortFilterProxyModelData::reset();
+ HbDocumentLoader::cleanup();
}
// ---------------------------------------------------------------------------
@@ -141,11 +154,13 @@
int visibleActions(0);
VideoCollectionUiLoader::ActionIds key;
HbAction *action(0);
- foreach(key,mUiLoader->mMenuActions.keys())
+ foreach (key,VideoCollectionUiLoaderData::mMenuActions.keys())
{
- action = dynamic_cast<HbAction*>(mUiLoader->mMenuActions[key]);
- if(action && action->isVisible())
- visibleActions++;
+ action = dynamic_cast<HbAction*>(VideoCollectionUiLoaderData::mMenuActions[key]);
+ if (action && action->isVisible())
+ {
+ visibleActions++;
+ }
}
return visibleActions;
}
@@ -154,29 +169,61 @@
// setRowCount
// ---------------------------------------------------------------------------
//
-void TestListView::setRowCount(int count)
+void TestListView::setRowCount(int count, VideoSortFilterProxyModel *model)
{
- if (mTestView)
+ if(!model)
{
- if (!mTestView->mCurrentList)
+ if (mTestView)
{
- mTestView->activateView();
+ if (!mTestView->mCurrentList)
+ {
+ mTestView->activateView(TMPXItemId::InvalidId());
+ }
+ model = mTestView->mCurrentList->mModel;
}
- VideoSortFilterProxyModel *model = mTestView->mCurrentList->mModel;
- if (model)
+ }
+
+ if (model)
+ {
+ VideoListDataModel *sourceModel =
+ qobject_cast<VideoListDataModel*>(
+ model->sourceModel());
+ if(sourceModel)
{
- VideoListDataModel *sourceModel =
- qobject_cast<VideoListDataModel*>(
- model->sourceModel());
- if (sourceModel)
- {
- VideoListDataModelData::setRowCount(*sourceModel, count);
- }
+ VideoListDataModelData::setRowCount(*sourceModel, count);
}
}
}
// ---------------------------------------------------------------------------
+// isActionVisible
+// ---------------------------------------------------------------------------
+//
+bool TestListView::isActionVisible(const char *name) const
+{
+ bool isVisible = false;
+
+ HbAction *action = mUiLoader->findObject<HbAction>(name);
+ if (!action)
+ {
+ // must be menu widget
+ HbMenu *menu = mUiLoader->findWidget<HbMenu>(name);
+ if (menu)
+ {
+ action = menu->menuAction();
+ }
+ }
+
+ // check if action is visible
+ if (action)
+ {
+ isVisible = action->isVisible();
+ }
+
+ return isVisible;
+}
+
+// ---------------------------------------------------------------------------
// testCreateDelete
// ---------------------------------------------------------------------------
//
@@ -190,14 +237,14 @@
bool ok(false);
- QList<QObject *> objects = mUiLoader->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ mUiLoader->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
if (!ok)
{
return;
}
- mTestView = mUiLoader->findObject<VideoListView>( DOCML_NAME_VIEW );
+ mTestView = mUiLoader->findWidget<VideoListView>( DOCML_NAME_VIEW );
delete mTestView;
mTestView = 0;
@@ -213,130 +260,31 @@
VideoHintWidget *hintWidget = 0;
init(false);
- // Test videolist widget creation failure.
- VideoListWidgetData::mInitializeReturnValue = -1;
- QVERIFY( mTestView->initializeView() < 0 );
- QVERIFY( mTestView->mToolbarViewsActionGroup == 0 );
- QVERIFY( mTestView->mToolbarCollectionActionGroup == 0 );
- QVERIFY( mTestView->mVideoServices == 0 );
- QVERIFY( mTestView->mIsService == false );
-
- cleanup();
-
- // Test widget creation succeed.
- init(false);
- VideoCollectionViewUtilsData::mSortRole = Qt::DisplayRole;
- VideoCollectionViewUtilsData::mSortOrder = Qt::DescendingOrder;
- QVERIFY( mTestView->initializeView() == 0 );
- // Verify
- QCOMPARE( VideoListWidgetData::mInitializeCount, 1 );
- QVERIFY( mTestView->mToolbarViewsActionGroup != 0 );
- QVERIFY( mTestView->mToolbarCollectionActionGroup != 0 );
- QCOMPARE( mTestView->mToolbarViewsActionGroup->actions().count(), 3 );
- QCOMPARE( mTestView->mToolbarCollectionActionGroup->actions().count(), 3 );
- QCOMPARE( mTestView->toolBar()->actions().count(), 3 );
- // to my understanding the all videos action should always be first.
- QVERIFY( mTestView->mToolbarViewsActionGroup->actions().first()->isChecked() );
- QCOMPARE( VideoSortFilterProxyModelData::mSortRole, (int)Qt::DisplayRole );
- QCOMPARE( VideoSortFilterProxyModelData::mSortOrder, Qt::DescendingOrder );
- QVERIFY( VideoSortFilterProxyModelData::mSortAsync == false );
+ // Test mUiLoader is null
+ VideoCollectionUiLoader *tmp = mTestView->mUiLoader;
+ mTestView->mUiLoader = 0;
+ QVERIFY( mTestView->initializeView() < 0 );
QVERIFY( mTestView->mVideoServices == 0 );
QVERIFY( mTestView->mIsService == false );
- cleanup();
- cleanup();
-
- // Test command signal.
- init(true);
- videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
- QVERIFY(videoListWidget);
- connect( this, SIGNAL(testSignal(int)), videoListWidget, SIGNAL(command(int)) );
- QSignalSpy spy(mTestView, SIGNAL(command(int)));
- emit testSignal(5);
- QCOMPARE( spy.count(), 1 );
- QList<QVariant> arguments = spy.takeFirst();
- QCOMPARE( arguments.at(0).toInt(), 5 );
- disconnect();
- cleanup();
-
- init(true);
- QPointer<QActionGroup> toolbar = mTestView->mToolbarViewsActionGroup;
- QPointer<QActionGroup> toolbar2 = mTestView->mToolbarCollectionActionGroup;
-
- // Test calling initializeView again.
- QVERIFY( mTestView->initializeView() == 0 );
-
- QVERIFY( toolbar != 0 );
- QVERIFY( toolbar2 != 0 );
- QVERIFY( mTestView->mToolbarViewsActionGroup == toolbar );
- QVERIFY( mTestView->mToolbarCollectionActionGroup == toolbar2 );
-
- // Test view deletion.
- cleanup();
- QVERIFY( toolbar == 0 );
- QVERIFY( toolbar2 == 0 );
-
- // Test get model failure.
- init(false);
- QVERIFY(mTestView);
- VideoCollectionWrapperData::mGetModelFails = true;
- QVERIFY( mTestView->initializeView() < 0 );
- QVERIFY( mTestView->mToolbarViewsActionGroup == 0 );
- QVERIFY( mTestView->mToolbarCollectionActionGroup == 0 );
- cleanup();
-
- // Test model open failure.
- init(false);
- QVERIFY(mTestView);
- VideoSortFilterProxyModelData::mOpenFails = true;
- QVERIFY( mTestView->initializeView() < 0 );
- QVERIFY( mTestView->mToolbarViewsActionGroup == 0 );
- QVERIFY( mTestView->mToolbarCollectionActionGroup == 0 );
- cleanup();
-
- // Test sorting value load 'failure'.
- init(false);
- VideoCollectionViewUtilsData::mSortRole = Qt::DisplayRole;
- VideoCollectionViewUtilsData::mSortOrder = Qt::DescendingOrder;
- VideoCollectionViewUtilsData::mLoadSortingValuesFails = true;
- QVERIFY( mTestView->initializeView() == 0 );
- QCOMPARE( VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime );
- QCOMPARE( VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder );
- QVERIFY( VideoSortFilterProxyModelData::mSortAsync == false );
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// Slot: test create menu
-// ---------------------------------------------------------------------------
-//
-void TestListView::testCreateListMenu()
-{
- init(false);
- VideoListWidgetData::mInitializeReturnValue = -1;
- QVERIFY( mTestView->initializeView() < 0 );
- HbMenu* menu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
- QVERIFY( menu );
- QCOMPARE( menu->actions().count(), 4 );
-
- cleanup();
-
- init(false);
- VideoListWidgetData::mInitializeReturnValue = 0;
- QVERIFY( mTestView->initializeView() == 0 );
- menu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
- QVERIFY( menu );
- QCOMPARE( menu->actions().count(), 4 );
-
- HbAction* sortAction = dynamic_cast<HbAction*>(menu->actions().at(3));
- QVERIFY( sortAction );
- menu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
- QVERIFY(menu != 0);
- QVERIFY( menu->actions().count() == 4 );
-
- QVERIFY( mUiLoader->mMenuActions.count() == 9 );
- QVERIFY( mTestView->mSortingRoles.count() == 5 );
-
- cleanup();
+ mTestView->mUiLoader = tmp;
+
+ // service flag is false and mVideoServices is != 0
+ mTestView->mIsService = false;
+ XQServiceUtilXtra::service = false;
+ mTestView->mVideoServices = VideoServices::instance();
+ QVERIFY( mTestView->initializeView() == 0 );
+ QVERIFY( mTestView->mVideoServices != 0 );
+ QVERIFY( mTestView->mIsService == false );
+
+ // servicve flag is true, mVideoServices is 0
+ mTestView->mVideoServices = 0;
+ XQServiceUtilXtra::service = true;
+ QVERIFY( mTestView->initializeView() == 0 );
+ QVERIFY( mTestView->mVideoServices != 0 );
+ QVERIFY( mTestView->mIsService == true );
+ XQServiceUtilXtra::service = false;
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -345,83 +293,98 @@
//
void TestListView::testMenus()
{
- init();
+ init();
+ mTestView->activateView(TMPXItemId::InvalidId());
+
+ HbAction* action = 0;
+ QList<QAction*> tbActions = mTestView->toolBar()->actions();
+ QList<QAction*> tbGroupActions;
+ QList<QAction*> tbGroupActions2;
- HbAction* action;
- QList<QAction*> tbActions = mTestView->toolBar()->actions();
- QList<QAction*> tbGroupActions;
- QList<QAction*> tbGroupActions2;
+ // All videos is open for default, verify.
+ QVERIFY( mTestView->mToolbarViewsActionGroup != 0 );
+ QVERIFY( mTestView->mToolbarCollectionActionGroup != 0 );
+ tbGroupActions = mTestView->mToolbarViewsActionGroup->actions();
+ tbGroupActions2 = mTestView->mToolbarCollectionActionGroup->actions();
+ QCOMPARE( mTestView->mToolbarActions.count(), 5 );
+ QCOMPARE( tbActions.count(), 3 );
+ QCOMPARE( tbGroupActions.count(), 3 );
+ QCOMPARE( tbGroupActions2.count(), 2 );
+ QVERIFY( tbGroupActions.at(0)->isChecked() ); // First is checked.
- // All videos is open for default, verify.
- QVERIFY(mTestView->mToolbarViewsActionGroup != 0);
- QVERIFY(mTestView->mToolbarCollectionActionGroup != 0);
- tbGroupActions = mTestView->mToolbarViewsActionGroup->actions();
- tbGroupActions2 = mTestView->mToolbarCollectionActionGroup->actions();
- QVERIFY(mTestView->mToolbarActions.count() == 6);
- QVERIFY(tbActions.count() == 3);
- QVERIFY(tbGroupActions.count() == 3);
- QVERIFY(tbGroupActions2.count() == 3);
- QVERIFY( tbGroupActions.at(0)->isChecked() ); // First is checked.
- // visible menu items remains constant after init until
- // aboutToShowMainMenuSlot is called
- QVERIFY(visibleMenuActions() == 9);
- // Verify checkable and visible toolbar actions.
- HbAction* allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
- HbAction* collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
- HbAction* servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
- HbAction* addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
- HbAction* removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
- HbAction* sortVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionSortVideos];
- QVERIFY( allVideosAction != 0 && allVideosAction->isCheckable() && allVideosAction->isVisible() &&
- tbActions.at(0) == tbGroupActions.at(0));
- QVERIFY( collectionsAction != 0 && collectionsAction->isCheckable() && collectionsAction->isVisible() &&
- tbActions.at(1) == tbGroupActions.at(1));
- QVERIFY( servicesAction != 0 && servicesAction->isCheckable() && servicesAction->isVisible() &&
- tbActions.at(2) == tbGroupActions.at(2));
- QVERIFY( addVideosAction != 0 && !addVideosAction->isCheckable() &&
- tbActions.at(0) != tbGroupActions2.at(0));
- QVERIFY( removeVideosAction != 0 && !removeVideosAction->isCheckable() &&
- tbActions.at(1) != tbGroupActions2.at(1));
- QVERIFY( sortVideosAction != 0 && !sortVideosAction->isCheckable() &&
- tbActions.at(2) != tbGroupActions2.at(2));
+ // Verify checkable and visible toolbar actions.
+ HbAction* allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
+ HbAction* collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
+ HbAction* servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
+ HbAction* addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
+ HbAction* removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
+ QVERIFY( allVideosAction != 0 );
+ QVERIFY( allVideosAction->isCheckable() );
+ QVERIFY( allVideosAction->isVisible() );
+ QVERIFY( tbActions.at(0) == tbGroupActions.at(0) );
+
+ QVERIFY( collectionsAction != 0 );
+ QVERIFY( collectionsAction->isCheckable() );
+ QVERIFY( collectionsAction->isVisible() );
+ QVERIFY( tbActions.at(1) == tbGroupActions.at(1) );
+
+ QVERIFY( servicesAction != 0 );
+ QVERIFY( !servicesAction->isCheckable() );
+ QVERIFY( servicesAction->isVisible() );
+ QVERIFY( tbActions.at(2) == tbGroupActions.at(2) );
+
+ QVERIFY( addVideosAction != 0 );
+ QVERIFY( !addVideosAction->isCheckable() );
+ QVERIFY( tbActions.at(0) != tbGroupActions2.at(0) );
+
+ QVERIFY( removeVideosAction != 0 );
+ QVERIFY( !removeVideosAction->isCheckable() );
+ QVERIFY( tbActions.at(1) != tbGroupActions2.at(1) );
+
+ // Open collections.
+ action = dynamic_cast<HbAction*>(tbGroupActions.at(1));
+ QVERIFY( action );
+ action->setChecked(false);
+ action->QAction::trigger();
- // Open collections.
- action = dynamic_cast<HbAction*>(tbGroupActions.at(1));
- QVERIFY(action);
- action->setChecked(false);
- action->trigger();
+ // Verify.
+ QVERIFY( mTestView->mToolbarViewsActionGroup );
+ tbGroupActions = mTestView->mToolbarViewsActionGroup->actions();
+ QCOMPARE( mTestView->mToolbarActions.count(), 5 );
+ QCOMPARE( tbGroupActions.count(), 3 );
+ QCOMPARE( tbGroupActions2.count(), 2 );
+ QVERIFY( tbGroupActions.at(1)->isChecked() ); // 2nd is checked.
- // Verify.
- QVERIFY(mTestView->mToolbarViewsActionGroup);
- tbGroupActions = mTestView->mToolbarViewsActionGroup->actions();
- QVERIFY(mTestView->mToolbarActions.count() == 6);
- QVERIFY(tbGroupActions.count() == 3);
- QVERIFY(tbGroupActions2.count() == 3);
- QVERIFY( tbGroupActions.at(1)->isChecked() ); // 2nd is checked.
- // visible menu items remains constant after init until
- // aboutToShowMainMenuSlot is called
- QVERIFY(visibleMenuActions() == 9);
- // Verify checkable and visible toolbar actions.
- allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
- collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
- servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
- addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
- removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
- sortVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionSortVideos];
- QVERIFY( allVideosAction != 0 && allVideosAction->isCheckable() && allVideosAction->isVisible() &&
- tbActions.at(0) == tbGroupActions.at(0));
- QVERIFY( collectionsAction != 0 && collectionsAction->isCheckable() && collectionsAction->isVisible() &&
- tbActions.at(1) == tbGroupActions.at(1));
- QVERIFY( servicesAction != 0 && servicesAction->isCheckable() && servicesAction->isVisible() &&
- tbActions.at(2) == tbGroupActions.at(2));
- QVERIFY( addVideosAction != 0 && !addVideosAction->isCheckable() &&
- tbActions.at(0) != tbGroupActions2.at(0));
- QVERIFY( removeVideosAction != 0 && !removeVideosAction->isCheckable() &&
- tbActions.at(1) != tbGroupActions2.at(1));
- QVERIFY( sortVideosAction != 0 && !sortVideosAction->isCheckable() &&
- tbActions.at(2) != tbGroupActions2.at(2));
+ // Verify checkable and visible toolbar actions.
+ allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
+ collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
+ servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
+ addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
+ removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
+ QVERIFY( allVideosAction != 0 );
+ QVERIFY( allVideosAction->isCheckable() );
+ QVERIFY( allVideosAction->isVisible() );
+ QVERIFY( tbActions.at(0) == tbGroupActions.at(0) );
+
+ QVERIFY( collectionsAction != 0 );
+ QVERIFY( collectionsAction->isCheckable() );
+ QVERIFY( collectionsAction->isVisible() );
+ QVERIFY( tbActions.at(1) == tbGroupActions.at(1) );
+
+ QVERIFY( servicesAction != 0 );
+ QVERIFY( !servicesAction->isCheckable() );
+ QVERIFY( servicesAction->isVisible() );
+ QVERIFY( tbActions.at(2) == tbGroupActions.at(2) );
+
+ QVERIFY( addVideosAction != 0 );
+ QVERIFY( !addVideosAction->isCheckable() );
+ QVERIFY( tbActions.at(0) != tbGroupActions2.at(0) );
+
+ QVERIFY( removeVideosAction != 0 );
+ QVERIFY( !removeVideosAction->isCheckable() );
+ QVERIFY( tbActions.at(1) != tbGroupActions2.at(1) );
- cleanup();
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -431,38 +394,36 @@
void TestListView::testCreateAction()
{
init();
+ mTestView->activateView(TMPXItemId::InvalidId());
QVERIFY(mTestView->mToolbarViewsActionGroup != 0);
QList<QAction*> actions = mTestView->mToolbarViewsActionGroup->actions();
actions.append(mTestView->mToolbarCollectionActionGroup->actions());
- QVERIFY(actions.count() == 6);
+ QCOMPARE(actions.count(), 5);
QCOMPARE( mTestView->toolBar()->actions().count(), 3 );
HbAction* allVideos = static_cast<HbAction*>(actions.at(0));
QVERIFY( allVideos->isCheckable() );
QCOMPARE( allVideos->icon().iconName(), QString(":/images/qtg_mono_video_all.svg") );
+ QVERIFY( allVideos->isChecked() );
HbAction* collections = static_cast<HbAction*>(actions.at(1));
QVERIFY( collections->isCheckable() );
- QCOMPARE( collections->icon().iconName(), QString(":/images/qtg_mono_video_collection.svg") );
+ QCOMPARE( collections->icon().iconName(), QString("qtg_mono_video_collection") );
HbAction* services = static_cast<HbAction*>(actions.at(2));
- QVERIFY( services->isCheckable() );
- QCOMPARE( services->icon().iconName(), QString(":/images/qtg_mono_video_services.svg") );
+ QVERIFY( !services->isCheckable() );
+ QCOMPARE( services->icon().iconName(), QString("qtg_mono_ovistore") );
HbAction* addVideos = static_cast<HbAction*>(actions.at(3));
QVERIFY( !addVideos->isCheckable() );
- QCOMPARE( addVideos->icon().iconName(), QString(":/images/mono_video_addvideos.svg") );
+ QCOMPARE( addVideos->icon().iconName(), QString("qtg_mono_add_to_video_collection") );
HbAction* removeVideos = static_cast<HbAction*>(actions.at(4));
QVERIFY( !removeVideos->isCheckable() );
- QCOMPARE( removeVideos->icon().iconName(), QString(":/images/mono_video_removevideos.svg") );
-
- HbAction* sortVideos = static_cast<HbAction*>(actions.at(5));
- QVERIFY( !sortVideos->isCheckable() );
- QCOMPARE( sortVideos->icon().iconName(), QString(":/images/mono_video_sortvideos.svg") );
+ QCOMPARE( removeVideos->icon().iconName(), QString("qtg_mono_remove_from_video_collection") );
cleanup();
}
@@ -476,41 +437,113 @@
VideoListWidget* videoListWidget = 0;
init();
-
- videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
- QVERIFY(videoListWidget);
- mTestView->mCurrentList = 0;
-
- QCOMPARE( mTestView->activateView(), -1 );
+
+ HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
+ mainWnd->unsetOrientation(false);
+ mTestView->mCurrentList = 0;
+ HbDocumentLoader::mFindWidgetFails = true;
+ QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), -1 );
QVERIFY( VideoListWidgetData::mActive == false );
- QCOMPARE( mTestView->mCurrentList, videoListWidget );
+ QVERIFY( mTestView->mCurrentList == 0 );
QCOMPARE( VideoListWidgetData::mActivateCount, 0 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() == false );
+ QVERIFY( mainWnd->mOrientationSet == false );
+ HbDocumentLoader::mFindWidgetFails = false;
+ videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
+ QVERIFY(videoListWidget);
VideoListWidgetData::mActivateReturnValue = -1;
-
- QCOMPARE( mTestView->activateView(), -1 );
+ QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), -1 );
QVERIFY( VideoListWidgetData::mActive == false );
QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() == false );
+ QVERIFY( mainWnd->mOrientationSet == false );
VideoListWidgetData::mActivateReturnValue = 0;
-
- QCOMPARE( mTestView->activateView(), 0 );
+ QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), 0 );
QVERIFY( VideoListWidgetData::mActive );
QCOMPARE( VideoListWidgetData::mActivateCount, 2 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() );
+ QVERIFY( mainWnd->mOrientationSet );
+ QCOMPARE( mainWnd->mOrientation, Qt::Vertical );
- QCOMPARE( mTestView->activateView(), 0 );
+ QCOMPARE( mTestView->activateView(TMPXItemId::InvalidId()), 0 );
QVERIFY( VideoListWidgetData::mActive );
QCOMPARE( VideoListWidgetData::mActivateCount, 3 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() );
+ QVERIFY( mainWnd->mOrientationSet );
+ QCOMPARE( mainWnd->mOrientation, Qt::Vertical );
+
+ cleanup();
- cleanup();
+ // activate view:
+ // -browse service
+ // -captured category
+ TMPXItemId itemId = TMPXItemId::InvalidId();
+ init();
+ VideoListWidgetData::reset();
+ VideoSortFilterProxyModelData::reset();
+ itemId.iId1 = KVcxMvcCategoryIdCaptured;
+ itemId.iId2 = KVcxMvcMediaTypeCategory;
+ QCOMPARE(mTestView->activateView(itemId), 0);
+ QVERIFY(VideoListWidgetData::mActive);
+ QCOMPARE(VideoListWidgetData::mActivateCount, 1);
+ QCOMPARE(mTestView->mCollectionName, hbTrId("txt_videos_dblist_captured"));
+ QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelDefaultColl);
+ QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, itemId);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
+ cleanup();
+
+ // activate view:
+ // -browse service
+ // -downloaded category
+ init();
+ VideoListWidgetData::reset();
+ VideoSortFilterProxyModelData::reset();
+ itemId.iId1 = KVcxMvcCategoryIdDownloads;
+ itemId.iId2 = KVcxMvcMediaTypeCategory;
+ QCOMPARE(mTestView->activateView(itemId), 0);
+ QVERIFY(VideoListWidgetData::mActive);
+ QCOMPARE(VideoListWidgetData::mActivateCount, 1);
+ QCOMPARE(mTestView->mCollectionName, hbTrId("txt_videos_dblist_downloaded"));
+ QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelDefaultColl);
+ QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, itemId);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
+ cleanup();
+
+ // activate view:
+ // -browse service
+ // -other category
+ init();
+ VideoListWidgetData::reset();
+ VideoSortFilterProxyModelData::reset();
+ itemId.iId1 = KVcxMvcCategoryIdOther;
+ itemId.iId2 = KVcxMvcMediaTypeCategory;
+ QCOMPARE(mTestView->activateView(itemId), 0);
+ QVERIFY(VideoListWidgetData::mActive);
+ QCOMPARE(VideoListWidgetData::mActivateCount, 1);
+ QCOMPARE(mTestView->mCollectionName.length(), 0);
+ QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
+ QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId());
+ cleanup();
+
+ // activate view:
+ // -browse service
+ // -invalid category but item id is ok
+ init();
+ VideoListWidgetData::reset();
+ VideoSortFilterProxyModelData::reset();
+ itemId.iId1 = 0;
+ itemId.iId2 = KVcxMvcMediaTypeVideo;
+ QCOMPARE(mTestView->activateView(itemId), 0);
+ QVERIFY(VideoListWidgetData::mActive);
+ QCOMPARE(VideoListWidgetData::mActivateCount, 1);
+ QCOMPARE(mTestView->mCollectionName.length(), 0);
+ QCOMPARE(mTestView->mCurrentList->getLevel(), VideoCollectionCommon::ELevelVideos);
+ QCOMPARE(VideoSortFilterProxyModelData::mLastItemId, TMPXItemId::InvalidId());
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -523,27 +556,34 @@
init();
+ HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
+
videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
QVERIFY(videoListWidget);
mTestView->mCurrentList = 0;
-
- mTestView->deactivateView();
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isVisible() == false );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() == false );
- QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
+ mainWnd->mOrientationSet = true;
mTestView->deactivateView();
QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isVisible() == false );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() == false );
+ QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
+ QVERIFY( mainWnd->mOrientationSet == false );
+
+ mTestView->mCurrentList = videoListWidget;
+ mainWnd->mOrientationSet = true;
+
+ mTestView->deactivateView();
+ QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isVisible() == false );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
+ QVERIFY( mainWnd->mOrientationSet == false );
VideoListWidgetData::mActivateReturnValue = 0;
- mTestView->activateView();
+ mainWnd->mOrientationSet = true;
+ mTestView->activateView(TMPXItemId::InvalidId());
mTestView->deactivateView();
QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isVisible() == false );
- QVERIFY( mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->isEnabled() == false );
QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
QCOMPARE( VideoListWidgetData::mDeactivateCount, 2 );
+ QVERIFY( mainWnd->mOrientationSet == false );
cleanup();
}
@@ -571,43 +611,32 @@
HbGroupBox *subLabel = 0;
init();
+ mTestView->activateView(TMPXItemId::InvalidId());
videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
- QVERIFY(videoListWidget);
- subLabel = mUiLoader->findWidget<HbGroupBox>(DOCML_NAME_VC_HEADINGBANNER);
- QVERIFY(subLabel);
+ QVERIFY( videoListWidget );
QList<QAction*> actions = mTestView->mToolbarViewsActionGroup->actions();
HbAction* action = static_cast<HbAction*>(actions.at(0));
- videoListWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
- subLabel->setHeading("invalid");
-
// action wont emit if it's already checked.
action->setChecked(false);
action->trigger();
- QCOMPARE( mTestView->mCurrentList->mCurrentLevel, VideoCollectionCommon::ELevelVideos );
- QVERIFY( VideoListWidgetData::mActive == true );
- QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
- QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
- QCOMPARE( subLabel->heading(), tr("txt_videos_subtitle_ln_videos" ));
- QCOMPARE(mTestView->mCurrentList, videoListWidget);
+ QCOMPARE( mTestView->mCurrentList, videoListWidget );
- mTestView->activateView();
-
- VideoListWidgetData::mActivateCount = 0;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
- subLabel->setHeading("invalid");
+ mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
+ QVERIFY( mTestView->mCurrentList );
+ VideoListWidgetData::mActivateCount = 0;
+ videoListWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
// action wont emit if it's already checked.
action->setChecked(false);
action->trigger();
+ QCOMPARE( mTestView->mCurrentList, videoListWidget );
QCOMPARE( mTestView->mCurrentList->mCurrentLevel, VideoCollectionCommon::ELevelVideos );
QVERIFY( VideoListWidgetData::mActive == true );
QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
- QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
- QCOMPARE( subLabel->heading(), tr("txt_videos_subtitle_ln_videos" ));
- QCOMPARE(mTestView->mCurrentList, videoListWidget);
+ QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
cleanup();
}
@@ -622,43 +651,33 @@
HbGroupBox *subLabel = 0;
init();
+ mTestView->activateView(TMPXItemId::InvalidId());
QList<QAction*> actions = mTestView->mToolbarViewsActionGroup->actions();
HbAction* action = static_cast<HbAction*>(actions.at(1));
collectionWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
QVERIFY(collectionWidget);
- subLabel = mUiLoader->findWidget<HbGroupBox>(DOCML_NAME_VC_HEADINGBANNER);
- QVERIFY(subLabel);
-
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- subLabel->setHeading("invalid");
// action wont emit if it's already checked.
action->setChecked(false);
action->trigger();
- QCOMPARE( mTestView->mCurrentList->mCurrentLevel, VideoCollectionCommon::ELevelCategory );
- QVERIFY( VideoListWidgetData::mActive == true );
- QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
- QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
- QCOMPARE( subLabel->heading(), tr("txt_videos_subtitle_l1_collections" ));
QCOMPARE(mTestView->mCurrentList, collectionWidget);
- mTestView->activateView();
-
+ mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
+ QVERIFY( mTestView->mCurrentList );
VideoListWidgetData::mActivateCount = 0;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- subLabel->setHeading("invalid");
+ VideoListWidgetData::mDeactivateCount = 0;
+ collectionWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
// action wont emit if it's already checked.
action->setChecked(false);
action->trigger();
+ QCOMPARE(mTestView->mCurrentList, collectionWidget);
QCOMPARE( mTestView->mCurrentList->mCurrentLevel, VideoCollectionCommon::ELevelCategory );
QVERIFY( VideoListWidgetData::mActive == true );
QCOMPARE( VideoListWidgetData::mActivateCount, 1 );
- QCOMPARE( VideoListWidgetData::mDeactivateCount, 0 );
- QCOMPARE( subLabel->heading(), tr("txt_videos_subtitle_l1_collections" ));
- QCOMPARE(mTestView->mCurrentList, collectionWidget);
+ QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 );
cleanup();
}
@@ -668,16 +687,7 @@
//
void TestListView::testOpenServicesViewSlot()
{
- init();
-
- QList<QAction*> actions = mTestView->mToolbarViewsActionGroup->actions();
- HbAction* action = static_cast<HbAction*>(actions.at(2));
-
- // action wont emit if it's already checked.
- action->setChecked(false);
- action->trigger();
-
- cleanup();
+ QFAIL("Feature not yet implemented!");
}
// ---------------------------------------------------------------------------
@@ -687,36 +697,8 @@
void TestListView::testStartSortingSlot()
{
HbAction *action(0);
-
- // Active action is not sort by.
- init(true);
- action = mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionDelete];
- QVERIFY(action != 0);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(action);
- connect(this, SIGNAL(testSignal(int)), mTestView, SLOT(startSorting()));
- emit testSignal(0);
- QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 0);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, -1);
- cleanup();
-
- // Sort by action has no menu.
- init(true);
-
- // Change sort by action to delete action which has no menu.
- HbAction *sortByAction = mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortBy];
- HbAction *deleteAction = mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionDelete];
- mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortBy] = deleteAction;
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(deleteAction);
-
- connect(this, SIGNAL(testSignal(int)), mTestView, SLOT(startSorting()));
- emit testSignal(0);
- QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 0);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, -1);
-
- // Change the action back.
- mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortBy] = sortByAction;
-
- cleanup();
+ HbMenu *sortMenu(0);
+ HbAction *sortMenuAction = new HbAction("test");
// View is not initialized.
init(false);
@@ -726,19 +708,53 @@
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, -1);
cleanup();
- // Good case.
+ // View is not activated.
+ init();
+ connect(this, SIGNAL(testSignal(int)), mTestView, SLOT(startSorting()));
+ emit testSignal(0);
+ QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 0);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, -1);
+ cleanup();
+
+ // Active action is not sort by.
+ init();
+ mTestView->activateView(TMPXItemId::InvalidId());
+ action = mUiLoader->findObject<HbAction>(DOCML_NAME_DELETE_MULTIPLE);
+ QVERIFY(action != 0);
+ mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(action);
+ sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
+ sortMenuAction->setMenu(sortMenu);
+ HbMenuData::mMenuAction = sortMenuAction;
+ connect(this, SIGNAL(testSignal(int)), mTestView, SLOT(startSorting()));
+ emit testSignal(0);
+ QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 0);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, -1);
+ cleanup();
+
+ // Good cases.
init();
- action = mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortBy];
+ mTestView->activateView(TMPXItemId::InvalidId());
+ sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
+ sortMenuAction->setMenu(sortMenu);
+ HbMenuData::mMenuAction = sortMenuAction;
+ VideoSortFilterProxyModel& model = mTestView->mCurrentList->getModel();
QVERIFY(action != 0);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(action);
- HbAction* sortAction = mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortByName];
+ mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->setActiveAction(sortMenuAction);
+ HbAction* sortAction = mUiLoader->findObject<HbAction>(DOCML_NAME_SORT_BY_NAME);
QVERIFY(sortAction != 0);
- action->menu()->setActiveAction(sortAction);
+ sortMenu->setActiveAction(sortAction);
+ model.setSortRole(1);
+ connect(this, SIGNAL(testObjectReadySignal(QObject*, const QString)), mTestView, SLOT(objectReadySlot(QObject*, const QString)));
+ emit testObjectReadySignal(mUiLoader->findObject<QObject>(DOCML_NAME_SORT_BY_DATE), DOCML_NAME_SORT_BY_DATE);
+ emit testObjectReadySignal(mUiLoader->findObject<QObject>(DOCML_NAME_SORT_BY_NAME), DOCML_NAME_SORT_BY_NAME);
+ emit testObjectReadySignal(mUiLoader->findObject<QObject>(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS), DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS);
+ emit testObjectReadySignal(mUiLoader->findObject<QObject>(DOCML_NAME_SORT_BY_SIZE), DOCML_NAME_SORT_BY_SIZE);
+ disconnect(this, SIGNAL(testObjectReadySignal(QObject*, const QString)), mTestView, SLOT(objectReadySlot(QObject*, const QString)));
connect(this, SIGNAL(testSignal(int)), mTestView, SLOT(startSorting()));
emit testSignal(0);
QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 1);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)Qt::DisplayRole);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
@@ -746,25 +762,25 @@
// descending order.
emit testSignal(0);
QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 2);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)Qt::DisplayRole);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::DescendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
// on third emit, sorting should be switched back to ascending
emit testSignal(0);
QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 3);
- QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)Qt::DisplayRole);
+ QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
// test that after changing the sort role, the order is also switched to ascending.
- VideoSortFilterProxyModelData::mSortOrder = Qt::DescendingOrder;
- sortAction = mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortByDate];
+ model.doSorting(model.sortRole(), Qt::DescendingOrder);
+ sortAction = mUiLoader->findObject<HbAction>(DOCML_NAME_SORT_BY_DATE);
QVERIFY(sortAction != 0);
- action->menu()->setActiveAction(sortAction);
+ sortMenu->setActiveAction(sortAction);
emit testSignal(0);
- QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 4);
+ QCOMPARE(VideoSortFilterProxyModelData::mDoSortingCallCount, 5);
QCOMPARE(VideoSortFilterProxyModelData::mSortRole, (int)VideoCollectionCommon::KeyDateTime);
QCOMPARE(VideoSortFilterProxyModelData::mSortOrder, Qt::AscendingOrder);
QVERIFY(VideoSortFilterProxyModelData::mSortAsync);
@@ -811,64 +827,38 @@
init();
connect( this, SIGNAL(testSignal()), mTestView, SLOT(deleteItemsSlot()) );
////////////
- // no model
+ // no current list
////////////
emit testSignal();
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionLaunchCount == 0);
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionItemSelectionCount == 0);
-
- cleanup();
- init();
- connect( this, SIGNAL(testSignal()), mTestView, SLOT(deleteItemsSlot()) );
-
- ////////////
- // no selection dialog
- ////////////
- emit testSignal();
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionLaunchCount == 1);
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionItemSelectionCount == 0);
-
- cleanup();
- init();
- connect( this, SIGNAL(testSignal()), mTestView, SLOT(deleteItemsSlot()) );
-
+ QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 0);
+
+ mTestView->activateView(TMPXItemId::InvalidId());
+
////////////
// dialog loading fails
////////////
VideoCollectionUiLoaderData::mFailDialogLoad = true;
emit testSignal();
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionLaunchCount == 0);
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionItemSelectionCount == 0);
- VideoCollectionUiLoaderData::mFailDialogLoad = false;
- //////////
- // document loader deletes all objects in case of error, so we cannot cleanup all
- disconnect();
- ///////////////
- init();
- connect( this, SIGNAL(testSignal()), mTestView, SLOT(deleteItemsSlot()) );
+ QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 0);
////////////
// selection dialog exists
////////////
- emit testSignal();
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionLaunchCount == 1);
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionItemSelectionCount == 0);
+ VideoCollectionUiLoaderData::mFailDialogLoad = false;
+ VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(2, 3);
emit testSignal();
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionLaunchCount == 2);
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionItemSelectionCount == 0);
-
- cleanup();
- init();
- connect( this, SIGNAL(testSignal()), mTestView, SLOT(deleteItemsSlot()) );
-
+ QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 1);
+ QCOMPARE(VideoListSelectionDialogData::mSelectionType, (int)VideoListSelectionDialog::EDeleteVideos);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == VideoSortFilterProxyModelData::mOpenedItemId);
+
////////////
- // exec returns primary key (just for the coverity's sake)
+ // test second successful activation.
////////////
- VideoListSelectionDialogData::mExecReturnPrimary = true;
- VideoListSelectionDialogData::mSelectionCount = 5;
+ VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(3, 2);
emit testSignal();
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionLaunchCount == 1);
- QVERIFY(VideoListSelectionDialogData::mMultiSelectionItemSelectionCount == 5);
+ QCOMPARE(VideoListSelectionDialogData::mMultiSelectionLaunchCount, 2);
+ QCOMPARE(VideoListSelectionDialogData::mSelectionType, (int)VideoListSelectionDialog::EDeleteVideos);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == VideoSortFilterProxyModelData::mOpenedItemId);
cleanup();
}
@@ -879,14 +869,10 @@
//
void TestListView::testAboutToShowMainMenuSlot()
{
- // All ok.
- init();
- setRowCount(1);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
- QVERIFY(visibleMenuActions() == 6);
- cleanup();
+ XQServiceUtilXtra *serviceUtil = XQServiceUtilXtra::instance();
+ VideoServices *videoServices = VideoServices::instance();
- // View is not initialized.
+ // View is not initialized.
init(false);
connect( this, SIGNAL(testSignal(int)), mTestView, SLOT(aboutToShowMainMenuSlot()) );
emit testSignal(0);
@@ -896,133 +882,112 @@
// Collections is triggered from toolbar.
init();
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
setRowCount(1);
action = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
QVERIFY(action != 0);
action->setChecked(false);
action->trigger();
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
+ emit testSignal();
int visible = visibleMenuActions();
- QCOMPARE(visible, 5);
+ QCOMPARE(visible, 3);
cleanup();
// All videos is triggered from toolbar.
init();
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
setRowCount(1);
action = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
QVERIFY(action != 0);
action->setChecked(false);
action->trigger();
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
+ emit testSignal();
visible = visibleMenuActions();
- QCOMPARE(visible, 6);
- cleanup();
-
- // Services is triggered from toolbar.
- init();
- setRowCount(1);
- action = mTestView->mToolbarActions[VideoListView::ETBActionServices];
- QVERIFY(action != 0);
- action->setChecked(false);
- action->trigger();
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
- visible = visibleMenuActions();
- QCOMPARE(visible, 0);
+ QCOMPARE(visible, 5);
cleanup();
// Add videos action is visible.
init();
- mTestView->activateView();
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
mTestView->toolBar()->clearActions();
mTestView->toolBar()->addActions( mTestView->mToolbarCollectionActionGroup->actions() );
setRowCount(1);
QVERIFY(action != 0);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
+ emit testSignal();
visible = visibleMenuActions();
- QCOMPARE(visible, 1);
- cleanup();
-
- // Menu action is null
- init();
- setRowCount(1);
- action = mUiLoader->mMenuActions.take(VideoCollectionUiLoader::EActionSortBy);
- delete action;
- action = NULL;
- mUiLoader->mMenuActions[VideoCollectionUiLoader::EActionSortBy] = action;
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
- visible = visibleMenuActions();
- QCOMPARE(visible, 0);
- cleanup();
-
- // No menu actions.
- init();
- setRowCount(1);
- QMap<VideoCollectionUiLoader::ActionIds, HbAction*> backupActions =
- QMap<VideoCollectionUiLoader::ActionIds, HbAction*>(mUiLoader->mMenuActions);
- mUiLoader->mMenuActions.clear();
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
- mUiLoader->mMenuActions.unite(backupActions);
+ QCOMPARE(visible, 4);
cleanup();
// Model has no items.
init();
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
setRowCount(0);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
+ emit testSignal();
visible = visibleMenuActions();
- QCOMPARE(visible, 0);
+ QCOMPARE(visible, 0);
cleanup();
// Toolbar action group is null
init();
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
setRowCount(1);
QActionGroup* actionGroup = mTestView->mToolbarViewsActionGroup;
mTestView->mToolbarViewsActionGroup = NULL;
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->show();
+ emit testSignal();
mTestView->mToolbarViewsActionGroup = actionGroup;
cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testOpenSortByMenuSlot
-// ---------------------------------------------------------------------------
-//
-void TestListView::testOpenSortByMenuSlot()
-{
- HbMenu *optionsMenu = 0;
- HbMenu *sortMenu = 0;
-
- // All ok.
- init();
- sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
- connect( this, SIGNAL(testSignal(int)), mTestView, SLOT(openSortByMenuSlot()) );
- setRowCount(1);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->hide();
- emit testSignal(0);
- // sorting menu should be visible
- QVERIFY(visibleMenuActions() == 4);
+
+ // about to show main menu:
+ // -is service
+ // -current service is browse
+ // -no current list
+ serviceUtil->setCurrentService(true);
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ init(true);
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ emit testSignal();
+ visible = visibleMenuActions();
+ QCOMPARE(visible, 0);
cleanup();
- // View is not initialized.
- init(false);
- sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
- optionsMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
- connect( this, SIGNAL(testSignal(int)), mTestView, SLOT(openSortByMenuSlot()) );
- setRowCount(1);
- optionsMenu->hide();
- emit testSignal(0);
- QCOMPARE(visibleMenuActions(), 0);
+ // about to show main menu:
+ // -is service
+ // -current service is browse
+ // -no items
+ serviceUtil->setCurrentService(true);
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ init(true);
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
+ emit testSignal();
+ visible = visibleMenuActions();
+ QCOMPARE(visible, 0);
cleanup();
- // no items
- init();
- sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU);
- optionsMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
- connect( this, SIGNAL(testSignal(int)), mTestView, SLOT(openSortByMenuSlot()) );
- setRowCount(0);
- mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU)->hide();
- emit testSignal(0);
- QCOMPARE(visibleMenuActions(), 0);
- cleanup();
+ // about to show main menu:
+ // -is service
+ // -current service is browse
+ serviceUtil->setCurrentService(true);
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ init(true);
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToShowMainMenuSlot()));
+ mTestView->activateView(TMPXItemId::InvalidId());
+ setRowCount(3, &mTestView->mCurrentList->getModel());
+ emit testSignal();
+ QVERIFY(isActionVisible(DOCML_NAME_DELETE_MULTIPLE));
+ QVERIFY(isActionVisible(DOCML_NAME_SORT_BY_DATE));
+ QVERIFY(isActionVisible(DOCML_NAME_SORT_BY_NAME));
+ QVERIFY(isActionVisible(DOCML_NAME_SORT_BY_SIZE));
+ cleanup();
+
+ // final cleanup
+ serviceUtil->decreaseReferenceCount();
+ videoServices->decreaseReferenceCount();
}
// ---------------------------------------------------------------------------
@@ -1077,100 +1042,67 @@
//
void TestListView::testCollectionOpenedSlot()
{
- HbAction* removeVideosAction;
- HbAction* allVideosAction;
- HbAction* collectionsAction;
- HbAction* servicesAction;
- HbAction* addVideosAction;
- HbAction* sortVideosAction;
-
QString testString;
// View is not initialized.
init(false);
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&)));
- emit testCollectionOpenedSignal(false, testString);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
+ emit testCollectionOpenedSignal(false, testString, QModelIndex());
cleanup();
// No toolbar actions.
init(true);
+ mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET); // load model
+ QModelIndex index = VideoCollectionWrapperData::mCollectionsModel->index(0, 0);
// Clear actions.
QMap<VideoListView::TViewActionIds, HbAction*> backupActions =
QMap<VideoListView::TViewActionIds, HbAction*>(mTestView->mToolbarActions);
mTestView->mToolbarActions.clear();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&)));
- emit testCollectionOpenedSignal(true, testString);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
+ emit testCollectionOpenedSignal(true, testString, index);
mTestView->mToolbarActions.unite(backupActions);
cleanup();
- // One of the toolbar actions is null.
+ // index is invalid
+ init();
+ cleanup();
+
+ // current list is null
init();
- removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
- mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos] = NULL;
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&)));
- emit testCollectionOpenedSignal(true, testString);
- // Verify checkable and visible toolbar actions.
- mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos] = removeVideosAction;
- allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
- collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
- servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
- addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
- sortVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionSortVideos];
- // Remove videos is not checked because it was used as null action.
- QCOMPARE( mTestView->mCollectionName, testString );
- QCOMPARE( mTestView->toolBar()->actions().count(), 3 );
- QVERIFY( allVideosAction != 0 && allVideosAction->isCheckable());
- QVERIFY( collectionsAction != 0 && collectionsAction->isCheckable());
- QVERIFY( servicesAction != 0 && servicesAction->isCheckable());
- QVERIFY( addVideosAction != 0 && !addVideosAction->isCheckable() );
- QVERIFY( sortVideosAction != 0 && !sortVideosAction->isCheckable() );
+ cleanup();
+
+ // current list is collectioncontentwidget
+ init();
cleanup();
-
-
+
+ // index is for video item and not for collection.
+ init();
+ cleanup();
+
+ // non-error cases:
testString = "Test text string";
- // Collection opened.
+ // Collection opened with default collection.
init();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&)));
- emit testCollectionOpenedSignal(true, testString);
+ mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
+ index = VideoCollectionWrapperData::mCollectionsModel->index(0, 0);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
+ emit testCollectionOpenedSignal(true, testString, index);
// Verify checkable and visible toolbar actions.
- allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
- collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
- servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
- addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
- removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
- sortVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionSortVideos];
- QCOMPARE(mTestView->mCollectionName, testString);
- QCOMPARE( mTestView->toolBar()->actions().count(), 3 );
- QVERIFY( allVideosAction != 0 && allVideosAction->isCheckable());
- QVERIFY( collectionsAction != 0 && collectionsAction->isCheckable());
- QVERIFY( servicesAction != 0 && servicesAction->isCheckable());
- QVERIFY( addVideosAction != 0 && !addVideosAction->isCheckable() );
- QVERIFY( removeVideosAction != 0 && !removeVideosAction->isCheckable() );
- QVERIFY( sortVideosAction != 0 && !sortVideosAction->isCheckable() );
cleanup();
-
- testString = "Test text string 2";
-
- // Collection not opened.
+
+ // Collection opened with userdefined album.
init();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&)));
- emit testCollectionOpenedSignal(false, testString);
- // Verify checkable and visible toolbar actions.
- allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos];
- collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections];
- servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices];
- addVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAddVideos];
- removeVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos];
- sortVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionSortVideos];
- QCOMPARE(mTestView->mCollectionName, testString);
- QCOMPARE( mTestView->toolBar()->actions().count(), 3 );
- QVERIFY( allVideosAction != 0 && allVideosAction->isCheckable());
- QVERIFY( collectionsAction != 0 && collectionsAction->isCheckable());
- QVERIFY( servicesAction != 0 && servicesAction->isCheckable());
- QVERIFY( addVideosAction != 0 && !addVideosAction->isCheckable() );
- QVERIFY( removeVideosAction != 0 && !removeVideosAction->isCheckable() );
- QVERIFY( sortVideosAction != 0 && !sortVideosAction->isCheckable() );
+ cleanup();
+
+ // Collection closed.
+ init();
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
+ emit testCollectionOpenedSignal(false, testString, QModelIndex());
cleanup();
}
@@ -1183,62 +1115,34 @@
init(true);
setRowCount(1);
connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&)), mTestView, SLOT(collectionOpenedSlot(bool, const QString&)));
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
VideoListWidget *videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
VideoListWidget *collectionWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
VideoListWidget *collectionContentWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
+ videoListWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
+ collectionWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
+ collectionContentWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
+
+ HbGroupBox* label = mUiLoader->findWidget<HbGroupBox>(DOCML_NAME_VC_HEADINGBANNER);
+
mTestView->mCurrentList = videoListWidget;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
emit testLayoutChangedSignal();
- HbGroupBox* label = mUiLoader->findWidget<HbGroupBox>(DOCML_NAME_VC_HEADINGBANNER);
- QString returnString = label->heading();
- QString expectedString = "txt_videos_subtitle_ln_videos";
- QCOMPARE(returnString, expectedString);
-
- mTestView->mCurrentList = 0;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- emit testLayoutChangedSignal();
- returnString = label->heading();
- expectedString = "txt_videos_subtitle_ln_videos";
- QCOMPARE(returnString, expectedString);
+ QCOMPARE( label->heading(), QString("txt_videos_subtitle_ln_videos") );
mTestView->mCurrentList = collectionWidget;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
emit testLayoutChangedSignal();
- returnString = label->heading();
- expectedString = "txt_videos_subtitle_l1_collections";
- QCOMPARE(returnString, expectedString);
-
- mTestView->mCurrentList = 0;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- emit testLayoutChangedSignal();
- returnString = label->heading();
- expectedString = "txt_videos_subtitle_l1_collections";
- QCOMPARE(returnString, expectedString);
+ QCOMPARE( label->heading(), QString("txt_videos_subtitle_ln_collections") );
mTestView->mCurrentList = collectionContentWidget;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
emit testLayoutChangedSignal();
- returnString = label->heading();
- expectedString = "txt_videos_subtitle_1_l2";
- QCOMPARE(returnString, expectedString);
+ QCOMPARE( label->heading(), QString("txt_videos_subtitle_1_l2") );
- mTestView->mCurrentList = 0;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- expectedString = "txt_videos_subtitle_1_l2";
- emit testLayoutChangedSignal();
- returnString = label->heading();
- QCOMPARE(returnString, expectedString);
+ // how to test the collection name?
- mTestView->mCurrentList = collectionContentWidget;
- mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
- emit testCollectionOpenedSignal(true, QString("NAME"));
- emit testLayoutChangedSignal();
- returnString = label->heading();
- expectedString = "txt_videos_subtitle_1_l2";
- QCOMPARE(returnString, expectedString);
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -1247,28 +1151,521 @@
//
void TestListView::testShowHint()
{
- VideoHintWidget *hintWidget = 0;
-
init(true);
connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
+ mTestView->mModelReady = true;
- setRowCount(1);
- hintWidget = mUiLoader->findWidget<VideoHintWidget>(DOCML_NAME_VC_VIDEOHINTWIDGET);
+ // current list is null. (cannot be verified, run for coverity
+ emit testLayoutChangedSignal();
+ mTestView->activateView(TMPXItemId::InvalidId());
+
+ // hint widget cannot be loaded. (cannot be tested, run for coverity)
+ VideoCollectionUiLoaderData::mFindFailureNameList.append(DOCML_NAME_VC_VIDEOHINTWIDGET);
+ emit testLayoutChangedSignal();
+ VideoCollectionUiLoaderData::mFindFailureNameList.clear();
+
+ VideoHintWidget *hintWidget = mUiLoader->findWidget<VideoHintWidget>(DOCML_NAME_VC_VIDEOHINTWIDGET);
+
+ /////
+ // hint widget showing
+ // model not ready (need to use another slot for this)
mTestView->mModelReady = false;
- hintWidget->setVisible(true);
+ mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot()));
+ emit testSignal();
+ QVERIFY(hintWidget->isVisible() == false );
+ QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(openAllVideosViewSlot()));
+
+ // model ready, row count not zero
+ mTestView->mModelReady = true;
+ setRowCount(1);
+ emit testLayoutChangedSignal();
+ QVERIFY(hintWidget->isVisible() == false );
+ QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
+
+ // model ready, row count is zero
+ setRowCount(0);
+ emit testLayoutChangedSignal();
+ QVERIFY(hintWidget->isVisible() == true );
+ QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
+
+ // model ready, row count is zero show to be false
+ connect(this, SIGNAL(testSignal()), mTestView, SLOT(openCollectionViewSlot()));
+ emit testSignal();
+ QVERIFY(hintWidget->isVisible() == false );
+ QVERIFY(VideoHintWidgetData::mSettedButtonShowLevel);
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(openCollectionViewSlot()));
+
+ mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
+
+ ////////
+ // toolbar setup
+ mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->setVisible(true);
+ mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->setVisible(true);
+ // mToolbarViewsActionGroup is null
+ QActionGroup *tmp = mTestView->mToolbarViewsActionGroup;
+ mTestView->mToolbarViewsActionGroup = 0;
+ emit testLayoutChangedSignal();
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->isVisible());
+ mTestView->mToolbarViewsActionGroup = tmp;
+
+ // mToolbarCollectionActionGroup is null
+ tmp = mTestView->mToolbarCollectionActionGroup;
+ mTestView->mToolbarCollectionActionGroup = 0;
+ emit testLayoutChangedSignal();
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->isVisible());
+ mTestView->mToolbarCollectionActionGroup = tmp;
+
+ // mIsService is true
+ mTestView->mIsService = true;
+ emit testLayoutChangedSignal();
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->isVisible());
+ mTestView->mIsService = false;
+
+ // show -flag is true, currentlist level != VideoCollectionCommon::ELevelDefaultColl
+ mTestView->mCurrentList->activate(VideoCollectionCommon::ELevelAlbum);
+ emit testLayoutChangedSignal();
+ QVERIFY(!mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->isVisible());
+
+ mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->setVisible(true);
+ // show -flag is true, currentlist level == VideoCollectionCommon::ELevelDefaultColl
+ mTestView->mCurrentList->activate(VideoCollectionCommon::ELevelDefaultColl);
+ emit testLayoutChangedSignal();
+ QVERIFY(!mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
+ QVERIFY(!mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->isVisible());
+
+ // show -flag is false
+ setRowCount(1);
+ emit testLayoutChangedSignal();
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionRemoveVideos]->isVisible());
+ QVERIFY(mTestView->mToolbarActions[VideoListView::ETBActionAddVideos]->isVisible());
+
+ ///////
+ // sub label
+
+ // sub label cannot be found (cannot be verified, run for coverity)
+ VideoCollectionUiLoaderData::mFindFailureNameList.append(DOCML_NAME_VC_HEADINGBANNER);
emit testLayoutChangedSignal();
- QVERIFY(hintWidget->isVisible());
+ VideoCollectionUiLoaderData::mFindFailureNameList.clear();
+
+ HbGroupBox *subLabel =
+ mUiLoader->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER);
+
+ // show -flag is false
+ setRowCount(1);
+ emit testLayoutChangedSignal();
+ QVERIFY(subLabel->isVisible());
+
+ // show -flag is true, current list's level != ELevelVideos
+ setRowCount(0);
+ mTestView->mCurrentList->activate(VideoCollectionCommon::ELevelAlbum);
+ emit testLayoutChangedSignal();
+ QVERIFY(subLabel->isVisible());
+
+ // show -flag is true, current list's level == ELevelVideos
+ setRowCount(0);
+ mTestView->mCurrentList->activate(VideoCollectionCommon::ELevelVideos);
+ emit testLayoutChangedSignal();
+ QVERIFY(!subLabel->isVisible());
+}
+
+// ---------------------------------------------------------------------------
+// testTitleReadySlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testTitleReadySlot()
+{
+ init(true);
+
+ QVERIFY(connect(this, SIGNAL(testSignal(const QString &)), mTestView, SLOT(titleReadySlot(const QString &))));
+
+ QString title("TEST");
+
+ emit testSignal(title);
+
+ QVERIFY(mTestView->mTitle == title);
+
+ disconnect(this, SIGNAL(testSignal(const QString &)), mTestView, SLOT(titleReadySlot(const QString &)));
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testDoDelayedSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testDoDelayedsSlot()
+{
+ init(true);
+
+ QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(doDelayedsSlot())));
+
+ emit testSignal();
+
+ QCOMPARE(VideoCollectionUiLoaderData::mLastLoadPhasedData, (int)VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(doDelayedsSlot()));
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testOpenNewAlbumSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testOpenNewAlbumSlot()
+{
+ init(false);
+
+ QVERIFY(connect(this, SIGNAL(testSignal(const QModelIndex &, int, int)), mTestView, SLOT(openNewAlbumSlot(const QModelIndex &, int, int))));
+
+ QModelIndex index;
+
+ // Not initialized, no mCurrentList
+ emit testSignal(index, 0, 0);
+ // TODO verify
+
+ // Good case
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
+ setRowCount(1);
+ emit testSignal(index, 0, 0);
+ // TODO verify
+
+ // Invalid index
+ emit testSignal(index, -1, 0);
+ // TODO verify
+
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(doDelayedsSlot()));
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testAboutToChangeOrientationSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testAboutToChangeOrientationSlot()
+{
+ init(false);
+ QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToChangeOrientationSlot())));
+
+ emit testSignal();
+
+ // nothing to verify
+
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(aboutToChangeOrientationSlot()));
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testOrientationChangedSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testOrientationChangedSlot()
+{
+ init(false);
+ QVERIFY(connect(this, SIGNAL(testSignal(Qt::Orientation)), mTestView,
+ SLOT(orientationChangedSlot(Qt::Orientation))));
+
+ HbView::mSetItemVisibleLast = false;
+
+ emit testSignal(Qt::Vertical);
+ QVERIFY(HbView::mSetItemVisibleLast == true);
+
+ emit testSignal(Qt::Horizontal);
+ QVERIFY(HbView::mSetItemVisibleLast == false);
+
+ disconnect(this, SIGNAL(testSignal(Qt::Orientation)), mTestView,
+ SLOT(orientationChangedSlot(Qt::Orientation)));
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testCreateCollectionSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testCreateCollectionSlot()
+{
+ init(false);
+ QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot())));
+
+ // not initialized, no mCurrentList
+ emit testSignal();
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+ QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
+
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
+
+ // dialog canceled
+ HbInputDialog::mGetTextFails = true;
+ emit testSignal();
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+ QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
- VideoSortFilterProxyModel* model = mTestView->mCurrentList->mModel;
- mTestView->mCurrentList->mModel = 0;
- mTestView->mModelReady = true;
- emit testLayoutChangedSignal();
- QVERIFY(hintWidget->isVisible() == false);
+ // empty name
+ HbInputDialog::mGetTextFails = false;
+ HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mGetTextReturnValue = "";
+ emit testSignal();
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+ QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "");
+
+ // Good case.
+ HbInputDialog::mGetTextReturnValue = "testAlbum";
+ HbInputDialog::mGetTextCallCount = 0;
+ emit testSignal();
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+ QVERIFY(VideoSortFilterProxyModelData::mLastAddedAlbumName == "testAlbum");
+
+ HbInputDialog::mGetTextCallCount = 0;
+ HbInputDialog::mGetTextReturnValue = QString();
+ VideoSortFilterProxyModelData::mLastAddedAlbumName = "";
+
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(createCollectionSlot()));
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testAddVideosToCollectionSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testAddVideosToCollectionSlot()
+{
+ init(false);
+ QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(addVideosToCollectionSlot())));
+
+ VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(0, 2);
+
+ // Not initalized, no mCurrentList
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == -1);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
+ QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
+
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
+
+ // Selection dialog widget loading fails.
+ VideoCollectionUiLoaderData::mFindFailure = true;
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == -1);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
+ QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
+
+ // Current level is not album
+ VideoListSelectionDialogData::reset();
+ VideoCollectionViewUtilsData::reset();
+ VideoCollectionUiLoaderData::mFindFailure = false;
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == VideoListSelectionDialog::EAddToCollection);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == VideoSortFilterProxyModelData::mOpenedItemId);
+ QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
+
+ // Current level is album, video list widget load fails.
+ VideoListSelectionDialogData::reset();
+ VideoCollectionViewUtilsData::reset();
+ VideoCollectionUiLoaderData::reset();
+ HbDocumentLoader::mVideoListWidgetFailure = true;
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == VideoListSelectionDialog::EAddToCollection);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == VideoSortFilterProxyModelData::mOpenedItemId);
+ QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
+
+ // Current level is album, but model is empty.
+ HbDocumentLoader::mVideoListWidgetFailure = false;
+ VideoListSelectionDialogData::reset();
+ VideoCollectionViewUtilsData::reset();
+ VideoCollectionUiLoaderData::reset();
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == -1);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
+ QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
+
+ // Current level is album, all videos are in the album
+ VideoListSelectionDialogData::reset();
+ VideoListDataModelData::reset();
+ VideoCollectionViewUtilsData::reset();
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
+ VideoListWidget *allVideos = mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_VIDEOLISTWIDGET);
+ QVERIFY(allVideos);
+ setRowCount(3, allVideos->mModel);
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == -1);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
+ QVERIFY(VideoCollectionViewUtilsData::mLastError ==
+ VideoCollectionCommon::statusAllVideosAlreadyInCollection);
+
+ // Current level is album, all videos are not in the album
+ VideoListSelectionDialogData::reset();
+ VideoCollectionViewUtilsData::reset();
+ VideoListDataModelData::reset();
+ QVERIFY(allVideos);
+ setRowCount(3, allVideos->mModel);
+ // Must have different model than selection dialog has. Otherwise Qt optimizes rowCount calls
+ // to source model and VideoListDataModelData::mRowCountDecrement hack doesn't work.
+ QVERIFY(connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot())));
+ emit testSignal2();
+ disconnect(this, SIGNAL(testSignal2()), mTestView, SLOT(openCollectionViewSlot()));
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
+ VideoListDataModelData::mRowCountDecrement = 1;
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
+ setRowCount(1);
+ emit testSignal();
+ QVERIFY(VideoListSelectionDialogData::mSelectionType == VideoListSelectionDialog::EAddToCollection);
+ QVERIFY(VideoListSelectionDialogData::mSettedMpxId == VideoSortFilterProxyModelData::mOpenedItemId);
+ QCOMPARE(VideoCollectionViewUtilsData::mLastError, 0);
+
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(addVideosToCollectionSlot()));
+
+ cleanup();
+}
+// ---------------------------------------------------------------------------
+// testRemoveVideosFromCollectionSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testRemoveVideosFromCollectionSlot()
+{
+ VideoListSelectionDialogData::reset();
+ VideoCollectionViewUtilsData::reset();
+ VideoCollectionUiLoaderData::reset();
+ HbDocumentLoader::mVideoListWidgetFailure = false;
+
+ init(false);
+
+ QVERIFY(connect(this, SIGNAL(testSignal()), mTestView, SLOT(removeVideosFromCollectionSlot())));
+
+ // Not initialized, no current list
+ emit testSignal();
+
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
setRowCount(1);
- hintWidget->setVisible(true);
- emit testLayoutChangedSignal();
- QVERIFY(hintWidget->isVisible() == false);
+
+ // Wrong level.
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
+ emit testSignal();
+
+ // No items in model.
+ mTestView->mCurrentList->mCurrentLevel = VideoCollectionCommon::ELevelDefaultColl;
+ emit testSignal();
+
+ // Fail to load selection dialog.
+ VideoCollectionUiLoaderData::mFindFailure = true;
+ emit testSignal();
+
+ // Open item is invalid
+ VideoCollectionUiLoaderData::mFindFailure = false;
+ VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId::InvalidId();
+ emit testSignal();
+
+ // Open item is video!
+ VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(0, KVcxMvcMediaTypeVideo);
+ emit testSignal();
+
+ // Good case.
+ VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(0, KVcxMvcMediaTypeAlbum);
+ emit testSignal();
+
+ disconnect(this, SIGNAL(testSignal()), mTestView, SLOT(removeVideosFromCollectionSlot()));
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testFinishCollectionOpenedSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testFinishCollectionOpenedSlot()
+{
+ XQServiceUtilXtra *serviceUtil = XQServiceUtilXtra::instance();
+ serviceUtil->setCurrentService(false);
+
+ init(false);
+
+ QVERIFY(connect(this, SIGNAL(testSignal(const HbEffect::EffectStatus &)), mTestView,
+ SLOT(finishCollectionOpenedSlot(const HbEffect::EffectStatus &))));
+
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
+
+ HbEffect::EffectStatus status;
+
+ // Invalid status.userData
+ mTestView->mTransitionOngoing = true;
+ emit testSignal(status);
+ QVERIFY(!mTestView->mTransitionOngoing);
+ // TODO: verify
+
+ // Category is not album
+ QVERIFY(mTestView->toolBar());
+ mTestView->toolBar()->clearActions();
+ mTestView->mTransitionOngoing = true;
+ status.userData = QVariant(static_cast<int>(VideoCollectionCommon::ELevelCategory));
+ emit testSignal(status);
+ QVERIFY(!mTestView->mTransitionOngoing);
+ QVERIFY(mTestView->toolBar()->actions().count() == 0);
+
+ // Category is album
+ QVERIFY(mTestView->toolBar());
+ mTestView->toolBar()->clearActions();
+ mTestView->mTransitionOngoing = true;
+ status.userData = QVariant(static_cast<int>(VideoCollectionCommon::ELevelAlbum));
+ emit testSignal(status);
+ QVERIFY(!mTestView->mTransitionOngoing);
+ QVERIFY(mTestView->toolBar()->actions().count() > 0);
+
+ disconnect(this, SIGNAL(testSignal(const HbEffect::EffectStatus &)), mTestView,
+ SLOT(finishCollectionOpenedSlot(const HbEffect::EffectStatus &)));
+
+ cleanup();
+
+ // final cleanup
+ serviceUtil->decreaseReferenceCount();
+}
+
+// ---------------------------------------------------------------------------
+// testFinishCollectionOpenedSlot
+// ---------------------------------------------------------------------------
+//
+void TestListView::testFinishCollectionClosedSlot()
+{
+ init(false);
+
+ QVERIFY(connect(this, SIGNAL(testSignal(const HbEffect::EffectStatus &)), mTestView,
+ SLOT(finishCollectionClosedSlot(const HbEffect::EffectStatus &))));
+
+ QVERIFY(mTestView->initializeView() == 0);
+ mTestView->activateView(TMPXItemId::InvalidId());
+
+ HbEffect::EffectStatus status;
+
+ mTestView->mTransitionOngoing = true;
+ emit testSignal(status);
+ QVERIFY(!mTestView->mTransitionOngoing);
+
+ mTestView->mTransitionOngoing = true;
+ QActionGroup *tmp = mTestView->mToolbarViewsActionGroup;
+ mTestView->mToolbarViewsActionGroup = 0;
+ emit testSignal(status);
+ QVERIFY(!mTestView->mTransitionOngoing);
+ mTestView->mToolbarViewsActionGroup = tmp;
+
+
+ disconnect(this, SIGNAL(testSignal(const HbEffect::EffectStatus &)), mTestView,
+ SLOT(finishCollectionClosedSlot(const HbEffect::EffectStatus &)));
+
+ cleanup();
}
// End of file
--- a/videocollection/videocollectionview/tsrc/testlistview/testlistview.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/testlistview.pro Mon May 03 12:32:50 2010 +0300
@@ -20,7 +20,8 @@
DEPENDPATH += . \
inc \
- src
+ src \
+ ../../../tsrc/stubs
INCLUDEPATH += . \
inc \
@@ -29,62 +30,18 @@
../../../inc \
../../../videocollectionview/inc \
../../../videocollectionwrapper/inc \
- ../../../../videoplayerapp/videoplayerengine/inc
-
-CONFIG += qtestlib \
- Hb \
- symbian_test
-
-LIBS += -lestor.dll \
- -lfbscli.dll \
- -lbitgdi.dll \
- -lgdi.dll \
- -lxqplugins.dll \
- -lmpxviewframeworkqt.dll \
- -lxqservice.dll \
- -lxqserviceutil.dll
+ ../../../../inc \
+ ../../../../videoplayerapp/videoplayerengine/inc \
HEADERS += inc/testlistview.h \
\ # headers needed in test
../../../videocollectionview/inc/videolistview.h \
- \ # headers needed in stubs
- ../../../tsrc/stubs/inc/hbmenu.h \
- ../../../tsrc/stubs/inc/hbmessagebox.h \
- ../../../tsrc/stubs/inc/xqserviceutil.h \
- ../../../tsrc/stubs/inc/xqserviceutilxtra.h \
- ../../../videocollectionview/inc/videocollectionuiloader.h \
- ../../../videocollectionview/inc/videolistselectiondialog.h \
- ../../../videocollectionview/inc/videocollectionviewutils.h \
- ../../../videocollectionview/inc/videohintwidget.h \
- ../../../videocollectionview/inc/videolistwidget.h \
- ../../../videocollectionwrapper/inc/videocollectionwrapper.h \
- ../../../videocollectionwrapper/inc/videosortfilterproxymodel.h \
- ../../../videocollectionwrapper/inc/videolistdatamodel.h \
- ../../../../videoplayerapp/videoplayerengine/inc/videoservices.h \
- ../../../../videoplayerapp/videoplayerengine/inc/videoserviceurifetch.h
SOURCES += src/testlistview.cpp \
\ # sources needed in test
../../../videocollectionview/src/videolistview.cpp \
- \ # sources needed in stubs
- ../../../tsrc/stubs/src/hbmessagebox.cpp \
- ../../../tsrc/stubs/src/hbmenu.cpp \
- ../../../tsrc/stubs/src/hbwidget.cpp \
- ../../../tsrc/stubs/src/hbaction.cpp \
- ../../../tsrc/stubs/src/hbdialog.cpp \
- ../../../tsrc/stubs/src/hblistview.cpp \
- ../../../tsrc/stubs/src/hbscrollbar.cpp \
- ../../../tsrc/stubs/src/xqserviceutilxtra.cpp \
- ../../../tsrc/stubs/src/videocollectionuiloader.cpp \
- ../../../tsrc/stubs/src/videolistselectiondialog.cpp \
- ../../../tsrc/stubs/src/videocollectionviewutils.cpp \
- ../../../tsrc/stubs/src/videohintwidget.cpp \
- ../../../tsrc/stubs/src/videolistwidget.cpp \
- ../../../tsrc/stubs/src/videocollectionwrapper.cpp \
- ../../../tsrc/stubs/src/videosortfilterproxymodel.cpp \
- ../../../tsrc/stubs/src/videolistdatamodel.cpp \
- ../../../tsrc/stubs/src/videoservices.cpp \
- ../../../tsrc/stubs/src/videoserviceurifetch.cpp
+
+TESTEDCLASS = videolistview
+include(../../../tsrc/stubs/stubs.pro)
RESOURCES += ../../data/videocollectionview.qrc
-
--- a/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/inc/testlistwidget.h Mon May 03 12:32:50 2010 +0300
@@ -15,12 +15,14 @@
*
*/
+// Version : %version: 24 %
+
#ifndef __TESTLISTWIDGET_H__
#define __TESTLISTWIDGET_H__
-
// INCLUDES
#include <QtTest/QtTest>
+#include "videocollectioncommon.h"
class VideoListWidget;
class DummyDataModel;
@@ -34,13 +36,17 @@
class VideoListDataModel;
class VideoCollectionUiLoader;
+using namespace VideoCollectionCommon;
+
class TestListWidget : public QObject
{
Q_OBJECT
public:
- void setRowCount(int count, int type = 0, VideoListDataModel *model = 0);
+ void setRowCount(int count,
+ TModelType type = EModelTypeAllVideos,
+ VideoListDataModel *model = 0);
// test functions for the test framework
private slots:
@@ -95,9 +101,14 @@
void testEmitActivated();
/**
- * verifies longPressGesture
+ * verifies longPressedSlot
*/
- void testLongPressGesture();
+ void testLongPressedSlot();
+
+ /**
+ * verifies panGesture
+ */
+ void testPanGesture();
/**
* verifies setContextMenu
@@ -120,14 +131,9 @@
void testRenameSlot();
/**
- * verifies playItemSlot
+ * verifies openItemSlot
*/
- void testPlayItemSlot();
-
- /**
- * verifies playAllSlot
- */
- void testPlayAllSlot();
+ void testOpenItemSlot();
/**
* verifies addToCollectionSlot
--- a/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/src/testlistwidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: 46 %
+
#include <qmap.h>
#include <vcxmyvideosdefs.h>
#include <mpxhbvideocommondefs.h>
@@ -22,7 +24,6 @@
#include "hbglobal.h"
#include "hblistview.h"
#include "hbview.h"
-#include "videoservices.h"
#include "videosortfilterproxymodel.h"
#include "hbscrollbar.h"
#include "hbmenu.h"
@@ -30,6 +31,7 @@
#include "hbinstance.h"
#include "hbmainwindow.h"
#include "hbstyleloader.h"
+#include "hbinputdialog.h"
#include "videothumbnaildata.h"
#include "videocollectioncommon.h"
#include "videocollectionwrapper.h"
@@ -39,7 +41,6 @@
#include "videolistdatamodel.h"
#include "videolistdatamodeldata.h"
#include "videosortfilterproxymodeldata.h"
-#include "videoservices.h"
#include "videocollectionuiloader.h"
#include "videocollectionuiloaderdata.h"
#include "videolistselectiondialog.h"
@@ -50,6 +51,7 @@
#define private public
#include "videolistwidget.h"
+#include "videoservices.h"
#undef private
static const int CONTEXT_MENU_COUNT = 8;
@@ -78,11 +80,19 @@
}
/**
- * calls longPressGesture
+ * calls longPressedSlot
*/
- void callLongPressGesture(const QPointF &point)
+ void callLongPressedSlot(HbAbstractViewItem *item, const QPointF &point)
{
- VideoListWidget::longPressGesture (point);
+ VideoListWidget::longPressedSlot(item, point);
+ }
+
+ /**
+ * calls pangesture
+ */
+ void callPanGesture(const QPointF &point)
+ {
+ VideoListWidget::panGesture(point);
}
};
@@ -112,10 +122,12 @@
}
// ---------------------------------------------------------------------------
-//
+// setRowCount
// ---------------------------------------------------------------------------
//
-void TestListWidget::setRowCount(int count, int type, VideoListDataModel *model)
+void TestListWidget::setRowCount(int count,
+ VideoCollectionCommon::TModelType type,
+ VideoListDataModel *model)
{
if (!model)
{
@@ -190,7 +202,7 @@
void TestListWidget::testInitialize()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
// succeed case ( new operator cannot be stubbed)
QVERIFY(mTestWidget->initialize(*model) == 0);
@@ -216,7 +228,7 @@
void TestListWidget::testActivate()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
// no model: fails
QVERIFY(mTestWidget->activate() == -1);
@@ -236,69 +248,59 @@
HbListView::mLatestEnableValue = false;
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
- // model exists, current view exists, level neither ELevelAlbum nor ELevelDefaultColl,
- // no mNavKeyQuitAction
+ // model exists, current view exists, level neither ELevelAlbum nor ELevelDefaultColl
HbView *tmpView = new HbView();
hbInstance->allMainWindows().value(0)->addView(tmpView);
- HbAction *tmpAction = mTestWidget->mNavKeyQuitAction;
- mTestWidget->mNavKeyQuitAction = 0;
QVERIFY(mTestWidget->activate() == 0);
QCOMPARE(HbMenuData::mEnabledSetted, true);
QCOMPARE(HbListView::mLatestVisibility, true);
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
- QVERIFY(!tmpView->mNavigationAction);
-
- HbMenuData::mEnabledSetted = true;
- HbListView::mLatestVisibility = false;
- HbListView::mLatestEnableValue = false;
- VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
- mTestWidget->mNavKeyQuitAction = tmpAction;
-
- // model exists, current view exists, level neither ELevelAlbum nor ELevelDefaultColl,
- // mNavKeyQuitAction exists
- QVERIFY(mTestWidget->activate() == 0);
- QCOMPARE(HbMenuData::mEnabledSetted, true);
- QCOMPARE(HbListView::mLatestVisibility, true);
- QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
- QVERIFY(tmpView->mNavigationAction == tmpAction);
-
+ QVERIFY(mTestWidget->mNavKeyAction);
+ QVERIFY(HbAction::mNavAction == Hb::QuitAction);
+
HbMenuData::mEnabledSetted = true;
HbListView::mLatestVisibility = false;
HbListView::mLatestEnableValue = false;
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
- // model exists, current view exists, level is ELevelAlbum
- // no mNavKeyBackAction
+ // model exists, current view exists, level is ELevelAlbum
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ model = wrapper.getModel(VideoCollectionCommon::EModelTypeCollectionContent);
tmpView->mNavigationAction = 0;
- tmpAction = mTestWidget->mNavKeyBackAction;
- mTestWidget->mNavKeyBackAction = 0;
+ QVERIFY(mTestWidget->initialize(*model) == 0);
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
QCOMPARE(HbMenuData::mEnabledSetted, true);
QCOMPARE(HbListView::mLatestVisibility, true);
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
- QVERIFY(!tmpView->mNavigationAction);
+ QVERIFY(mTestWidget->mNavKeyAction);
+ QVERIFY(HbAction::mNavAction == Hb::BackAction);
HbMenuData::mEnabledSetted = true;
HbListView::mLatestVisibility = false;
HbListView::mLatestEnableValue = false;
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
+
+ // activate:
+ // -is service
+ // -current service is browse
+ VideoServices *videoServices = VideoServices::instance();
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
+ QVERIFY(mTestWidget->mNavKeyAction);
+ QVERIFY(HbAction::mNavAction == Hb::QuitAction);
- mTestWidget->mNavKeyBackAction = tmpAction;
- // model exists, current view exists, level neither ELevelAlbum nor ELevelDefaultColl,
- // mNavKeyBackAction exists
- QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
- QCOMPARE(HbMenuData::mEnabledSetted, true);
- QCOMPARE(HbListView::mLatestVisibility, true);
- QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
- QVERIFY(tmpView->mNavigationAction == tmpAction);
-
- HbMenuData::mEnabledSetted = true;
- HbListView::mLatestVisibility = false;
- HbListView::mLatestEnableValue = false;
- VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
-
hbInstance->allMainWindows().value(0)->removeView(tmpView);
delete tmpView;
+
+ // final cleanup
+ videoServices->mCurrentService = VideoServices::ENoService;
+ videoServices->decreaseReferenceCount();
}
// ---------------------------------------------------------------------------
@@ -308,7 +310,7 @@
void TestListWidget::testDeactivate()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
HbListView::mLatestVisibility = true;
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 1;
@@ -331,6 +333,23 @@
QCOMPARE(HbListView::mLatestVisibility, false);
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
+ // deactivate:
+ // -is service
+ // -current service is browse
+ VideoServices *videoServices = VideoServices::instance();
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
+ mTestWidget->deactivate();
+ QCOMPARE(HbListView::mLatestVisibility, false);
+ QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
+
+ // final cleanup
+ videoServices->mCurrentService = VideoServices::ENoService;
+ videoServices->decreaseReferenceCount();
}
// ---------------------------------------------------------------------------
@@ -340,7 +359,7 @@
void TestListWidget::testGetLevel()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
mTestWidget->initialize(*model);
@@ -355,7 +374,7 @@
void TestListWidget::testGetModel()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
QVERIFY(&(mTestWidget->getModel()) == 0);
@@ -372,8 +391,9 @@
//
void TestListWidget::testEmitActivated()
{
+ VideoServices *videoServices = VideoServices::instance();
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)));
QSignalSpy spysignalFileUri(mTestWidget, SIGNAL(fileUri(const QString&)));
@@ -387,7 +407,7 @@
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(savedId);
QVariant data = QString("test");
- VideoListDataModelData::setData( Qt::DisplayRole, data);
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
setRowCount(2);
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0,0));
@@ -416,7 +436,7 @@
// current level is ELevelCategory
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
// --> variant is not valid
- VideoListDataModelData::setData( Qt::DisplayRole, QVariant());
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
fetchIndex = model->index(0, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
QVERIFY(spysignal.count() == 0);
@@ -426,7 +446,7 @@
// --> variant is valid, collectionOpened -signal should be emitted
- VideoListDataModelData::setData( Qt::DisplayRole, data);
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
fetchIndex = model->index(1, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
QVERIFY(spysignal.count() == 1);
@@ -440,9 +460,11 @@
// current level is not ELevelCategory
// mIsService is true, variant gotten is invalid
- VideoListDataModelData::setData( Qt::DisplayRole, QVariant());
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
mTestWidget->mIsService = true;
+ mTestWidget->mVideoServices = videoServices;
fetchIndex = model->index(0, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
QVERIFY(spysignal.count() == 0);
@@ -452,7 +474,8 @@
// current level is not ELevelCategory
// mIsService is true, variant gotten is valid
- VideoListDataModelData::setData( VideoCollectionCommon::KeyFilePath, data);
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyFilePath, data);
fetchIndex = model->index(0, 0, QModelIndex());
mTestWidget->callEmiteActivated(fetchIndex);
QVERIFY(spysignal.count() == 0);
@@ -487,118 +510,177 @@
QVERIFY(spysignalFileUri.count() == 0);
QVERIFY(spysignalActivated.count() == 0);
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
+
+ // final cleanup
+ videoServices->decreaseReferenceCount();
}
-
// ---------------------------------------------------------------------------
-// testLongPressGesture
+// testLongPressedSlot
// ---------------------------------------------------------------------------
//
-void TestListWidget::testLongPressGesture()
+void TestListWidget::testLongPressedSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
QVariant data = QString("test");
// correct data to index 0
- VideoListDataModelData::setData( Qt::DisplayRole, data);
+ VideoListDataModelData::setData(Qt::DisplayRole, data);
setRowCount(2);
QPointF point(1,1);
mTestWidget->initialize(*model);
+ HbAbstractViewItem *item = new HbAbstractViewItem();
+ item->mModelIndex = mTestWidget->mModel->index(0, 0, QModelIndex());
mTestWidget->setSelectionMode(HbAbstractItemView::MultiSelection);
+
// mDetailsReady is false
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint != point);
// multiselection is on
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint != point);
// selection mode is custom
mTestWidget->setSelectionMode(-1);
-
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint != point);
- // item at position is null
- HbListViewItem *pTmp = mTestWidget->mItem;
- mTestWidget->mItem = 0;
+ // item is null
mTestWidget->setSelectionMode(HbAbstractItemView::NoSelection);
HbListView::mCurrentIndex = QModelIndex();
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(0, point);
QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint == point);
- // item at position is not null, but returns invalid index
- mTestWidget->mItem = pTmp;
- mTestWidget->mItem->mModelIndex = QModelIndex();
- mTestWidget->callLongPressGesture(point);
+ // item has invalid index
+ item->mModelIndex = QModelIndex();
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint == point);
// item at position is not null, returns current index is valid
- HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
+ item->mModelIndex = model->index(0, 0, QModelIndex());
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
- // model is == 0
+ // model is null
VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
mTestWidget->mModel = 0;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint == point);
mTestWidget->mModel = tmp;
- HbListView::mLongPressedPoint = QPointF();
- // gotten id != KVcxMvcMediaTypeVideo, service is true and id != KVcxMvcMediaTypeAlbum
+ // gotten id != KVcxMvcMediaTypeVideo, service is true and id != KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,1));
mTestWidget->mIsService = true;
- mTestWidget->callLongPressGesture(point);
- QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint == point);
- HbListView::mLongPressedPoint = QPointF();
+ mTestWidget->callLongPressedSlot(item, point);
+ QVERIFY(HbMenuData::mExecPoint == point);
// gotten id != KVcxMvcMediaTypeVideo, service is false and id != KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,1));
mTestWidget->mIsService = false;
- mTestWidget->callLongPressGesture(point);
- QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint == point);
- HbListView::mLongPressedPoint = QPointF();
+ mTestWidget->callLongPressedSlot(item, point);
+ QVERIFY(HbMenuData::mExecPoint == point);
// gotten id != KVcxMvcMediaTypeVideo, service is false and id == KVcxMvcMediaTypeAlbum
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,2));
mTestWidget->mIsService = false;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint == point);
- QVERIFY(HbListView::mLongPressedPoint == point);
HbMenuData::mExecPoint = QPointF();
- HbListView::mLongPressedPoint = QPointF();
// gotten id == KVcxMvcMediaTypeVideo
VideoSortFilterProxyModelData::mItemIds.clear();
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,02));
mTestWidget->mIsService = false;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint == point);
- QVERIFY(HbListView::mLongPressedPoint == point);
HbMenuData::mExecPoint = QPointF();
- HbListView::mLongPressedPoint = QPointF();
// no context menu
// (context menu setup fails, due invalid amount of correct actions)
- QMap<VideoListWidget::TContextActionIds, HbAction*>::iterator iter = mTestWidget->mContextMenuActions.begin();
+ QMap<VideoListWidget::TContextActionIds, HbAction*>::iterator iter =
+ mTestWidget->mContextMenuActions.begin();
iter++;
HbAction *nullAction = 0;
iter.value() = nullAction;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(HbMenuData::mExecPoint != point);
- QVERIFY(HbListView::mLongPressedPoint == point);
+
+ // long press gesture:
+ // -is service
+ // -current service is browse
+ HbMenuData::mExecPoint = QPointF();
+ VideoServices *videoServices = VideoServices::instance();
+ videoServices->mCurrentService = VideoServices::EBrowse;
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
+ mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
+ mTestWidget->callLongPressedSlot(item, point);
+ QCOMPARE(mTestWidget->mContextMenuActions.count(), 3);
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDelete]->isVisible());
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
+
+ // long press gesture:
+ // -is service
+ // -current service is EUriFetcher
+ HbMenuData::mExecPoint = QPointF();
+ videoServices = VideoServices::instance();
+ videoServices->mCurrentService = VideoServices::EUriFetcher;
+ delete mTestWidget;
+ mTestWidget = 0;
+ mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
+ QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
+ QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
+ mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
+ mTestWidget->callLongPressedSlot(item, point);
+ QCOMPARE(mTestWidget->mContextMenuActions.count(), 2);
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
+ QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
+
+ // final cleanup
+ videoServices->decreaseReferenceCount();
+ delete item;
+}
+
+// ---------------------------------------------------------------------------
+// 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);
}
// ---------------------------------------------------------------------------
@@ -608,7 +690,7 @@
void TestListWidget::testSetContextMenu()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
VideoListDataModel *sourceModel = qobject_cast<VideoListDataModel*>(model->sourceModel());
VideoSortFilterProxyModelData::mItemIds.clear();
mTestWidget->initialize(*model);
@@ -622,6 +704,9 @@
itemId.iId2 = 0;
VideoSortFilterProxyModelData::mItemIds.append(itemId);
+ HbAbstractViewItem *item = new HbAbstractViewItem();
+ item->mModelIndex = model->index(0, 0, QModelIndex());
+
// no context menu
delete mTestWidget->mContextMenu;
mTestWidget->mContextMenu = 0;
@@ -629,27 +714,27 @@
// mCurrentLevel == ELevelVideos
int visibleCount = 0;
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QMap<VideoListWidget::TContextActionIds, HbAction*>::iterator iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
while(iter != mTestWidget->mContextMenuActions.end())
{
- if(iter.value()->mVisible)
+ if(iter.value()->isVisible())
{
visibleCount++;
}
++iter;
}
- QVERIFY(visibleCount == 3);
+ QVERIFY(visibleCount == 4);
// invalid amount of actions -> invalid items gets removed
HbAction *nullAction = 0;
iter = mTestWidget->mContextMenuActions.begin();
iter++;
iter.value() = nullAction;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
QVERIFY(!mTestWidget->mContextMenu);
QVERIFY(mTestWidget->mContextMenuActions.count() == 0);
@@ -657,60 +742,81 @@
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
// mIsService is false
mTestWidget->mIsService = false;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
visibleCount = 0;
while(iter != mTestWidget->mContextMenuActions.end())
{
- if(iter.value()->mVisible)
+ if(iter.value()->isVisible())
{
visibleCount++;
}
++iter;
}
- QVERIFY(visibleCount == 2);
+ QVERIFY(visibleCount == 1);
- // mIsService is true
+ // mIsService is true, mpxId.iId2 != KVcxMvcMediaTypeAlbum
mTestWidget->mIsService = true;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
visibleCount = 0;
while(iter != mTestWidget->mContextMenuActions.end())
{
- if(iter.value()->mVisible)
+ if(iter.value()->isVisible())
{
visibleCount++;
}
++iter;
}
- QVERIFY(visibleCount == 0);
+ QVERIFY(visibleCount == 1);
+
+ // mIsService is false, mpxId.iId2 == KVcxMvcMediaTypeAlbum
+ //VideoSortFilterProxyModelData::mItemIds.clear();
+ VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,KVcxMvcMediaTypeAlbum));
+ HbListView::mCurrentIndex = model->index(1, 0, QModelIndex());
+ item->mModelIndex = model->index(1, 0, QModelIndex());
+ mTestWidget->mIsService = false;
+ mTestWidget->callLongPressedSlot(item, point);
+ iter = mTestWidget->mContextMenuActions.begin();
+ QVERIFY(iter != mTestWidget->mContextMenuActions.end());
+ visibleCount = 0;
+ while(iter != mTestWidget->mContextMenuActions.end())
+ {
+ if(iter.value()->isVisible())
+ {
+ visibleCount++;
+ }
+ ++iter;
+ }
+ QVERIFY(visibleCount == 3);
+ HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
// mCurrentLevel == ELevelAlbum
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
// mIsService is false
mTestWidget->mIsService = false;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
visibleCount = 0;
while(iter != mTestWidget->mContextMenuActions.end())
{
- if(iter.value()->mVisible)
+ if(iter.value()->isVisible())
{
visibleCount++;
}
++iter;
}
- QVERIFY(visibleCount == 3);
+ QVERIFY(visibleCount == 4);
// mIsService is true
// object needs to be resetted for the service use
cleanup();
init();
setRowCount(1);
- model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
mTestWidget->initialize(*model);
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
@@ -718,13 +824,13 @@
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
VideoSortFilterProxyModelData::mItemIds.append(itemId);
mTestWidget->mIsService = true;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
visibleCount = 0;
while(iter != mTestWidget->mContextMenuActions.end())
{
- if(iter.value()->mVisible)
+ if(iter.value()->isVisible())
{
visibleCount++;
}
@@ -734,19 +840,19 @@
//invalid level
mTestWidget->mCurrentLevel = (VideoCollectionCommon::TCollectionLevels)0;
- mTestWidget->callLongPressGesture(point);
+ mTestWidget->callLongPressedSlot(item, point);
iter = mTestWidget->mContextMenuActions.begin();
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
visibleCount = 0;
while(iter != mTestWidget->mContextMenuActions.end())
{
- if(iter.value()->mVisible)
+ if(iter.value()->isVisible())
{
visibleCount++;
}
++iter;
}
- QVERIFY(visibleCount == 0);
+ QVERIFY(visibleCount == 0);
}
void TestListWidget::testDoDelayedsSlot()
@@ -756,7 +862,7 @@
//dodelayed calls create context menu, which is already tested at
// testSetContextMenu -method, these tests are just for coverity's sake
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
mTestWidget->initialize(*model);
delete mTestWidget->mContextMenu;
@@ -767,12 +873,12 @@
// no context menu
emit testSignal();
- QVERIFY(mTestWidget->mContextMenuActions.count() == 6);
+ QVERIFY(mTestWidget->mContextMenuActions.count() == 8);
// context menu exists
emit testSignal();
- QVERIFY(mTestWidget->mContextMenuActions.count() == 6);
+ QVERIFY(mTestWidget->mContextMenuActions.count() == 8);
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingStartedSlot()));
}
@@ -784,7 +890,7 @@
void TestListWidget::testDeleteItemSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
HbMessageBoxData::mLatestTxt = "";
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
@@ -813,7 +919,7 @@
// data is valid
setRowCount(1);
QVariant data = QString("test");
- VideoListDataModelData::setData( Qt::DisplayRole, data);
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
// messagebox question returns false
@@ -825,7 +931,7 @@
HbMessageBoxData::mLatestTxt = "";
setRowCount(1);
data = QString("test");
- VideoListDataModelData::setData( Qt::DisplayRole, data);
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
// messagebox question returns true
VideoSortFilterProxyModelData::mDeleteItemsFails = false;
@@ -845,27 +951,118 @@
void TestListWidget::testRenameSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
+
+ connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
+
+ VideoSortFilterProxyModelData::reset();
+ VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
+ mTestWidget->initialize(*model);
+
+ // Good case
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ HbInputDialog::mGetTextReturnValue = "renamedVideo";
+ HbInputDialog::mGetTextCallCount = 0;
+ setRowCount(1);
+ VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
+ QVariant data = QString("albumName");
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
+ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
+ emit testSignal();
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo");
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+
+ // New name is same as previous
+ HbInputDialog::mGetTextReturnValue = QString();
+ HbInputDialog::mGetTextCallCount = 0;
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ data = QString("albumName");
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
+ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
+ emit testSignal();
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 1);
+
+ // Getting name from input dialog fails
+ HbInputDialog::mGetTextFails = true;
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ HbInputDialog::mGetTextReturnValue = QString();
+ 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);
- // nothing to test yet
- HbMessageBoxData::mLatestTxt = "";
- mTestWidget->initialize(*model);
- connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
+ // 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(!HbMessageBoxData::mLatestTxt.isEmpty());
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+
+ // No model
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ HbInputDialog::mGetTextReturnValue = "renamedVideo";
+ HbInputDialog::mGetTextCallCount = 0;
+ VideoSortFilterProxyModelData::mItemIds.clear();
+ VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
+ data = QString("albumName");
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
+ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
+ VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
+ mTestWidget->mModel = 0;
+ emit testSignal();
+ mTestWidget->mModel = tmp;
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+
+ // Variant data is invalid
+ VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
+ HbInputDialog::mGetTextReturnValue = "renamedVideo";
+ HbInputDialog::mGetTextCallCount = 0;
+ VideoSortFilterProxyModelData::mItemIds.clear();
+ VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
+ data = QVariant();
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
+ mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
+ emit testSignal();
+ QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
+ QCOMPARE(HbInputDialog::mGetTextCallCount, 0);
+
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
}
// ---------------------------------------------------------------------------
-// testPlayItemSlot
+// testOpenItemSlot
// ---------------------------------------------------------------------------
//
-void TestListWidget::testPlayItemSlot()
+void TestListWidget::testOpenItemSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
mTestWidget->initialize(*model);
- connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(playItemSlot()));
+ connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(openItemSlot()));
setRowCount(1);
TMPXItemId savedId = TMPXItemId(1,1);
VideoSortFilterProxyModelData::mItemIds.clear();
@@ -876,28 +1073,17 @@
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == savedId);
- disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(playItemSlot()));
+ disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(openItemSlot()));
}
// ---------------------------------------------------------------------------
-// testPlayAllSlot
-// ---------------------------------------------------------------------------
-//
-void TestListWidget::testPlayAllSlot()
-{
- connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(playAllSlot()));
- emit testSignal();
- disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(playAllSlot()));
-}
-
-// ---------------------------------------------------------------------------
// testAddToCollectionSlot
// ---------------------------------------------------------------------------
//
void TestListWidget::testAddToCollectionSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
VideoListSelectionDialogData::mSelectionType = -1;
VideoListSelectionDialogData::mSettedMpxId = TMPXItemId::InvalidId();
@@ -947,7 +1133,7 @@
void TestListWidget::testRemoveFromCollectionSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
VideoSortFilterProxyModelData::mRemoveItemsFromAlbumReturnValue = 0;
VideoSortFilterProxyModelData::mLastItemId = TMPXItemId::InvalidId();
@@ -998,7 +1184,7 @@
{
VideoSortFilterProxyModelData::mRemoveAlbumsFails = false;
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
HbMessageBoxData::mQuestionReturnValue = true;
HbMessageBoxData::mLatestTxt = "";
@@ -1025,13 +1211,13 @@
mTestWidget->initialize(*model);
// invalid data
- VideoListDataModelData::setData( Qt::DisplayRole, QVariant());
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
emit testSignal();
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
QVERIFY(HbMessageBoxData::mLatestTxt.isEmpty());
// valid data
- VideoListDataModelData::setData( Qt::DisplayRole, "test");
+ VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, "test");
emit testSignal();
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.isValid());
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 1);
@@ -1055,7 +1241,7 @@
void TestListWidget::testOpenDetailsSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
QSignalSpy spysignal(mTestWidget, SIGNAL(command(int)));
HbMessageBoxData::mLatestTxt = "";
@@ -1075,7 +1261,7 @@
// detail fetch fails
setRowCount(1);
QVariant data = QString("test");
- VideoListDataModelData::setData( Qt::DisplayRole, data);
+ VideoListDataModelData::setData(Qt::DisplayRole, data);
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
VideoSortFilterProxyModelData::mDetailsReturnValue = -1;
@@ -1102,7 +1288,7 @@
void TestListWidget::testBack()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)));
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(back()));
@@ -1143,7 +1329,7 @@
void TestListWidget::testScrollingEndedSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
mTestWidget->initialize(*model);
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingEndedSlot()));
@@ -1189,7 +1375,7 @@
void TestListWidget::testScrollPositionChangedSlot()
{
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
- VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
mTestWidget->initialize(*model);
const QPointF point;
--- a/videocollection/videocollectionview/tsrc/testlistwidget/testlistwidget.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistwidget/testlistwidget.pro Mon May 03 12:32:50 2010 +0300
@@ -17,7 +17,7 @@
TEMPLATE = app
TARGET =
-
+
DEPENDPATH += . \
inc \
src \
@@ -34,8 +34,7 @@
../../../../videoplayerapp/videoplayerengine/inc
CONFIG += qtestlib \
- Hb \
- symbian_test
+ Hb
LIBS += -lestor.dll \
-lfbscli.dll \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/inc/testvideocollectionuiloader.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,88 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: tester for methods in VideoCollectionUiLoader
+*
+*/
+
+#ifndef TESTVIDEOCOLLECTIONUILOADER_H
+#define TESTVIDEOCOLLECTIONUILOADER_H
+
+// INCLUDES
+#include <qttest/qttest>
+
+// FORWARD DECLARATIONS
+class VideoCollectionUiLoader;
+
+class TestVideoCollectionUiLoader : public QObject
+{
+ Q_OBJECT
+
+public:
+ TestVideoCollectionUiLoader();
+ virtual ~TestVideoCollectionUiLoader();
+
+private slots: // test functions for the test framework
+ void init();
+ void cleanup();
+
+ /** addData testcase */
+ void testAddData();
+
+ /** findWidget testcase */
+ void testFindWidget();
+
+ /** findObject testcase */
+ void testFindObject();
+
+ /** setIsServce testcase */
+ void testIsService();
+
+ /** loadDocml testcase */
+ void testLoadDocml();
+
+ /** loadSection testcase */
+ void testLoadSection();
+
+ /** loadPhase testcase */
+ void testLoadPhase();
+
+ /** loadPhase testcase */
+ void testLoadPhase_2();
+
+ /** delete loaded items testcase*/
+ void testDelete();
+
+ /** removeOrphanFromList testcase */
+ void testRemoveOrphanFromList();
+
+ /** prepareDocmlAndSection testcase */
+ void testPrepareDocmlAndSection();
+
+private slots:
+ /** slot which is called when object is ready */
+ void handleObjectReady(QObject *object, const QString &name);
+
+signals:
+
+ void testSignal(QObject *object);
+
+private:
+ /** class under test */
+ VideoCollectionUiLoader *mTestObject;
+
+ /** objects initialized */
+ QHash<QString, QObject*> mObjects;
+};
+
+#endif//TESTVIDEOCOLLECTIONUILOADER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/src/testvideocollectionuiloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,928 @@
+/**
+* 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: tester for methods in VideoCollectionUiLoader
+*
+*/
+
+#include <hbdocumentloader.h>
+#include <hbgroupbox.h>
+#include <hbaction.h>
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbview.h>
+#include <qhash.h>
+#include <qmap.h>
+#include <qset.h>
+#include <qdebug.h>
+
+#include "testvideocollectionuiloader.h"
+#include "videohintwidget.h"
+#include "videocollectionwrapperdata.h"
+
+#define private public
+#include "videocollectionuiloader.h"
+#include "videocollectionuiloaderdef.h"
+#undef private
+
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+ TestVideoCollectionUiLoader tv;
+ int res;
+ if (argc > 1)
+ {
+ res = QTest::qExec(&tv, argc, argv);
+ }
+ else
+ {
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testvideocollectionuiloader.txt";
+ res = QTest::qExec(&tv, 3, pass);
+ }
+
+ return res;
+}
+
+TestVideoCollectionUiLoader::TestVideoCollectionUiLoader():
+ mTestObject(0)
+{
+
+}
+
+TestVideoCollectionUiLoader::~TestVideoCollectionUiLoader()
+{
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::init()
+{
+ // create test object
+ if (!mTestObject)
+ {
+ mTestObject = new VideoCollectionUiLoader;
+ }
+
+ // clear object list
+ mObjects.clear();
+
+ HbDocumentLoader::cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::cleanup()
+{
+ // delete test object
+ delete mTestObject;
+ mTestObject = 0;
+}
+
+// TEST CASES START ----------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+// testAddData
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testAddData()
+{
+ VideoCollectionUiLoaderParam banner(
+ DOCML_NAME_VC_HEADINGBANNER,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam collectionWidget(
+ DOCML_NAME_VC_COLLECTIONWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam collectionContentWidget(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ const int COUNT = 3;
+
+ // add items
+ QList<VideoCollectionUiLoaderParam> params;
+ params.append(banner);
+ params.append(collectionWidget);
+ params.append(collectionContentWidget);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ QVERIFY(mTestObject->mQueue.count() == COUNT);
+ QVERIFY(mTestObject->mQueue.contains(banner));
+ QVERIFY(mTestObject->mQueue.contains(collectionWidget));
+ QVERIFY(mTestObject->mQueue.contains(collectionContentWidget));
+
+ // add duplicate items
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ QVERIFY(mTestObject->mQueue.count() == COUNT);
+ QVERIFY(mTestObject->mQueue.contains(banner));
+ QVERIFY(mTestObject->mQueue.contains(collectionWidget));
+ QVERIFY(mTestObject->mQueue.contains(collectionContentWidget));
+
+ // load first phase and add duplicate items
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QTest::qWait(1000); // wait 1 second
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ QCOMPARE(mTestObject->mQueue.count(), 0);
+}
+
+// ---------------------------------------------------------------------------
+// testFindWidget
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testFindWidget()
+{
+ HbDocumentLoader::cleanup();
+
+ QList<VideoCollectionUiLoaderParam> params;
+ VideoCollectionUiLoaderParam banner(
+ DOCML_NAME_VC_HEADINGBANNER,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam hint(
+ DOCML_NAME_VC_VIDEOHINTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+
+ // pre-load widget asynchronously and find widget
+ params.append(banner);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QTest::qWait(1000); // wait 1 second
+ HbGroupBox *bannerWidget =
+ mTestObject->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER);
+ QVERIFY(bannerWidget);
+ QVERIFY(mObjects.contains(DOCML_NAME_VC_HEADINGBANNER));
+ params.clear();
+ cleanup();
+ init();
+
+ // do not pre-load widget and load it, docml not loaded
+ HbDocumentLoader::mFindWidgetFails = true;
+ bannerWidget =
+ mTestObject->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER);
+ QVERIFY(!bannerWidget);
+ QVERIFY(!mObjects.contains(DOCML_NAME_VC_HEADINGBANNER));
+ cleanup();
+ init();
+
+ // do not pre-load widget but add it in queue, docml loaded
+ bool ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ params.append(banner);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ bannerWidget =
+ mTestObject->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER);
+ QVERIFY(bannerWidget);
+ QVERIFY(mObjects.contains(DOCML_NAME_VC_HEADINGBANNER));
+ params.clear();
+ cleanup();
+ init();
+
+ // do not pre-load widget, docml loaded
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ bannerWidget =
+ mTestObject->findWidget<HbGroupBox>(
+ DOCML_NAME_VC_HEADINGBANNER);
+ QVERIFY(bannerWidget);
+ QVERIFY(!mObjects.contains(DOCML_NAME_VC_HEADINGBANNER));
+ cleanup();
+ init();
+
+ // do not pre-load widget but add it in queue, section loaded
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ &ok);
+ QVERIFY(ok);
+ params.append(hint);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ VideoHintWidget *hintWidget =
+ mTestObject->findWidget<VideoHintWidget>(
+ DOCML_NAME_VC_VIDEOHINTWIDGET);
+ QVERIFY(hintWidget);
+ QVERIFY(mObjects.contains(DOCML_NAME_VC_VIDEOHINTWIDGET));
+ params.clear();
+ cleanup();
+ init();
+
+ // do not pre-load widget, section not loaded
+ ok = false;
+ HbDocumentLoader::mFindWidgetFails = true;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ hintWidget =
+ mTestObject->findWidget<VideoHintWidget>(
+ DOCML_NAME_VC_VIDEOHINTWIDGET);
+ QVERIFY(!hintWidget);
+ QVERIFY(!mObjects.contains(DOCML_NAME_VC_VIDEOHINTWIDGET));
+}
+
+// ---------------------------------------------------------------------------
+// testFindObject
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testFindObject()
+{
+ HbDocumentLoader::cleanup();
+
+ QList<VideoCollectionUiLoaderParam> params;
+ VideoCollectionUiLoaderParam addToCollectionParam(
+ DOCML_NAME_ADD_TO_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+
+ // find object:
+ // -docml not loaded
+ // -object not added in loading queue
+ HbDocumentLoader::mFindObjectFails = true;
+ HbAction *addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
+ QVERIFY(!addToCollection);
+ QVERIFY(!mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+ cleanup();
+ init();
+
+ // find object:
+ // -docml not loaded
+ // -object added in loading queue
+ params.append(addToCollectionParam);
+ mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&)));
+ addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
+ QVERIFY(addToCollection);
+ QVERIFY(mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+ params.clear();
+ cleanup();
+ init();
+
+ // find object:
+ // -docml loaded
+ // -object not added in loading queue
+ bool ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
+ QVERIFY(addToCollection);
+ QVERIFY(!mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+ cleanup();
+ init();
+
+ // find object:
+ // -docml loaded
+ // -object added in loading queue
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ params.append(addToCollectionParam);
+ mTestObject->addData(params, this, SLOT(handleObjectReady(QObject*, const QString&)));
+ addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
+ QVERIFY(addToCollection);
+ QVERIFY(mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+ params.clear();
+}
+
+// ---------------------------------------------------------------------------
+// testIsService
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testIsService()
+{
+ // is service:
+ // -service flag set
+ mTestObject->setIsService(true);
+ QVERIFY(mTestObject->mIsService);
+ cleanup();
+ init();
+
+ // is service:
+ // -service flag not set
+ mTestObject->setIsService(false);
+ QVERIFY(!mTestObject->mIsService);
+}
+
+// ---------------------------------------------------------------------------
+// testLoadDocml
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testLoadDocml()
+{
+ HbDocumentLoader::mLoadReturns.append(new QObject());
+
+ // load docml:
+ // -correct docml once
+ bool ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mDocmls.contains(DOCML_VIDEOCOLLECTIONVIEW_FILE));
+ cleanup();
+ init();
+
+ // load docml:
+ // -two correct docmls
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mDocmls.contains(DOCML_VIDEOCOLLECTIONVIEW_FILE));
+ mTestObject->load(DOCML_VIDEOSELECTIONDIALOG_FILE, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mDocmls.contains(DOCML_VIDEOSELECTIONDIALOG_FILE));
+ cleanup();
+ init();
+
+ // load docml:
+ // -same docml twice
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mDocmls.contains(DOCML_VIDEOCOLLECTIONVIEW_FILE));
+ int objectCount = mTestObject->mOrphans.count();
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mDocmls.contains(DOCML_VIDEOCOLLECTIONVIEW_FILE));
+ QVERIFY(objectCount == mTestObject->mOrphans.count());
+ cleanup();
+ init();
+
+ // load docml:
+ // -incorrect docml
+ const char *INVALID_DOCML = "invalid docml";
+ ok = false;
+ HbDocumentLoader::mLoadFails = true;
+ mTestObject->load(INVALID_DOCML, &ok);
+ QVERIFY(!ok);
+ QVERIFY(!mTestObject->mDocmls.contains(INVALID_DOCML));
+}
+
+// ---------------------------------------------------------------------------
+// testLoadSection
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testLoadSection()
+{
+ HbDocumentLoader::cleanup();
+
+ // load section:
+ // -docml loaded
+ // -correct section once
+ bool ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mSections.contains(DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST));
+ cleanup();
+ init();
+
+ // load section:
+ // -docml loaded
+ // -two correct sections
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mSections.contains(DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST));
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mSections.contains(DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT));
+ cleanup();
+ init();
+
+ // load section:
+ // -docml loaded
+ // -same section twice
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, &ok);
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mSections.contains(DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST));
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, &ok);
+ int sectionCount = mTestObject->mSections.count();
+ QVERIFY(ok);
+ QVERIFY(mTestObject->mSections.contains(DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST));
+ QVERIFY(sectionCount == mTestObject->mSections.count());
+ cleanup();
+ init();
+
+ // load section:
+ // -docml not loaded
+ // -correct section once
+ ok = false;
+ HbDocumentLoader::mLoadFails = true;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, &ok);
+ QVERIFY(!ok);
+ QVERIFY(!mTestObject->mSections.contains(DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST));
+ cleanup();
+ init();
+}
+
+// ---------------------------------------------------------------------------
+// testLoadPhase
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testLoadPhase()
+{
+ HbDocumentLoader::cleanup();
+
+ // load phase:
+ // -add first phase items in queue
+ // -load first phase
+ VideoCollectionUiLoaderParam videoWidgetParam(
+ DOCML_NAME_VC_VIDEOLISTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam collectionWidgetParam(
+ DOCML_NAME_VC_COLLECTIONWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam collectionContentWidgetParam(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QList<VideoCollectionUiLoaderParam> params;
+ params.append(videoWidgetParam);
+ params.append(collectionWidgetParam);
+ params.append(collectionContentWidgetParam);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QTest::qWait(1000); // wait 1 second
+ QVERIFY(mTestObject->mPhases.contains(VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ QCOMPARE(mTestObject->mObjects.count(), 3);
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_VC_VIDEOLISTWIDGET));
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_VC_COLLECTIONWIDGET));
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET));
+ params.clear();
+ cleanup();
+ init();
+
+ // load phase:
+ // -add second phase items in queue
+ // -load first phase
+ // -load second phase
+ VideoCollectionUiLoaderParam addToCollectionParam(
+ DOCML_NAME_ADD_TO_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ VideoCollectionUiLoaderParam createCollectionParam(
+ DOCML_NAME_CREATE_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ VideoCollectionUiLoaderParam deleteMultipleParam(
+ DOCML_NAME_DELETE_MULTIPLE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ params.append(addToCollectionParam);
+ params.append(createCollectionParam);
+ params.append(deleteMultipleParam);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QTest::qWait(1000); // wait 1 second
+ QVERIFY(mTestObject->mPhases.contains(VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ QVERIFY(mTestObject->mObjects.count() == 0);
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ QTest::qWait(1000); // wait 1 second
+ QVERIFY(mTestObject->mPhases.contains(VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ QCOMPARE(mTestObject->mObjects.count(), 3);
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_CREATE_COLLECTION));
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_DELETE_MULTIPLE));
+ params.clear();
+ cleanup();
+ init();
+
+ // load phase:
+ // -add first phase items in queue
+ // -add second phase items in queue
+ // -load first phase
+ // -load second phase
+ params.append(videoWidgetParam);
+ params.append(addToCollectionParam);
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ QTest::qWait(1000); // wait 1 second
+ QVERIFY(mTestObject->mPhases.contains(VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ QVERIFY(mTestObject->mPhases.contains(VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ QCOMPARE(mTestObject->mObjects.count(), 2);
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_VC_VIDEOLISTWIDGET));
+ QVERIFY(mTestObject->mObjects.contains(DOCML_NAME_ADD_TO_COLLECTION));
+ params.clear();
+ cleanup();
+ init();
+}
+
+// ---------------------------------------------------------------------------
+// testLoadPhase_2
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testLoadPhase_2()
+{
+ // load phase:
+ // -add all items
+ // -load all items
+ QList<VideoCollectionUiLoaderParam> params;
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VIEW,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_HEADINGBANNER,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_COLLECTIONWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_VIDEOLISTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_VC_VIDEOHINTWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_OPTIONS_MENU,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_MENU,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_DATE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_NAME,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_SORT_BY_SIZE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_ADD_TO_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_CREATE_COLLECTION,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_DELETE_MULTIPLE,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ false,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_HINT_BUTTON,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_HINT_LABEL,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_NO_VIDEOS_LABEL,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_DIALOG,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_DLG_HEADINGLBL,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_CHECK_CONTAINER,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_MARKALL,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_LBL_SELECTION,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ params.append(VideoCollectionUiLoaderParam(
+ DOCML_NAME_LIST_CONTAINER,
+ DOCML_VIDEOSELECTIONDIALOG_FILE,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhaseSecondary));
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ QTest::qWait(5000); // 5 seconds
+ QCOMPARE(mObjects.count(), params.count());
+ QHash<QString, QObject*>::const_iterator i = mObjects.constBegin();
+ while (i != mObjects.constEnd())
+ {
+ bool found = false;
+ foreach (const VideoCollectionUiLoaderParam ¶m, params)
+ {
+ if (param == i.key())
+ {
+ found = true;
+ break;
+ }
+ }
+ QVERIFY(found);
+ i++;
+ }
+
+ // Getting proxymodel fails.
+ cleanup();
+ init();
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ VideoCollectionWrapperData::mGetModelFails = true;
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
+ QTest::qWait(5000); // 5 seconds
+ QCOMPARE(mObjects.count(), params.count());
+ i = mObjects.constBegin();
+ while (i != mObjects.constEnd())
+ {
+ bool found = false;
+ foreach (const VideoCollectionUiLoaderParam ¶m, params)
+ {
+ if (param == i.key())
+ {
+ found = true;
+ break;
+ }
+ }
+ QVERIFY(found);
+ i++;
+ }
+ params.clear();
+}
+
+// ---------------------------------------------------------------------------
+// testDelete
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testDelete()
+{
+ VideoCollectionWrapperData::reset();
+
+ // delete:
+ // -load docml
+ // -delete one "root" item
+ bool ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ QVERIFY(ok);
+ HbAction *addToCollection = mTestObject->findObject<HbAction>(DOCML_NAME_ADD_TO_COLLECTION);
+ HbAction *tempAction = addToCollection;
+ delete addToCollection;
+ QVERIFY(!mTestObject->mOrphans.contains(tempAction));
+ cleanup();
+ init();
+
+ // delete:
+ // -load docml
+ // -delete all items
+ ok = false;
+ mTestObject->load(DOCML_VIDEOCOLLECTIONVIEW_FILE, &ok);
+ foreach (QObject *object, mTestObject->mOrphans)
+ {
+ delete object;
+ }
+ QVERIFY(!mTestObject->mOrphans.count());
+ QVERIFY(ok);
+}
+
+// ---------------------------------------------------------------------------
+// testRemoveOrphanFromList
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testRemoveOrphanFromList()
+{
+ QObject *obj = 0;
+
+ // Nothing in the object lists.
+ cleanup();
+ init();
+ connect(this, SIGNAL(testSignal(QObject *)), mTestObject, SLOT(removeOrphanFromList(QObject *)));
+ emit testSignal(obj);
+ disconnect(this, SIGNAL(testSignal(QObject *)), mTestObject, SLOT(removeOrphanFromList(QObject *)));
+ QCOMPARE(mTestObject->mOrphans.count(), 0);
+ QCOMPARE(mTestObject->mObjects.count(), 0);
+
+ // Orphans and objects contain the object.
+ cleanup();
+ init();
+ connect(this, SIGNAL(testSignal(QObject *)), mTestObject, SLOT(removeOrphanFromList(QObject *)));
+ obj = new QObject();
+ mTestObject->mOrphans.append(obj);
+ mTestObject->mObjects.insert("test", obj);
+ emit testSignal(obj);
+ disconnect(this, SIGNAL(testSignal(QObject *)), mTestObject, SLOT(removeOrphanFromList(QObject *)));
+ QCOMPARE(mTestObject->mOrphans.count(), 0);
+ QCOMPARE(mTestObject->mObjects.count(), 0);
+ delete obj;
+
+ // Orphans contain the object, objects has different
+ cleanup();
+ init();
+ connect(this, SIGNAL(testSignal(QObject *)), mTestObject, SLOT(removeOrphanFromList(QObject *)));
+ obj = new QObject();
+ mTestObject->mOrphans.append(obj);
+ mTestObject->mObjects.insert("test", new QObject());
+ emit testSignal(obj);
+ disconnect(this, SIGNAL(testSignal(QObject *)), mTestObject, SLOT(removeOrphanFromList(QObject *)));
+ QCOMPARE(mTestObject->mOrphans.count(), 0);
+ QCOMPARE(mTestObject->mObjects.count(), 1);
+ delete obj;
+}
+
+// TEST CASES END -------------------------------------------------------------
+
+void TestVideoCollectionUiLoader::handleObjectReady(QObject *object, const QString &name)
+{
+ qDebug() << "Received object :" << name;
+
+ if (object)
+ {
+ if (name == DOCML_NAME_VIEW)
+ {
+ HbMainWindow *window = hbInstance->allMainWindows().at(0);
+ if (window)
+ {
+ HbView *view = qobject_cast<HbView*>(object);
+ if (view)
+ {
+ window->setCurrentView(view);
+ }
+ }
+ }
+ mObjects.insert(name, object);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testPrepareDocmlAndSection
+// ---------------------------------------------------------------------------
+//
+void TestVideoCollectionUiLoader::testPrepareDocmlAndSection()
+{
+ VideoCollectionUiLoaderParam banner(
+ DOCML_NAME_VC_HEADINGBANNER,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam collectionWidget(
+ DOCML_NAME_VC_COLLECTIONWIDGET,
+ DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ 0,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ VideoCollectionUiLoaderParam collectionContentWidget(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
+ 0,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
+ true,
+ VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ const int COUNT = 3;
+
+ // add items
+ QList<VideoCollectionUiLoaderParam> params;
+ params.append(banner);
+ params.append(collectionWidget);
+ params.append(collectionContentWidget);
+
+ cleanup();
+ init();
+ HbDocumentLoader::mFindWidgetFails = true;
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QTest::qWait(1000); // wait 1 second
+ QVERIFY(mTestObject->mQueue.count() == 0);
+ QVERIFY(!mTestObject->mQueue.contains(banner));
+ QVERIFY(!mTestObject->mQueue.contains(collectionWidget));
+ QVERIFY(!mTestObject->mQueue.contains(collectionContentWidget));
+ QCOMPARE(mTestObject->mQueue.count(), 0);
+
+ cleanup();
+ init();
+ HbDocumentLoader::mFindWidgetFails = true;
+ HbDocumentLoader::mLoadFails = true;
+ mTestObject->addData(params,
+ this,
+ SLOT(handleObjectReady(QObject*, const QString&)));
+ mTestObject->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
+ QTest::qWait(1000); // wait 1 second
+ QVERIFY(mTestObject->mQueue.count() == 0);
+ QVERIFY(!mTestObject->mQueue.contains(banner));
+ QVERIFY(!mTestObject->mQueue.contains(collectionWidget));
+ QVERIFY(!mTestObject->mQueue.contains(collectionContentWidget));
+ QCOMPARE(mTestObject->mQueue.count(), 0);
+}
+
+// end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionuiloader/testvideocollectionuiloader.pro Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,61 @@
+#
+# 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:
+#
+
+TEMPLATE = app
+
+TARGET =
+
+DEPENDPATH += . \
+ inc \
+ src \
+ ../../../tsrc/stubs
+
+INCLUDEPATH += . \
+ inc \
+ ../../../tsrc/stubs/inc \
+ \ # keep these at bottom so that stub headers are taken first
+ ../../../inc \
+ ../../../videocollectionview/inc \
+ ../../../videocollectionwrapper/inc \
+ ../../../../inc \
+ ../../../../videoplayerapp/inc \
+ ../../../../videoplayerapp/videoplayerengine/inc
+
+CONFIG += qtestlib \
+ hb
+
+LIBS += -lestor.dll \
+ -lfbscli.dll \
+ -lbitgdi.dll \
+ -lgdi.dll \
+ -lcentralrepository.dll \
+ -lxqservice.dll \
+ -lxqserviceutil.dll \
+ -lvideocollectionwrapper.dll \
+ -lvideoplayerengine.dll
+
+HEADERS += inc/testvideocollectionuiloader.h \
+ ../../../videocollectionview/inc/videocollectionuiloader.h \
+ ../../../videocollectionview/inc/videocollectionuiloaderdef.h
+
+SOURCES += src/testvideocollectionuiloader.cpp \
+ \ # sources needed in test
+ ../../../videocollectionview/src/videocollectionuiloader.cpp
+
+TESTEDCLASS = videocollectionuiloader
+include(../../../tsrc/stubs/stubs.pro)
+
+RESOURCES += ../../data/videocollectionview.qrc
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/inc/testvideocollectionviewutils.h Mon May 03 12:32:50 2010 +0300
@@ -46,9 +46,9 @@
void cleanup();
/**
- * verifies showErrorMsgSlot
+ * verifies showStatusMsgSlot
*/
- void testShowErrorMsgSlot();
+ void testShowStatusMsgSlot();
/**
* verifies saveSortingValues
@@ -69,6 +69,16 @@
* verifies getServiceUriString
*/
void testGetServiceUriString();
+
+ /**
+ * Verifies initListView
+ */
+ void testInitListView();
+
+ /**
+ * verifies sortModel
+ */
+ void testSortModel();
};
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/src/testvideocollectionviewutils.cpp Mon May 03 12:32:50 2010 +0300
@@ -20,14 +20,24 @@
#include "testvideocollectionviewutils.h"
#include "hblabel.h"
#include "hbaction.h"
+#include "videocollectionwrapper.h"
+#include "videosortfilterproxymodeldata.h"
#include "videocollectioncommon.h"
#include "centralrepository.h"
#include "hbmessageboxdata.h"
+#include "hbnotificationdialog.h"
+#include "hblistview.h"
#define private public
#include "videocollectionviewutils.h"
#undef private
+// following consts are copied from videocollectionviewutils.cpp
+const int KVideoSortingRoleKey(0x5);
+const int KVideoSortingOrderKey(0x6);
+const int KCollectionsSortingRoleKey(0x7);
+const int KCollectionsSortingOrderKey(0x8);
+
// ---------------------------------------------------------------------------
// main
// ---------------------------------------------------------------------------
@@ -74,88 +84,162 @@
}
// ---------------------------------------------------------------------------
-// testShowErrorMsgSlot
+// testShowStatusMsgSlot
// ---------------------------------------------------------------------------
//
-void TestVideoVideoCollectionViewUtils::testShowErrorMsgSlot()
+void TestVideoVideoCollectionViewUtils::testShowStatusMsgSlot()
{
VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
QVariant additional;
QString txt = "__test__";
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
+ HbNotificationDialog::mNotifDialogTitle = "";
+ HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
+ HbNotificationDialog::mAttribute = Qt::WA_Disabled;
+
// status: VideoCollectionCommon::statusSingleDeleteFail
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
HbMessageBoxData::mWarningCallCount = 0;
HbMessageBoxData::mInformationCallCount = 0;
+
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleDeleteFail, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
// status: VideoCollectionCommon::statusMultipleDeleteFail
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
-
- // - invalid additional
+
+ // - invalid additional (no change, since additional not excepted)
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultipleDeleteFail, additional);
+ QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
// status: VideoCollectionCommon::statusMultipleRemoveFail (additional not needed)
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
// status: VideoCollectionCommon::statusVideosAddedToCollection
+ // notification dialog shown
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose);
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
+ HbNotificationDialog::mNotifDialogTitle = "";
+ HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
+ HbNotificationDialog::mAttribute = Qt::WA_Disabled;
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusVideosAddedToCollection, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
// status: VideoCollectionCommon::statusAllVideosAlreadyInCollection
testObject.showStatusMsgSlot(VideoCollectionCommon::statusAllVideosAlreadyInCollection, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
// status: VideoCollectionCommon::statusDeleteInProgress
additional = txt;
testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() > 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextWordWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_DeleteOnClose);
HbMessageBoxData::mWarningCallCount = 0;
- HbMessageBoxData::mInformationCallCount = 0;
+ HbNotificationDialog::mNotifDialogTitle = "";
+ HbNotificationDialog::mTitleTextWRapping = Hb::TextNoWrap;
+ HbNotificationDialog::mAttribute = Qt::WA_Disabled;
// - invalid additional
additional = QVariant();
testObject.showStatusMsgSlot(VideoCollectionCommon::statusDeleteInProgress, additional);
QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
- QVERIFY(HbMessageBoxData::mInformationCallCount == 0);
-}
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+
+ // status: VideoCollectionCommon::statusSingleRemoveFail
+ additional = txt;
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional);
+ QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+ HbMessageBoxData::mWarningCallCount = 0;
+
+ // - invalid additional
+ additional = QVariant();
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusSingleRemoveFail, additional);
+ QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+
+ // status: statusMultiRemoveFail
+ additional = txt;
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
+ QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+ HbMessageBoxData::mWarningCallCount = 0;
+
+ // invalid additional (no change, since additional not excepted)
+ additional = QVariant();
+ testObject.showStatusMsgSlot(VideoCollectionCommon::statusMultiRemoveFail, additional);
+ QVERIFY(HbMessageBoxData::mWarningCallCount == 1);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+ HbMessageBoxData::mWarningCallCount = 0;
+
+
+ // invalid state
+ additional = txt;
+ testObject.showStatusMsgSlot(0, additional);
+ QVERIFY(HbMessageBoxData::mWarningCallCount == 0);
+ QVERIFY(HbNotificationDialog::mNotifDialogTitle.count() == 0);
+ QVERIFY(HbNotificationDialog::mTitleTextWRapping == Hb::TextNoWrap);
+ QVERIFY(HbNotificationDialog::mAttribute == Qt::WA_Disabled);
+ HbMessageBoxData::mWarningCallCount = 0;
+
+}
+
// -----------------------------------------------------------------------------
// testSaveSortingValues
@@ -167,20 +251,53 @@
CRepository::setNewLLeave(true);
int sortRole = VideoCollectionCommon::KeyDateTime;
Qt::SortOrder sortOrder = Qt::AscendingOrder;
+ VideoCollectionCommon::TCollectionLevels target = VideoCollectionCommon::ELevelInvalid;
+ CRepository::mSortValues.clear();
- QVERIFY(testObject.saveSortingValues(sortRole, sortOrder) < 0);
+ // target invalid
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) < 0);
+
+ // target == VideoCollectionCommon::ELevelCategory
+ target = VideoCollectionCommon::ELevelCategory;
+
+ // cenrep creation fails
+ CRepository::setNewLLeave(true);
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) < 0);
+ QCOMPARE(CRepository::mSortValues.count(), 0);
+
+ // set fails
CRepository::setNewLLeave(false);
-
CRepository::setSetFail(0);
- QVERIFY(testObject.saveSortingValues(sortRole, sortOrder) < 0);
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) < 0);
+ QCOMPARE(CRepository::mSortValues.count(), 0);
+ CRepository::setSetFail(2);
- CRepository::setSetFail(1);
- QVERIFY(testObject.saveSortingValues(sortRole, sortOrder) < 0);
+ // succeed
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) == 0);
+ QCOMPARE(CRepository::mSortValues.count(), 2);
+ QVERIFY(CRepository::mSortValues.values().contains(sortRole));
+ QVERIFY(CRepository::mSortValues.values().contains(sortOrder));
+
+ // target != VideoCollectionCommon::ELevelCategory
+ CRepository::mSortValues.clear();
+ target = VideoCollectionCommon::ELevelVideos;
- CRepository::setSetFail(255);
- QVERIFY(testObject.saveSortingValues(sortRole, sortOrder) == 0);
- QCOMPARE(CRepository::getRoleValue(), sortRole);
- QCOMPARE(CRepository::getOrderValue(), (int)sortOrder);
+ // cenrep creation fails
+ CRepository::setNewLLeave(true);
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) < 0);
+ QCOMPARE(CRepository::mSortValues.count(), 0);
+
+ // set fails
+ CRepository::setNewLLeave(false);
+ CRepository::setSetFail(0);
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) < 0);
+ QCOMPARE(CRepository::mSortValues.count(), 0);
+ CRepository::setSetFail(2);
+ // succeed
+ QVERIFY(testObject.saveSortingValues(sortRole, sortOrder, target) == 0);
+ QCOMPARE(CRepository::mSortValues.count(), 2);
+ QVERIFY(CRepository::mSortValues.values().contains(sortRole));
+ QVERIFY(CRepository::mSortValues.values().contains(sortOrder));
}
// -----------------------------------------------------------------------------
@@ -188,43 +305,146 @@
// -----------------------------------------------------------------------------
//
void TestVideoVideoCollectionViewUtils::testLoadSortingValues()
-{
+{
+ CRepository::mSortValues[KVideoSortingRoleKey] = VideoCollectionCommon::KeyDateTime;
+ CRepository::mSortValues[KVideoSortingOrderKey] = Qt::DescendingOrder;
+ CRepository::mSortValues[KCollectionsSortingRoleKey] = VideoCollectionCommon::KeyTitle;
+ CRepository::mSortValues[KCollectionsSortingOrderKey] = Qt::DescendingOrder;
+
VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
int sortRole(-1);
- Qt::SortOrder sortOrder(Qt::AscendingOrder);
+ Qt::SortOrder sortOrder(Qt::AscendingOrder);
+ VideoCollectionCommon::TCollectionLevels target = VideoCollectionCommon::ELevelInvalid;
+
+ testObject.mVideosSortRole = -1;
+ testObject.mVideosSortOrder = Qt::AscendingOrder;
+ testObject.mCollectionsSortRole = -1;
+ testObject.mCollectionsSortOrder = Qt::AscendingOrder;
- CRepository::setRoleValue(Qt::DisplayRole);
- CRepository::setOrderValue(Qt::AscendingOrder);
+ // target is invalid
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) == 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == -1);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::AscendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
+ // target is VideoCollectionCommon::ELevelCategory
+ target = VideoCollectionCommon::ELevelCategory;
+
+ // cerep creation fails
CRepository::setNewLLeave(true);
- testObject.mSortRole = -1;
- testObject.mSortOrder = Qt::DescendingOrder;
- QVERIFY(testObject.loadSortingValues(sortRole, sortOrder) < 0);
- QCOMPARE(sortRole, -1);
- QCOMPARE(sortOrder, Qt::DescendingOrder);
-
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) < 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == -1);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::AscendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
CRepository::setNewLLeave(false);
+
+ // getting from cenrep fails from first
CRepository::setGetFail(0);
- testObject.mSortRole = -1;
- testObject.mSortOrder = Qt::DescendingOrder;
- QVERIFY(testObject.loadSortingValues(sortRole, sortOrder) < 0);
- QCOMPARE(sortRole, -1);
- QCOMPARE(sortOrder, Qt::DescendingOrder);
-
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) < 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == -1);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::AscendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
+
+ // getiing from cenrep fails from the second
CRepository::setGetFail(1);
- testObject.mSortRole = -1;
- testObject.mSortOrder = Qt::DescendingOrder;
- QVERIFY(testObject.loadSortingValues(sortRole, sortOrder) < 0);
- QCOMPARE(sortRole, (int)Qt::DisplayRole);
- QCOMPARE(sortOrder, Qt::DescendingOrder);
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) < 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == -1);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::AscendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
+ CRepository::setGetFail(2);
+
+ // succeeds
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) == 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(sortOrder == Qt::DescendingOrder);
+ sortRole = -1;
+ sortOrder = Qt::AscendingOrder;
+
+ // another call used previously saved values
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) == 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(sortOrder == Qt::DescendingOrder);
+ sortRole = -1;
+ sortOrder = Qt::AscendingOrder;
+
+ // target is different than VideoCollectionCommon::ELevelCategory
+ target = VideoCollectionCommon::ELevelVideos;
- CRepository::setGetFail(255);
- testObject.mSortRole = -1;
- testObject.mSortOrder = Qt::DescendingOrder;
- QVERIFY(testObject.loadSortingValues(sortRole, sortOrder) == 0);
- QCOMPARE(sortRole, (int)Qt::DisplayRole);
- QCOMPARE(sortOrder, Qt::AscendingOrder);
+ // cerep creation fails
+ CRepository::setNewLLeave(true);
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) < 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
+ CRepository::setNewLLeave(false);
+
+ CRepository::setGetFail(0);
+ // getting from cenrep fails from first
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) < 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
+
+ CRepository::setGetFail(1);
+ // getting from cenrep fails from second
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) < 0);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == -1);
+ QVERIFY(sortOrder == Qt::AscendingOrder);
+
+ CRepository::setGetFail(2);
+
+ // succeeds
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) == 0);
+ QVERIFY(testObject.mVideosSortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(testObject.mVideosSortOrder == Qt::DescendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(sortOrder == Qt::DescendingOrder);
+
+ sortRole = -1;
+ sortOrder = Qt::AscendingOrder;
+
+ // another call used previously saved values
+ QVERIFY(testObject.loadSortingValues(sortRole, sortOrder, target) == 0);
+ QVERIFY(testObject.mVideosSortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(testObject.mVideosSortOrder == Qt::DescendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+ QVERIFY(sortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(sortOrder == Qt::DescendingOrder);
+
}
// -----------------------------------------------------------------------------
@@ -268,7 +488,7 @@
//
void TestVideoVideoCollectionViewUtils::testGetServiceUriString()
{
- VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
+ VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
CRepository::setNewLLeave(true);
_LIT(KExpectedTDesValue, "expected");
CRepository::setTDesValue(KExpectedTDesValue());
@@ -284,6 +504,138 @@
QCOMPARE(testObject.getServiceUriString(), expected);
}
+// -----------------------------------------------------------------------------
+// testInitListView
+// -----------------------------------------------------------------------------
+//
+void TestVideoVideoCollectionViewUtils::testInitListView()
+{
+ // empty view
+ VideoCollectionViewUtils::initListView(0);
+ QVERIFY(HbListView::mLatestrecycling == false);
+ QVERIFY(HbListView::mLatestClamping == HbScrollArea::InvalidClamping);
+ QVERIFY(HbListView::mLatestScrolling == HbScrollArea::InvalidScrolling);
+ QVERIFY(HbListView::mLatestFrictionEnabled == false);
+ QVERIFY(HbListView::mLatestUniformItemSizes == false);
+ QVERIFY(HbListView::mSelectionMode == HbAbstractItemView::InvalidSelection);
+
+ HbListView view;
+ VideoCollectionViewUtils::initListView(&view);
+ QVERIFY(HbListView::mLatestrecycling == true);
+ QVERIFY(HbListView::mLatestClamping == HbScrollArea::BounceBackClamping);
+ QVERIFY(HbListView::mLatestScrolling == HbScrollArea::PanWithFollowOn);
+ QVERIFY(HbListView::mLatestFrictionEnabled == true);
+ QVERIFY(HbListView::mLatestUniformItemSizes == true);
+ QVERIFY(HbListView::mSelectionMode == HbAbstractItemView::NoSelection);
+
+ HbListView::mLatestrecycling = false;
+ HbListView::mLatestClamping = HbScrollArea::InvalidClamping;
+ HbListView::mLatestScrolling = HbScrollArea::InvalidScrolling;
+ HbListView::mLatestFrictionEnabled = false;
+ HbListView::mLatestUniformItemSizes = false;
+ HbListView::mSelectionMode = HbAbstractItemView::InvalidSelection;
+
+ // no prototype from view (for coverity)
+ HbListView::mReturnNullPrototype = true;
+ VideoCollectionViewUtils::initListView(&view);
+ QVERIFY(HbListView::mLatestrecycling == true);
+ QVERIFY(HbListView::mLatestClamping == HbScrollArea::BounceBackClamping);
+ QVERIFY(HbListView::mLatestScrolling == HbScrollArea::PanWithFollowOn);
+ QVERIFY(HbListView::mLatestFrictionEnabled == true);
+ QVERIFY(HbListView::mLatestUniformItemSizes == true);
+ QVERIFY(HbListView::mSelectionMode == HbAbstractItemView::NoSelection);
+
+ HbListView::mLatestrecycling = false;
+ HbListView::mLatestClamping = HbScrollArea::InvalidClamping;
+ HbListView::mLatestScrolling = HbScrollArea::InvalidScrolling;
+ HbListView::mLatestFrictionEnabled = false;
+ HbListView::mLatestUniformItemSizes = false;
+ HbListView::mSelectionMode = HbAbstractItemView::InvalidSelection;
+ HbListView::mReturnNullPrototype = false;
+
+ // no vertical scrollbar from view (for coverity)
+ HbListView::mVScrollBarIsNull = true;
+ VideoCollectionViewUtils::initListView(&view);
+ QVERIFY(HbListView::mLatestrecycling == true);
+ QVERIFY(HbListView::mLatestClamping == HbScrollArea::BounceBackClamping);
+ QVERIFY(HbListView::mLatestScrolling == HbScrollArea::PanWithFollowOn);
+ QVERIFY(HbListView::mLatestFrictionEnabled == true);
+ QVERIFY(HbListView::mLatestUniformItemSizes == true);
+ QVERIFY(HbListView::mSelectionMode == HbAbstractItemView::NoSelection);
+
+}
+
+void TestVideoVideoCollectionViewUtils::testSortModel()
+{
+ VideoCollectionViewUtils &testObject(VideoCollectionViewUtils::instance());
+ testObject.mVideosSortRole = -1;
+ testObject.mVideosSortOrder = Qt::AscendingOrder;
+ testObject.mCollectionsSortRole = -1;
+ testObject.mCollectionsSortOrder = Qt::AscendingOrder;
+
+ CRepository::mSortValues[KVideoSortingRoleKey] = VideoCollectionCommon::KeyDateTime;
+ CRepository::mSortValues[KVideoSortingOrderKey] = Qt::DescendingOrder;
+ CRepository::mSortValues[KCollectionsSortingRoleKey] = VideoCollectionCommon::KeyTitle;
+ CRepository::mSortValues[KCollectionsSortingOrderKey] = Qt::DescendingOrder;
+
+ VideoCollectionCommon::TCollectionLevels target = VideoCollectionCommon::ELevelInvalid;
+
+ // null model
+ VideoCollectionViewUtils::sortModel(0, false, target);
+
+ VideoSortFilterProxyModel *model =
+ VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeGeneric);
+
+ // target == invalid -> default values used as sort -call
+ VideoCollectionViewUtils::sortModel(model, false, target);
+
+ QVERIFY(VideoSortFilterProxyModelData::mDoSortingCallCount == 1);
+ QVERIFY(VideoSortFilterProxyModelData::mSortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(VideoSortFilterProxyModelData::mSortOrder == Qt::AscendingOrder);
+ QVERIFY(VideoSortFilterProxyModelData::mSortAsync == false);
+ QVERIFY(testObject.mVideosSortRole == -1);
+ QVERIFY(testObject.mVideosSortOrder == Qt::AscendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == -1);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::AscendingOrder);
+
+ VideoSortFilterProxyModelData::mDoSortingCallCount = 0;
+ VideoSortFilterProxyModelData::mSortRole = -1;
+ VideoSortFilterProxyModelData::mSortOrder = Qt::AscendingOrder;
+ VideoSortFilterProxyModelData::mSortAsync = true;
+
+ // target == VideoCollectionCommon::ELevelVideos
+ target = VideoCollectionCommon::ELevelVideos;
+ VideoCollectionViewUtils::sortModel(model, false, target);
+
+ QVERIFY(VideoSortFilterProxyModelData::mDoSortingCallCount == 1);
+ QVERIFY(VideoSortFilterProxyModelData::mSortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(VideoSortFilterProxyModelData::mSortOrder == Qt::DescendingOrder);
+ QVERIFY(VideoSortFilterProxyModelData::mSortAsync == false);
+ QVERIFY(testObject.mVideosSortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(testObject.mVideosSortOrder == Qt::DescendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == -1);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::AscendingOrder);
+
+
+ VideoSortFilterProxyModelData::mDoSortingCallCount = 0;
+ VideoSortFilterProxyModelData::mSortRole = -1;
+ VideoSortFilterProxyModelData::mSortOrder = Qt::AscendingOrder;
+ VideoSortFilterProxyModelData::mSortAsync = true;
+
+ // target == VideoCollectionCommon::ELevelCategory
+ target = VideoCollectionCommon::ELevelCategory;
+ VideoCollectionViewUtils::sortModel(model, false, target);
+
+ QVERIFY(VideoSortFilterProxyModelData::mDoSortingCallCount == 1);
+ QVERIFY(VideoSortFilterProxyModelData::mSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(VideoSortFilterProxyModelData::mSortOrder == Qt::DescendingOrder);
+ QVERIFY(VideoSortFilterProxyModelData::mSortAsync == false);
+ QVERIFY(testObject.mVideosSortRole == VideoCollectionCommon::KeyDateTime);
+ QVERIFY(testObject.mVideosSortOrder == Qt::DescendingOrder);
+ QVERIFY(testObject.mCollectionsSortRole == VideoCollectionCommon::KeyTitle);
+ QVERIFY(testObject.mCollectionsSortOrder == Qt::DescendingOrder);
+}
+
// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/stubs/inc/centralrepository.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub central repository -class for testing CVideoCollectionClient
+*
+*/
+
+#ifndef __CENTRALREPOSITORY_H__
+#define __CENTRALREPOSITORY_H__
+
+#include <e32base.h>
+#include <qmap.h>
+
+class CRepository
+{
+public:
+
+ /**
+ * sets gCRNewLLeave
+ */
+ static void setNewLLeave(bool leave);
+
+ /**
+ * sets gCRSetFail
+ */
+ static void setSetFail(int amount);
+
+ /**
+ * sets gCRGetFail
+ */
+ static void setGetFail(int amount);
+
+ /**
+ * gets gSettedTDesValue;
+ */
+ static TDesC& getTDesValue();
+
+ /**
+ * sets gSettedTDesValue;
+ */
+ static void setTDesValue(const TDesC& value);
+
+
+ static QMap<uint, int> mSortValues;
+
+ /**
+ * if gCRNewLLeave is true, will leave
+ * if gCRNewLLeave is false returns new CRepository
+ */
+ static CRepository* NewL(TUid aRepositoryUid);
+
+ /**
+ * contructor
+ */
+ CRepository();
+
+ /**
+ * destructor
+ */
+ virtual ~CRepository();
+
+ /**
+ * if gCRGetFail is true, returns KErrGeneral
+ * if gCRGetFail is false, returns gSettedValue and returns KErrNone
+ */
+ TInt Get(TUint32 aKey, TInt& aValue);
+
+ /**
+ * if gCRSetFail is true, returns KErrGeneral
+ * if gCRSetFail is false, saves value to gSettedValue and returns KErrNone
+ */
+ TInt Set(TUint32 aKey, TInt aValue);
+
+ /**
+ * if gCRGetFail is true, returns KErrGeneral
+ * if gCRGetFail is false, returns gSettedValue and returns KErrNone
+ */
+ TInt Get(TUint32 aKey, TDes& aValue);
+
+
+};
+
+#endif // __CENTRALREPOSITORY_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/stubs/src/centralrepository.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub central repository -class for testing CVideoCollectionClient
+*
+*/
+
+
+#include "centralrepository.h"
+
+const int KVideoCollectionViewCenrepSortingRoleKey(0x5);
+const int KVideoCollectionViewCenrepSortingOrderKey(0x6);
+
+/**
+ * if true, Newl will leave
+ */
+bool gCRNewLLeave = false;
+
+/**
+ * if zero, Set will fail. Every Set call decreases this value by one.
+ */
+int gCRSetFail = 255;
+
+/**
+ * if zero, Get will fail. Every Get call decreases this value by one.
+ */
+int gCRGetFail = 255;
+
+/**
+ * order value will be saved here in correct cases
+ */
+TBuf<255> gSettedTDesValue = TBuf<255>();
+
+
+QMap<uint, int> CRepository::mSortValues = QMap<uint, int>();
+
+
+// -----------------------------------------------------------------------------
+// setNewLLeave
+// -----------------------------------------------------------------------------
+//
+void CRepository::setNewLLeave(bool leave)
+{
+ gCRNewLLeave = leave;
+}
+
+// -----------------------------------------------------------------------------
+// setSetFail
+// -----------------------------------------------------------------------------
+//
+void CRepository::setSetFail(int amount)
+{
+ gCRSetFail = amount;
+}
+
+// -----------------------------------------------------------------------------
+// setGetFail
+// -----------------------------------------------------------------------------
+//
+void CRepository::setGetFail(int amount)
+{
+ gCRGetFail = amount;
+}
+
+// -----------------------------------------------------------------------------
+// getTDesValue
+// -----------------------------------------------------------------------------
+//
+TDesC& CRepository::getTDesValue()
+{
+ return gSettedTDesValue;
+}
+
+// -----------------------------------------------------------------------------
+// setOrderValue
+// -----------------------------------------------------------------------------
+//
+void CRepository::setTDesValue(const TDesC& value)
+{
+ gSettedTDesValue = value;
+}
+
+// -----------------------------------------------------------------------------
+// NewL
+// -----------------------------------------------------------------------------
+//
+CRepository* CRepository::NewL(TUid /*aRepositoryUid*/)
+{
+ if(gCRNewLLeave)
+ {
+ User::Leave(KErrGeneral);
+ }
+ return new CRepository();
+}
+
+// -----------------------------------------------------------------------------
+// CRepository
+// -----------------------------------------------------------------------------
+//
+CRepository::CRepository()
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// ~CRepository
+// -----------------------------------------------------------------------------
+//
+CRepository::~CRepository()
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get(TUint32 aKey, TInt& aValue)
+{
+ if(gCRGetFail == 0)
+ {
+ return KErrGeneral;
+ } else {
+ gCRGetFail--;
+ }
+
+ aValue = mSortValues.value(aKey);
+
+ return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// Set
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Set(TUint32 aKey, TInt aValue)
+{
+ if(gCRSetFail == 0)
+ {
+ return KErrGeneral;
+ } else {
+ gCRSetFail--;
+ }
+
+ mSortValues[aKey] = aValue;
+
+ return KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// Get
+// -----------------------------------------------------------------------------
+//
+TInt CRepository::Get(TUint32 /*aKey*/, TDes& aValue)
+{
+ if(gCRGetFail == 0)
+ {
+ return KErrGeneral;
+ } else {
+ gCRGetFail--;
+ }
+
+ aValue = gSettedTDesValue;
+
+ return KErrNone;
+}
--- a/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideocollectionviewutils/testvideocollectionviewutils.pro Mon May 03 12:32:50 2010 +0300
@@ -21,19 +21,21 @@
DEPENDPATH += . \
inc \
src \
+ stubs \
../../../tsrc/stubs
INCLUDEPATH = . \
inc \
+ stubs/inc \
../../../tsrc/stubs/inc \
\ # keep these at bottom so that stubbed headers are taken first
../../../inc \
+ ../../../../inc \
../../../videocollectionview/inc \
../../../videocollectionwrapper/inc
CONFIG += qtestlib \
- Hb \
- symbian_test
+ Hb
LIBS += -lestor.dll \
-lfbscli.dll \
@@ -42,10 +44,12 @@
# Input
HEADERS += inc/testvideocollectionviewutils.h \
+ stubs/inc/centralrepository.h \
\ # headers needed in test
../../inc/videocollectionviewutils.h
SOURCES += src/testvideocollectionviewutils.cpp \
+ stubs/src/centralrepository.cpp \
\ # sources needed in test
../../src/videocollectionviewutils.cpp
--- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/inc/testvideolistselectiondialog.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/inc/testvideolistselectiondialog.h Mon May 03 12:32:50 2010 +0300
@@ -21,6 +21,8 @@
// INCLUDES
#include <QtTest/QtTest>
+#include <videocollectioncommon.h>
+
class VideoListSelectionDialog;
class VideoCollectionUiLoader;
class VideoListDataModel;
@@ -34,7 +36,7 @@
private:
- void setRowCount(int count, int type = 0, VideoListDataModel *model = 0);
+ void setRowCount(int count, VideoCollectionCommon::TModelType type = VideoCollectionCommon::EModelTypeAllVideos, VideoListDataModel *model = 0);
// test functions for the test framework
--- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/src/testvideolistselectiondialog.cpp Mon May 03 12:32:50 2010 +0300
@@ -89,7 +89,7 @@
// setRowCount
// ---------------------------------------------------------------------------
//
-void TestVideoListSelectionDialog::setRowCount(int count, int type, VideoListDataModel *model)
+void TestVideoListSelectionDialog::setRowCount(int count, VideoCollectionCommon::TModelType type, VideoListDataModel *model)
{
if (!model)
{
@@ -141,7 +141,7 @@
mTestUiLoader = new VideoCollectionUiLoader();
mTestObject = new VideoListSelectionDialog(mTestUiLoader);
- mModel = VideoCollectionWrapper::instance().getModel(VideoCollectionWrapper::EGeneric);
+ mModel = VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeGeneric);
mTestHelper->mTestable = mTestObject;
QVERIFY(mTestHelper->connectSignals());
@@ -240,8 +240,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -262,8 +262,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -288,8 +288,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == false);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(!VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -314,8 +314,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(!VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -340,8 +340,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -366,8 +366,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -391,8 +391,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -416,8 +416,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
@@ -441,8 +441,8 @@
QVERIFY(mTestObject->mCheckboxContainer->isVisible() == true);
QVERIFY(mTestObject->mItemCount != 0);
QVERIFY(mTestObject->mCheckBox != 0);
- QVERIFY(mTestObject->primaryAction() != 0);
- QVERIFY(mTestObject->secondaryAction() != 0);
+ QVERIFY(mTestObject->mPrimaryAction != 0);
+ QVERIFY(mTestObject->mSecondaryAction != 0);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterId == mpxId);
QVERIFY(VideoSortFilterProxyModelData::mGenericFilterValue);
}
@@ -821,20 +821,20 @@
setRowCount(10);
// select item
- mTestObject->primaryAction()->mDisable = true;
+ mTestObject->mPrimaryAction->setEnabled(false);
QModelIndex index = mModel->index(0, 0);
QItemSelectionRange range(mModel->index(0, 0));
selected.append(range);
mTestHelper->emitSelectionChangedSlot(selected, deselected);
QVERIFY(mTestObject->mSelection.count() == 1);
- QVERIFY(mTestObject->primaryAction()->mDisable == false);
+ QVERIFY(mTestObject->mPrimaryAction->isEnabled() == true);
// deselect item
selected.clear();
deselected.append(range);
mTestHelper->emitSelectionChangedSlot(selected, deselected);
QVERIFY(mTestObject->mSelection.count() == 0);
- QVERIFY(mTestObject->primaryAction()->mDisable == true);
+ QVERIFY(mTestObject->mPrimaryAction->isEnabled() == false);
mTestHelper->disconnectSignals();
@@ -869,23 +869,23 @@
mTestHelper->connectSignals();
mTestObject->setupContent(VideoListSelectionDialog::EDeleteVideos, TMPXItemId(1,2));
- mTestObject->primaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
// type of selection != ESelectCollection
mTestHelper->emitModelReadySlot();
- QVERIFY(mTestObject->primaryAction()->mTriggeredCount == 0);
+ QVERIFY(mTestObject->mPrimaryAction->mTriggeredCount == 0);
mTestObject->setupContent(VideoListSelectionDialog::ESelectCollection, TMPXItemId(1,2));
// no items in model
setRowCount(0);
mTestHelper->emitModelReadySlot();
- QVERIFY(mTestObject->primaryAction()->mTriggeredCount == 1);
+ QVERIFY(mTestObject->mPrimaryAction->mTriggeredCount == 1);
- mTestObject->primaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
setRowCount(10);
// type of selection is ESelectCollection and there are items in model
mTestHelper->emitModelReadySlot();
- QVERIFY(mTestObject->primaryAction()->mTriggeredCount == 0);
+ QVERIFY(mTestObject->mPrimaryAction->mTriggeredCount == 0);
mTestHelper->disconnectSignals();
}
@@ -945,52 +945,52 @@
mTestObject->setupContent(VideoListSelectionDialog::EDeleteVideos, mpxId);
// nothing selected, album id invalid, selection type != EAddToCollection
- mTestObject->primaryAction()->mTriggeredCount = 0;
- mTestObject->secondaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
mTestObject->mTypeOfSelection = VideoListSelectionDialog::EDeleteVideos;
mTestHelper->emitPrimaryActionTriggeredSlot();
- QCOMPARE(mTestObject->primaryAction()->mTriggeredCount, 0);
- QCOMPARE(mTestObject->secondaryAction()->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
// nothing selected, album id invalid, selection type EAddToCollection
mTestObject->mSelectedAlbumId = TMPXItemId::InvalidId();
- mTestObject->primaryAction()->mTriggeredCount = 0;
- mTestObject->secondaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
mTestObject->mTypeOfSelection = VideoListSelectionDialog::EAddToCollection;
mTestHelper->emitPrimaryActionTriggeredSlot();
- QCOMPARE(mTestObject->primaryAction()->mTriggeredCount, 0);
- QCOMPARE(mTestObject->secondaryAction()->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
// nothing selected, album id invalid, selection type ESelectCollection
mTestObject->mSelectedAlbumId = TMPXItemId::InvalidId();
- mTestObject->primaryAction()->mTriggeredCount = 0;
- mTestObject->secondaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
mTestObject->mTypeOfSelection = VideoListSelectionDialog::ESelectCollection;
mTestHelper->emitPrimaryActionTriggeredSlot();
- QCOMPARE(mTestObject->primaryAction()->mTriggeredCount, 0);
- QCOMPARE(mTestObject->secondaryAction()->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
// nothing selected, album id invalid, selection type invalid
mTestObject->mSelectedAlbumId = TMPXItemId::InvalidId();
- mTestObject->primaryAction()->mTriggeredCount = 0;
- mTestObject->secondaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
mTestObject->mTypeOfSelection = 555;
mTestHelper->emitPrimaryActionTriggeredSlot();
- QCOMPARE(mTestObject->primaryAction()->mTriggeredCount, 0);
- QCOMPARE(mTestObject->secondaryAction()->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
// nothing selected, album id ok
mTestObject->mSelectedAlbumId = TMPXItemId(0, KVcxMvcMediaTypeAlbum);
- mTestObject->primaryAction()->mTriggeredCount = 0;
- mTestObject->secondaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
mTestObject->mTypeOfSelection = VideoListSelectionDialog::ESelectCollection;
mTestHelper->emitPrimaryActionTriggeredSlot();
- QCOMPARE(mTestObject->primaryAction()->mTriggeredCount, 1);
- QCOMPARE(mTestObject->secondaryAction()->mTriggeredCount, 0);
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 1);
+ QCOMPARE(mTestObject->mSecondaryAction->mTriggeredCount, 0);
QCOMPARE(mTestObject->mSelectedVideos.count(), 0);
setRowCount(10);
@@ -1002,12 +1002,12 @@
QItemSelectionRange range(mTestObject->mModel->index(0, 0), mTestObject->mModel->index(1, 0));
selected.append(range);
mTestObject->mSelection.merge(selected, QItemSelectionModel::Select);
- mTestObject->primaryAction()->mTriggeredCount = 0;
- mTestObject->secondaryAction()->mTriggeredCount = 0;
+ mTestObject->mPrimaryAction->mTriggeredCount = 0;
+ mTestObject->mSecondaryAction->mTriggeredCount = 0;
mTestObject->mTypeOfSelection = VideoListSelectionDialog::EAddToCollection;
mTestObject->mSelectedVideos.clear();
mTestHelper->emitPrimaryActionTriggeredSlot();
- QCOMPARE(mTestObject->primaryAction()->mTriggeredCount, 1);
+ QCOMPARE(mTestObject->mPrimaryAction->mTriggeredCount, 1);
QCOMPARE(mTestObject->mSelectedVideos.count(), 1);
mTestHelper->disconnectSignals();
@@ -1026,20 +1026,20 @@
VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant();
// mSelectedAlbumId is video
mTestObject->mSelectedAlbumId = TMPXItemId(1,0);
- mTestHelper->emitFinishedSlot(mTestObject->primaryAction());
+ mTestHelper->emitFinishedSlot(mTestObject->mPrimaryAction);
QVERIFY(VideoCollectionViewUtilsData::mLastStatusAdditional.isValid());
QVERIFY(!VideoCollectionViewUtilsData::mLastStatusAdditional.toString().length());
mTestObject->mSelectedAlbumId = TMPXItemId(1,2);
// fetching collections model unsucceeds
VideoCollectionWrapperData::mGetModelFails = true;
- mTestHelper->emitFinishedSlot(mTestObject->primaryAction());
+ mTestHelper->emitFinishedSlot(mTestObject->mPrimaryAction);
QVERIFY(VideoCollectionViewUtilsData::mLastStatusAdditional.isValid());
QVERIFY(!VideoCollectionViewUtilsData::mLastStatusAdditional.toString().length());
VideoCollectionWrapperData::mGetModelFails = false;
// invalid index for selected album
- mTestHelper->emitFinishedSlot(mTestObject->primaryAction());
+ mTestHelper->emitFinishedSlot(mTestObject->mPrimaryAction);
QVERIFY(VideoCollectionViewUtilsData::mLastStatusAdditional.isValid());
QVERIFY(!VideoCollectionViewUtilsData::mLastStatusAdditional.toString().length());
@@ -1047,11 +1047,10 @@
// need to add album ib into selected list, because stub proxy overwrites
// VideoSortFilterProxyModelData::mItemIds at removeitems removeItemsFromAlbum -method
// and we need valid index for id
- QStringList testnameList;
- testnameList.append("testname");
- VideoListDataModelData::mData[Qt::DisplayRole] = testnameList;
+ QString testname("testname");
+ VideoListDataModelData::mData[VideoCollectionCommon::KeyTitle] = testname;
mTestObject->mSelectedVideos.insert(TMPXItemId(1,2));
- mTestHelper->emitFinishedSlot(mTestObject->primaryAction());
+ mTestHelper->emitFinishedSlot(mTestObject->mPrimaryAction);
QVERIFY(VideoCollectionViewUtilsData::mLastStatusAdditional.isValid());
QVERIFY(VideoCollectionViewUtilsData::mLastStatusAdditional.toString().length() > 0);
QVERIFY(VideoCollectionViewUtilsData::mLastStatusAdditional.toString() == "testname");
@@ -1059,5 +1058,4 @@
mTestHelper->disconnectSignals();
}
-
// end of file
--- a/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/testvideolistselectiondialog.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testvideolistselectiondialog/testvideolistselectiondialog.pro Mon May 03 12:32:50 2010 +0300
@@ -28,12 +28,12 @@
../../../tsrc/stubs/inc \
\ # keep these at bottom so that stub headers are taken first
../../../inc \
+ ../../../../inc \
../../../videocollectionview/inc \
../../../videocollectionwrapper/inc
CONFIG += qtestlib \
- hb \
- symbian_test
+ hb
LIBS += -lestor.dll \
-lfbscli.dll \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionview/tsrc/videocollectionviewtests.pro Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,29 @@
+#
+# 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: Project file for building videocollectionview tests
+#
+#
+
+TEMPLATE = subdirs
+
+CONFIG += ordered
+
+SUBDIRS += testcollectionview
+SUBDIRS += testhintwidget
+SUBDIRS += testlistview
+SUBDIRS += testlistwidget
+SUBDIRS += testvideocollectionuiloader
+SUBDIRS += testvideocollectionviewutils
+SUBDIRS += testvideolistselectiondialog
+
\ No newline at end of file
--- a/videocollection/videocollectionview/videocollectionview.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionview/videocollectionview.pro Mon May 03 12:32:50 2010 +0300
@@ -49,8 +49,6 @@
/epoc32/include/mw
INCLUDEPATH += ../videocollectionwrapper/inc \
- ../../videoplayerapp/videoplayerengine/inc \
- ../../videoplayerapp/inc \
../inc \
../../inc \
@@ -77,8 +75,9 @@
-lvideocollectionwrapper.dll \
-lcentralrepository.dll \
-lxqserviceutil.dll \
- -lvideoplayerengine.dll
-
+ -lvideoplayerengine.dll \
+ -lflogger.dll
+
# Seems to be no way to get these on top of file
mmpBlock = "$${LITERAL_HASH}include <platform_paths.hrh>" \
"$${LITERAL_HASH}include <data_caging_paths.hrh>" \
--- a/videocollection/videocollectionwrapper/data/icons/pri_large_video_collection.svg Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
- x="0px" y="0px" width="98px" height="98px" viewBox="0 0 98 98" enable-background="new 0 0 98 98" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#F1F1F2" d="M84.183,15.504H21.608c-0.975,0-1.764,0.79-1.764,1.763v49.354c0,0.975,0.789,1.763,1.764,1.763h62.574
- c0.974,0,1.764-0.788,1.764-1.763V17.267C85.946,16.294,85.156,15.504,84.183,15.504z"/>
-<path opacity="0.4" fill="#FFFFFF" enable-background="new " d="M84.476,66.77H21.021V60.6h63.455V66.77z M84.476,22.703H21.021
- v-6.17h63.455V22.703z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="52.8955" y1="15.5039" x2="52.8955" y2="68.3843">
- <stop offset="0" style="stop-color:#757575"/>
- <stop offset="0.2424" style="stop-color:#000000"/>
- <stop offset="0.8606" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#363636"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M84.183,15.504H21.608c-0.975,0-1.764,0.79-1.764,1.763v49.354c0,0.975,0.789,1.763,1.764,1.763
- h62.574c0.974,0,1.764-0.788,1.764-1.763V17.267C85.946,16.294,85.156,15.504,84.183,15.504z M27.777,64.858
- c0,0.486-0.397,0.882-0.881,0.882H23.37c-0.484,0-0.881-0.396-0.881-0.882v-1.762c0-0.484,0.396-0.882,0.881-0.882h3.526
- c0.483,0,0.881,0.397,0.881,0.882V64.858z M27.777,20.792c0,0.485-0.397,0.881-0.881,0.881H23.37c-0.484,0-0.881-0.396-0.881-0.881
- v-1.763c0-0.484,0.396-0.882,0.881-0.882h3.526c0.483,0,0.881,0.397,0.881,0.882V20.792z M35.709,64.858
- c0,0.486-0.397,0.882-0.882,0.882h-3.524c-0.485,0-0.882-0.396-0.882-0.882v-1.762c0-0.484,0.396-0.882,0.882-0.882h3.524
- c0.484,0,0.882,0.397,0.882,0.882V64.858z M35.709,20.792c0,0.485-0.397,0.881-0.882,0.881h-3.524c-0.485,0-0.882-0.396-0.882-0.881
- v-1.763c0-0.484,0.396-0.882,0.882-0.882h3.524c0.484,0,0.882,0.397,0.882,0.882V20.792z M43.642,64.858
- c0,0.486-0.397,0.882-0.881,0.882h-3.525c-0.486,0-0.883-0.396-0.883-0.882v-1.762c0-0.484,0.396-0.882,0.883-0.882h3.525
- c0.483,0,0.881,0.397,0.881,0.882V64.858z M43.642,20.792c0,0.485-0.397,0.881-0.881,0.881h-3.525c-0.486,0-0.883-0.396-0.883-0.881
- v-1.763c0-0.484,0.396-0.882,0.883-0.882h3.525c0.483,0,0.881,0.397,0.881,0.882V20.792z M51.573,64.858
- c0,0.486-0.398,0.882-0.881,0.882h-3.525c-0.486,0-0.881-0.396-0.881-0.882v-1.762c0-0.484,0.395-0.882,0.881-0.882h3.525
- c0.482,0,0.881,0.397,0.881,0.882V64.858z M51.573,20.792c0,0.485-0.398,0.881-0.881,0.881h-3.525c-0.486,0-0.881-0.396-0.881-0.881
- v-1.763c0-0.484,0.395-0.882,0.881-0.882h3.525c0.482,0,0.881,0.397,0.881,0.882V20.792z M59.505,64.858
- c0,0.486-0.397,0.882-0.88,0.882h-3.526c-0.484,0-0.881-0.396-0.881-0.882v-1.762c0-0.484,0.396-0.882,0.881-0.882h3.526
- c0.482,0,0.88,0.397,0.88,0.882V64.858z M59.505,20.792c0,0.485-0.397,0.881-0.88,0.881h-3.526c-0.484,0-0.881-0.396-0.881-0.881
- v-1.763c0-0.484,0.396-0.882,0.881-0.882h3.526c0.482,0,0.88,0.397,0.88,0.882V20.792z M67.438,64.858
- c0,0.486-0.398,0.882-0.883,0.882H63.03c-0.484,0-0.882-0.396-0.882-0.882v-1.762c0-0.484,0.397-0.882,0.882-0.882h3.525
- c0.484,0,0.883,0.397,0.883,0.882V64.858z M67.438,20.792c0,0.485-0.398,0.881-0.883,0.881H63.03c-0.484,0-0.882-0.396-0.882-0.881
- v-1.763c0-0.484,0.397-0.882,0.882-0.882h3.525c0.484,0,0.883,0.397,0.883,0.882V20.792z M75.37,64.858
- c0,0.486-0.397,0.882-0.882,0.882h-3.524c-0.486,0-0.883-0.396-0.883-0.882v-1.762c0-0.484,0.396-0.882,0.883-0.882h3.524
- c0.484,0,0.882,0.397,0.882,0.882V64.858z M75.37,20.792c0,0.485-0.397,0.881-0.882,0.881h-3.524c-0.486,0-0.883-0.396-0.883-0.881
- v-1.763c0-0.484,0.396-0.882,0.883-0.882h3.524c0.484,0,0.882,0.397,0.882,0.882V20.792z M83.302,64.858
- c0,0.486-0.398,0.882-0.882,0.882h-3.525c-0.485,0-0.881-0.396-0.881-0.882v-1.762c0-0.484,0.396-0.882,0.881-0.882h3.525
- c0.483,0,0.882,0.397,0.882,0.882V64.858z M83.302,20.792c0,0.485-0.398,0.881-0.882,0.881h-3.525c-0.485,0-0.881-0.396-0.881-0.881
- v-1.763c0-0.484,0.396-0.882,0.881-0.882h3.525c0.483,0,0.882,0.397,0.882,0.882V20.792z"/>
-<path opacity="0.55" fill="#FFFFFF" d="M84.183,15.504H21.608c-0.975,0-1.764,0.79-1.764,1.763v0.881
- c0-0.972,0.789-1.762,1.764-1.762h62.574c0.974,0,1.764,0.79,1.764,1.762v-0.881C85.946,16.294,85.156,15.504,84.183,15.504z"/>
-<path opacity="0.1" fill="#FFFFFF" d="M21.608,68.384h62.574c0.974,0,1.764-0.788,1.764-1.763V65.74c0,0.974-0.79,1.763-1.764,1.763
- H21.608c-0.975,0-1.764-0.789-1.764-1.763v0.881C19.845,67.596,20.634,68.384,21.608,68.384z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="52.8955" y1="24.4585" x2="52.8955" y2="59.7119">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="0.5" style="stop-color:#666666"/>
- <stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<rect x="19.845" y="24.318" fill="url(#SVGID_2_)" width="66.102" height="35.253"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="52.8955" y1="59.5713" x2="52.8955" y2="24.3188">
- <stop offset="0" style="stop-color:#36B5FF"/>
- <stop offset="1" style="stop-color:#1B66D8"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M83.302,57.809c0,0.969-0.794,1.763-1.764,1.763H24.253c-0.971,0-1.764-0.794-1.764-1.763V26.08
- c0-0.97,0.793-1.762,1.764-1.762h57.285c0.97,0,1.764,0.792,1.764,1.762V57.809z"/>
-<path opacity="0.5" fill="#FFFFFF" d="M81.538,57.809H24.253c-0.971,0-1.764,0.088-1.764-0.881l0,0c0,0.969,0.793,1.762,1.764,1.762
- h57.285c0.97,0,1.764-0.793,1.764-1.762l0,0C83.302,57.896,82.508,57.809,81.538,57.809z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="52.8955" y1="24.3184" x2="52.8955" y2="59.7121">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M81.538,25.198c0.486,0,0.882,0.397,0.882,0.882v31.729c0,0.486-0.396,0.881-0.882,0.881H24.253
- c-0.486,0-0.883-0.395-0.883-0.881V26.08c0-0.484,0.396-0.882,0.883-0.882H81.538 M81.538,24.318H24.253
- c-0.971,0-1.764,0.792-1.764,1.762v31.729c0,0.969,0.793,1.763,1.764,1.763h57.285c0.97,0,1.764-0.794,1.764-1.763V26.08
- C83.302,25.11,82.508,24.318,81.538,24.318L81.538,24.318z"/>
-<polygon fill="#FFFFFF" points="47.133,33.532 63.129,41.574 47.133,50.796 "/>
-<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="54.5928" y1="37.9297" x2="54.5928" y2="50.2224">
- <stop offset="0" style="stop-color:#FFFFFF"/>
- <stop offset="1" style="stop-color:#CFCFCF"/>
-</linearGradient>
-<polygon fill="url(#SVGID_5_)" points="47.133,32.414 62.052,41.044 47.133,49.678 "/>
-<path opacity="0.2" fill="#FFFFFF" d="M81.538,34.894v-7.05c0-0.975-0.789-1.764-1.762-1.764H26.015
- c-0.975,0-1.762,0.789-1.762,1.764V39.3L81.538,34.894z"/>
-<path opacity="0.15" d="M76.392,27.853H19.845v31.719v6.169v0.881c0,0.975,0.789,1.763,1.764,1.763h58.309V31.379
- C79.917,29.434,78.335,27.853,76.392,27.853z"/>
-<path opacity="0.3" d="M76.392,28.734H19.845v30.837v6.169v0.881c0,0.975,0.789,1.763,1.764,1.763h57.427V31.379
- C79.035,29.92,77.85,28.734,76.392,28.734z"/>
-<path fill="#F1F1F2" d="M76.392,29.616H13.816c-0.976,0-1.763,0.789-1.763,1.763v49.355c0,0.974,0.787,1.762,1.763,1.762h62.575
- c0.973,0,1.763-0.788,1.763-1.762V31.379C78.154,30.405,77.364,29.616,76.392,29.616z"/>
-<path opacity="0.4" fill="#FFFFFF" enable-background="new " d="M76.685,80.881H13.228v-6.168h63.457V80.881z M76.685,36.814
- H13.228v-6.169h63.457V36.814z"/>
-<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="45.104" y1="29.6162" x2="45.104" y2="82.4966">
- <stop offset="0" style="stop-color:#757575"/>
- <stop offset="0.2424" style="stop-color:#000000"/>
- <stop offset="0.8606" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#363636"/>
-</linearGradient>
-<path fill="url(#SVGID_6_)" d="M76.392,29.616H13.816c-0.976,0-1.763,0.789-1.763,1.763v49.355c0,0.974,0.787,1.762,1.763,1.762
- h62.575c0.973,0,1.763-0.788,1.763-1.762V31.379C78.154,30.405,77.364,29.616,76.392,29.616z M19.985,78.971
- c0,0.485-0.397,0.882-0.881,0.882h-3.525c-0.484,0-0.882-0.396-0.882-0.882v-1.763c0-0.484,0.397-0.881,0.882-0.881h3.525
- c0.483,0,0.881,0.396,0.881,0.881V78.971z M19.985,34.903c0,0.486-0.397,0.882-0.881,0.882h-3.525c-0.484,0-0.882-0.396-0.882-0.882
- v-1.762c0-0.484,0.397-0.882,0.882-0.882h3.525c0.483,0,0.881,0.397,0.881,0.882V34.903z M27.917,78.971
- c0,0.485-0.397,0.882-0.881,0.882h-3.525c-0.485,0-0.882-0.396-0.882-0.882v-1.763c0-0.484,0.396-0.881,0.882-0.881h3.525
- c0.483,0,0.881,0.396,0.881,0.881V78.971z M27.917,34.903c0,0.486-0.397,0.882-0.881,0.882h-3.525c-0.485,0-0.882-0.396-0.882-0.882
- v-1.762c0-0.484,0.396-0.882,0.882-0.882h3.525c0.483,0,0.881,0.397,0.881,0.882V34.903z M35.85,78.971
- c0,0.485-0.398,0.882-0.881,0.882h-3.525c-0.485,0-0.881-0.396-0.881-0.882v-1.763c0-0.484,0.396-0.881,0.881-0.881h3.525
- c0.482,0,0.881,0.396,0.881,0.881V78.971z M35.85,34.903c0,0.486-0.398,0.882-0.881,0.882h-3.525c-0.485,0-0.881-0.396-0.881-0.882
- v-1.762c0-0.484,0.396-0.882,0.881-0.882h3.525c0.482,0,0.881,0.397,0.881,0.882V34.903z M43.782,78.971
- c0,0.485-0.397,0.882-0.883,0.882h-3.524c-0.485,0-0.881-0.396-0.881-0.882v-1.763c0-0.484,0.396-0.881,0.881-0.881h3.524
- c0.485,0,0.883,0.396,0.883,0.881V78.971z M43.782,34.903c0,0.486-0.397,0.882-0.883,0.882h-3.524c-0.485,0-0.881-0.396-0.881-0.882
- v-1.762c0-0.484,0.396-0.882,0.881-0.882h3.524c0.485,0,0.883,0.397,0.883,0.882V34.903z M51.714,78.971
- c0,0.485-0.398,0.882-0.882,0.882h-3.525c-0.484,0-0.88-0.396-0.88-0.882v-1.763c0-0.484,0.396-0.881,0.88-0.881h3.525
- c0.483,0,0.882,0.396,0.882,0.881V78.971z M51.714,34.903c0,0.486-0.398,0.882-0.882,0.882h-3.525c-0.484,0-0.88-0.396-0.88-0.882
- v-1.762c0-0.484,0.396-0.882,0.88-0.882h3.525c0.483,0,0.882,0.397,0.882,0.882V34.903z M59.646,78.971
- c0,0.485-0.396,0.882-0.881,0.882h-3.525c-0.485,0-0.882-0.396-0.882-0.882v-1.763c0-0.484,0.396-0.881,0.882-0.881h3.525
- c0.484,0,0.881,0.396,0.881,0.881V78.971z M59.646,34.903c0,0.486-0.396,0.882-0.881,0.882h-3.525c-0.485,0-0.882-0.396-0.882-0.882
- v-1.762c0-0.484,0.396-0.882,0.882-0.882h3.525c0.484,0,0.881,0.397,0.881,0.882V34.903z M67.578,78.971
- c0,0.485-0.397,0.882-0.882,0.882h-3.524c-0.485,0-0.882-0.396-0.882-0.882v-1.763c0-0.484,0.396-0.881,0.882-0.881h3.524
- c0.484,0,0.882,0.396,0.882,0.881V78.971z M67.578,34.903c0,0.486-0.397,0.882-0.882,0.882h-3.524c-0.485,0-0.882-0.396-0.882-0.882
- v-1.762c0-0.484,0.396-0.882,0.882-0.882h3.524c0.484,0,0.882,0.397,0.882,0.882V34.903z M75.511,78.971
- c0,0.485-0.398,0.882-0.881,0.882h-3.526c-0.486,0-0.882-0.396-0.882-0.882v-1.763c0-0.484,0.396-0.881,0.882-0.881h3.526
- c0.482,0,0.881,0.396,0.881,0.881V78.971z M75.511,34.903c0,0.486-0.398,0.882-0.881,0.882h-3.526c-0.486,0-0.882-0.396-0.882-0.882
- v-1.762c0-0.484,0.396-0.882,0.882-0.882h3.526c0.482,0,0.881,0.397,0.881,0.882V34.903z"/>
-<path opacity="0.55" fill="#FFFFFF" d="M76.392,29.616H13.816c-0.976,0-1.763,0.789-1.763,1.763v0.881
- c0-0.973,0.787-1.763,1.763-1.763h62.575c0.973,0,1.763,0.79,1.763,1.763v-0.881C78.154,30.405,77.364,29.616,76.392,29.616z"/>
-<path opacity="0.1" fill="#FFFFFF" d="M13.816,82.496h62.575c0.973,0,1.763-0.788,1.763-1.762v-0.882
- c0,0.974-0.79,1.762-1.763,1.762H13.816c-0.976,0-1.763-0.788-1.763-1.762v0.882C12.054,81.708,12.841,82.496,13.816,82.496z"/>
-<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="45.104" y1="38.5688" x2="45.104" y2="73.8223">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="0.5" style="stop-color:#666666"/>
- <stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<rect x="12.054" y="38.429" fill="url(#SVGID_7_)" width="66.101" height="35.253"/>
-<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="45.104" y1="72.3418" x2="45.104" y2="38.852">
- <stop offset="0" style="stop-color:#AFED23"/>
- <stop offset="0.8121" style="stop-color:#358C0C"/>
- <stop offset="1" style="stop-color:#67AD1A"/>
-</linearGradient>
-<path fill="url(#SVGID_8_)" d="M75.511,71.92c0,0.97-0.794,1.762-1.764,1.762H16.461c-0.97,0-1.764-0.792-1.764-1.762V40.191
- c0-0.969,0.794-1.763,1.764-1.763h57.286c0.97,0,1.764,0.794,1.764,1.763V71.92z"/>
-<path opacity="0.5" fill="#FFFFFF" d="M73.747,71.92H16.461c-0.97,0-1.764,0.088-1.764-0.882l0,0c0,0.97,0.794,1.764,1.764,1.764
- h57.286c0.97,0,1.764-0.794,1.764-1.764l0,0C75.511,72.008,74.717,71.92,73.747,71.92z"/>
-<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="45.104" y1="38.4287" x2="45.104" y2="73.8224">
- <stop offset="0" style="stop-color:#000000"/>
- <stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<path fill="url(#SVGID_9_)" d="M73.747,39.311c0.485,0,0.883,0.396,0.883,0.881V71.92c0,0.487-0.397,0.882-0.883,0.882H16.461
- c-0.486,0-0.882-0.395-0.882-0.882V40.191c0-0.485,0.396-0.881,0.882-0.881H73.747 M73.747,38.429H16.461
- c-0.97,0-1.764,0.794-1.764,1.763V71.92c0,0.97,0.794,1.762,1.764,1.762h57.286c0.97,0,1.764-0.792,1.764-1.762V40.191
- C75.511,39.223,74.717,38.429,73.747,38.429L73.747,38.429z"/>
-<polygon fill="#FFFFFF" points="39.34,47.643 55.337,55.687 39.34,64.907 "/>
-<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="46.7993" y1="52.042" x2="46.7993" y2="64.335">
- <stop offset="0" style="stop-color:#FFFFFF"/>
- <stop offset="1" style="stop-color:#CFCFCF"/>
-</linearGradient>
-<polygon fill="url(#SVGID_10_)" points="39.34,46.526 54.26,55.155 39.34,63.79 "/>
-<path opacity="0.2" fill="#FFFFFF" d="M73.747,49.005v-7.051c0-0.972-0.79-1.763-1.764-1.763H18.223
- c-0.974,0-1.762,0.791-1.762,1.763v11.458L73.747,49.005z"/>
-<rect fill="none" width="98" height="98"/>
-</svg>
--- a/videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/data/videocollectionwrapper.qrc Mon May 03 12:32:50 2010 +0300
@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/icons" >
<file alias="default_thumbnail_video.svg" >icons/pri_large_video.svg</file>
- <file alias="default_thumbnail_collection.svg" >icons/pri_large_video_collection.svg</file>
</qresource>
</RCC>
--- a/videocollection/videocollectionwrapper/inc/videocollectionclient.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionclient.h Mon May 03 12:32:50 2010 +0300
@@ -20,13 +20,13 @@
#include <vcxmyvideosdefs.h>
#include <QList>
#include "videocollectioncommon.h"
+
// FORWARD DECLARATIONS
class MMPXCollectionUtility;
class VideoDataSignalReceiver;
class VideoCollectionListener;
-
// CLASS DECLARATION
/**
@@ -36,7 +36,7 @@
*/
class VideoCollectionClient
{
-
+
public:
/**
@@ -59,7 +59,6 @@
int initialize(VideoDataSignalReceiver *signalReceiver);
public:
-
/**
* Collection opening status
@@ -70,8 +69,6 @@
ECollectionOpening,
ECollectionOpened
};
-
-
/**
* Connects videodata signals to provided object
@@ -112,7 +109,7 @@
* startOpenCurrentState to start collection into current state.
*
*/
- void setOpenStatus(int status);
+ void setOpenStatus(int status, bool startOpening = true);
/**
* Starts opening of collection to the all videos category
@@ -205,6 +202,15 @@
* @return 0 if no errors.
*/
int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+
+ /**
+ * Renames an album.
+ *
+ * @param albumId, Album to be renamed.
+ * @param newTitle, New title for the album.
+ * @return 0 if no errors.
+ */
+ int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
private:
@@ -290,8 +296,16 @@
*/
void removeItemsFromAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
+ /**
+ * Renames an album.
+ *
+ * @param albumId, Album to be renamed.
+ * @param newTitle, New title for the album.
+ * @return None.
+ */
+ void renameAlbumL(const TMPXItemId &albumId, const QString newTitle);
+
private:
-
/**
* Pointer to MPX Collection utility.
--- a/videocollection/videocollectionwrapper/inc/videocollectionutils.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionutils.h Mon May 03 12:32:50 2010 +0300
@@ -125,12 +125,12 @@
QString prepareLengthString(quint32 length);
/**
- * Prepares length strings from given value.
+ * Prepares length string from given value in short format.
*
* @param length Length value in seconds.
- * @return Lengths as QStringList, first item tells the minutes, second tells seconds
+ * @return Length as QString (for example "00:25:10").
*/
- const QStringList prepareLengthStrings(quint32 total);
+ const QString prepareShortLengthString(quint32 total);
/**
* Prepares size string from the given value.
--- a/videocollection/videocollectionwrapper/inc/videocollectionwrapper.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionwrapper.h Mon May 03 12:32:50 2010 +0300
@@ -22,6 +22,7 @@
// INCLUDES
#include <QObject>
#include <qabstractitemmodel.h>
+#include "videocollectioncommon.h"
#include "videocollectionexport.h"
// FORWARD DECLARATIONS
@@ -32,12 +33,11 @@
/**
* Class is used as an interface of the video collection QT wrapper.
*
- * Singleton instance is deleted when it's not used anymore by clients. At instantion time
- * reference count is incremented. Client must call decreaseReferenceCount when it doesn't
- * need the instance anymore. When reference count is 0 the instance is destroyed.
+ * Singleton instance is deleted when application ends
*
* * Usage:
* @code
+ * #include "videocollectioncommon.h"
* #include "videocollectionwrapper.h"
* #include "videosortfilterproxymodel.h"
*
@@ -45,25 +45,18 @@
* ////
* // Getting the instances
* ////
- * VideoCollectionWrapper *wrapper = VideoCollectionWrapper::instance();
- *
- * VideoSortFilterProxyModel *model = wrapper->getModel();
+ * VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
+ * // getting all videos model
+ * VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
* ...
* ////
* // Opening collection and start fetching video item data
* ////
* if(model)
* {
- * mModel->open(VideoListWidget::ELevelVideos);
+ * mModel.open(VideoCollectionCommon::ELevelVideos);
* }
* // see model documentation for the open funtionality
- *
- * /////
- * // Instance is not used anymore.
- * // Wrapper owns the model, so client should not deallocate it
- * /////
- * wrapper->decreaseReferenceCount();
- * wrapper = 0; // Don't use before new instantion.
*
* @endcode
*
@@ -77,14 +70,6 @@
public: // Constructor
- enum TModelType
- {
- EAllVideos,
- ECollections,
- ECollectionContent,
- EGeneric
- };
-
/**
* Returns singleton instance for this class.
*
@@ -101,7 +86,7 @@
*
* @return address to model or NULL if fails.
*/
- VideoSortFilterProxyModel* getModel(int type);
+ VideoSortFilterProxyModel* getModel(VideoCollectionCommon::TModelType type);
/**
* Method can be used by client to emit status signal
--- a/videocollection/videocollectionwrapper/inc/videocollectionwrapper_p.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionwrapper_p.h Mon May 03 12:32:50 2010 +0300
@@ -23,7 +23,7 @@
#include <QObject>
#include <QPointer>
#include <qabstractitemmodel.h>
-
+#include "videocollectioncommon.h"
// FORWARD DECLARATIONS
class CMPXMediaArray;
@@ -59,7 +59,7 @@
* @param type type of model
* @return address of model, NULL if creation did not succeed.
*/
- VideoSortFilterProxyModel* getModel(int &type);
+ VideoSortFilterProxyModel* getModel(VideoCollectionCommon::TModelType &type);
private slots:
--- a/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videodatasignalreceiver.h Mon May 03 12:32:50 2010 +0300
@@ -93,9 +93,9 @@
/**
* Signaled when all details for a video have been fetched.
*
- * @param aMedia MPX Media that contains all details.
+ * @param media MPX Media that contains all details.
*/
- virtual void videoDetailsCompletedSlot( TMPXItemId videoId ) = 0;
+ virtual void videoDetailsCompletedSlot( CMPXMedia* media ) = 0;
/**
* Signalled when album items are recieved.
@@ -105,6 +105,13 @@
*/
virtual void albumListAvailableSlot(TMPXItemId albumId,
CMPXMediaArray *albumItems) = 0;
+
+ /**
+ * Signalled when item has been mofidied.
+ *
+ * @param itemId, item that has been modified.
+ */
+ virtual void itemModifiedSlot(const TMPXItemId &itemId) = 0;
};
#endif // __VIDEOMODELOBSERVER_H
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel.h Mon May 03 12:32:50 2010 +0300
@@ -202,11 +202,10 @@
/**
* This signal is connected to video list's details ready
- * -signal indicating that video details data is fetched ok
- *
- * @param id of the video item
+ * -signal indicating that video details data is fetched
+ * and provides a QMap of the details'.
*/
- void fullVideoDetailsReady(TMPXItemId id);
+ void fullVideoDetailsReady(QVariant &);
/**
* This signal is connected to proxy models short details ready
@@ -232,6 +231,11 @@
* Signals that album content has been updated.
*/
void albumChanged();
+
+ /**
+ * Signals that item data has changed.
+ */
+ void itemModified(const TMPXItemId &itemId);
private slots:
@@ -267,6 +271,20 @@
*/
QString prepareDetailRow(int index) const;
+ /**
+ * Formats a detail row string for the video item
+ * at the given index.
+ *
+ * In case item is not found in the provided index, empty
+ * string is returned.
+ *
+ * @param index, index of the item data is requested
+ * @param duration, duration of the video
+ *
+ * @return QString detail string
+ */
+ QString doDetailRow(int index, const QString duration) const;
+
/**
* Generates a video count string for category or album at given index.
*
@@ -301,16 +319,16 @@
void reportAsyncStatus(int statusCode, QVariant &additional);
/**
- * Generates a video length strings from video item at given index
+ * Generates a short video length string from video item at given index
*
* In case item is not found in the provided index, empty
- * strings are returned.
+ * string is returned.
*
* @param index, index of the item data is requested
*
- * @return Lengths as QStringList, first item tells the minutes, second tells seconds
+ * @return Lengths as QString, (for example "00:25:10").
*/
- QStringList prepareLengthStrings(int index) const;
+ QString prepareShortLengthString(int index) const;
private:
--- a/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h Mon May 03 12:32:50 2010 +0300
@@ -90,12 +90,9 @@
/**
* This signal is emitted, collection notifies details for item has been
- * fetched
- *
- * @param itemId
- *
+ * fetched and provides a QMap of the details'.
*/
- void videoDetailsReady(TMPXItemId itemId);
+ void videoDetailsReady(QVariant &);
private slots:
@@ -170,7 +167,7 @@
* has completed.
*
*/
- void videoDetailsCompletedSlot(TMPXItemId videoId);
+ void videoDetailsCompletedSlot(CMPXMedia* media);
/**
* Signalled when album items are recieved.
@@ -179,6 +176,13 @@
* @param albumItems, Items belonging to the current album.
*/
void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems);
+
+ /**
+ * Signalled when item has been mofidied.
+ *
+ * @param itemId, item that has been modified.
+ */
+ void itemModifiedSlot(const TMPXItemId &itemId);
public: // services
@@ -261,6 +265,15 @@
quint32 getVideodurationFromIndex(int index) const;
/**
+ * Returns the duration of the video from given media.
+ *
+ * @param media The video media object.
+ *
+ * @return guint32 duration
+ */
+ quint32 getVideoDuration(CMPXMedia* media) const;
+
+ /**
* Returns the creation/download date of the video.
*
* @param index: item position where client wants the date from.
@@ -270,14 +283,11 @@
QDateTime getVideoDateFromIndex(int index) const;
/**
- * Returns the metadata for the video.
- *
- * @param index: item position where client wants the data from.
+ * Returns the creation/download date of the video
*
- * @return QMap map of the QVariants that hold the data. Keys defined
- * in VideoCollectionCommon
+ * @param media The video media object.
*/
- QMap<QString, QVariant> getMetaDataFromIndex(int index) const;
+ QDateTime getVideoDate(CMPXMedia* media) const;
/**
* marks videos to be removed: it's id and index are saved to
--- a/videocollection/videocollectionwrapper/inc/videosortfilterproxymodel.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videosortfilterproxymodel.h Mon May 03 12:32:50 2010 +0300
@@ -22,6 +22,7 @@
#include <e32const.h>
#include <mpxitemid.h>
#include "videocollectionexport.h"
+#include "videocollectioncommon.h"
class QTimer;
class VideoListDataModel;
@@ -39,7 +40,7 @@
* @param parent parent of this widget
* @param client Collection client pointer to use.
*/
- VideoSortFilterProxyModel(int type, QObject *parent=0);
+ VideoSortFilterProxyModel(VideoCollectionCommon::TModelType type, QObject *parent=0);
/**
* Destructor.
@@ -67,7 +68,7 @@
* @param level The level where the collection is opened.
* @return 0 if opening was successful, negative if not.
*/
- int open(int level);
+ int open(VideoCollectionCommon::TCollectionLevels level);
/**
* Starts sorting. If async parameter is defined as true uses idle timer:
@@ -186,7 +187,16 @@
*/
int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
- /**
+ /**
+ * Renames an album.
+ *
+ * @param itemId, Album to be renamed.
+ * @param newTitle, New title for the album.
+ * @return 0 if no errors.
+ */
+ int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
+
+ /**
* Resolves duplicate album names and returns the resolved name.
* 'New collection' -> 'New collection (1)' -> 'New collection (2)', etc.
*
@@ -224,6 +234,14 @@
*/
TMPXItemId getOpenItem() const;
+ /**
+ * Gets the type of model.
+ *
+ * @param None.
+ * @return TModelType.
+ */
+ VideoCollectionCommon::TModelType getType();
+
signals:
@@ -279,6 +297,12 @@
* refiltering is required
*/
void albumChangedSlot();
+
+ /**
+ * signaled when data for item has changed and
+ * invalidate is required.
+ */
+ void itemModifiedSlot(const TMPXItemId &itemId);
private:
@@ -316,12 +340,12 @@
/**
* type of data excepted
*/
- int mType;
+ VideoCollectionCommon::TModelType mType;
/**
* Currently open level.
*/
- int mLevel;
+ VideoCollectionCommon::TCollectionLevels mLevel;
/**
* item id used as filter if model type is generic model
--- a/videocollection/videocollectionwrapper/src/videocollectionclient.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionclient.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,8 +15,10 @@
*
*/
+// Version : %version: 39 %
+
// INCLUDE FILES
-#include <QObject>
+#include <qobject.h>
#include <centralrepository.h>
#include <mpxcollectionutility.h>
#include <mpxcollectionpath.h>
@@ -34,19 +36,20 @@
#include "videodatasignalreceiver.h"
#include "videocollectionclient.h"
#include "videocollectionlistener.h"
+#include "videocollectiontrace.h"
// -----------------------------------------------------------------------------
// VideoCollectionClient()
// -----------------------------------------------------------------------------
//
-VideoCollectionClient::VideoCollectionClient() :
-mCollectionUtility(0),
-mCollectionOpenStatus(ECollectionNotOpen),
-mCollectionListener(0),
-mOpenCategoryAlbum(TMPXItemId::InvalidId()),
-mCollectionPathLevel(VideoCollectionCommon::ELevelInvalid)
+VideoCollectionClient::VideoCollectionClient()
+ : mCollectionUtility( 0 )
+ , mCollectionOpenStatus( ECollectionNotOpen )
+ , mCollectionListener( 0 )
+ , mOpenCategoryAlbum( TMPXItemId::InvalidId() )
+ , mCollectionPathLevel( VideoCollectionCommon::ELevelInvalid )
{
-
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -55,13 +58,14 @@
//
int VideoCollectionClient::initialize(VideoDataSignalReceiver *signalReceiver)
{
+ FUNC_LOG;
if(!signalReceiver)
{
return -1;
}
if(mCollectionUtility && mCollectionListener)
{
- // already initialized
+ INFO("VideoCollectionClient::initialize() already initialized.");
return 0;
}
if(!mCollectionListener)
@@ -77,6 +81,7 @@
TRAPD( error, mCollectionUtility = MMPXCollectionUtility::NewL( mCollectionListener, KMcModeDefault ) );
if(error)
{
+ ERROR(error, "VideoCollectionClient::initialize() construction of collection utility failed.");
delete mCollectionListener;
mCollectionListener = 0;
return error;
@@ -91,6 +96,7 @@
//
VideoCollectionClient::~VideoCollectionClient()
{
+ FUNC_LOG;
if (mCollectionUtility)
{
// closing deallocates collection utility pointer
@@ -106,6 +112,7 @@
void VideoCollectionClient::getCategoryId(TMPXItemId &id)
{
+ FUNC_LOG;
id = mOpenCategoryAlbum;
}
@@ -115,6 +122,7 @@
//
int VideoCollectionClient::getCollectionLevel()
{
+ FUNC_LOG;
return mCollectionPathLevel;
}
@@ -124,6 +132,7 @@
//
int VideoCollectionClient::getOpenStatus()
{
+ FUNC_LOG;
return mCollectionOpenStatus;
}
@@ -131,10 +140,12 @@
// setOpenStatus
// ---------------------------------------------------------------------------
//
-void VideoCollectionClient::setOpenStatus(int status)
+void VideoCollectionClient::setOpenStatus(int status, bool startOpening)
{
+ FUNC_LOG;
+ INFO_2("VideoCollectionClient::setOpenStatus() status: %d start opening %d", status, startOpening);
mCollectionOpenStatus = status;
- if(mCollectionOpenStatus == ECollectionOpened)
+ if(mCollectionOpenStatus == ECollectionOpened && startOpening)
{
startOpenCurrentState();
}
@@ -146,6 +157,9 @@
//
int VideoCollectionClient::startOpenCollection(int level)
{
+ FUNC_LOG;
+ INFO_1("VideoCollectionClient::startOpenCollection() opening level: %d", level);
+
if(!mCollectionUtility)
{
return -1;
@@ -167,6 +181,7 @@
//
int VideoCollectionClient::startOpenCurrentState()
{
+ FUNC_LOG;
int error = -1;
if(mCollectionUtility && mCollectionOpenStatus == ECollectionOpened)
{
@@ -180,6 +195,7 @@
// -----------------------------------------------------------------------------
int VideoCollectionClient::deleteVideos(QList<TMPXItemId> *mediaIds)
{
+ FUNC_LOG;
if(!mCollectionUtility || !mediaIds)
{
return -1;
@@ -194,6 +210,7 @@
//
int VideoCollectionClient::openItem(TMPXItemId &mediaId)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
return -1;
@@ -217,6 +234,7 @@
//
int VideoCollectionClient::back()
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
return -1;
@@ -231,6 +249,7 @@
//
int VideoCollectionClient::fetchMpxMediaByMpxId(TMPXItemId &mpxId)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
return -1;
@@ -246,6 +265,7 @@
//
int VideoCollectionClient::getVideoDetails(TMPXItemId &mediaId)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
return -1;
@@ -262,6 +282,8 @@
//
TMPXItemId VideoCollectionClient::addNewAlbum(const QString &title)
{
+ FUNC_LOG;
+
TMPXItemId id = TMPXItemId::InvalidId();
if (mCollectionUtility && title.length())
@@ -282,6 +304,7 @@
//
int VideoCollectionClient::removeAlbums(const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
int err(-1);
if (mCollectionUtility && mediaIds.count())
@@ -297,8 +320,9 @@
// -----------------------------------------------------------------------------
//
int VideoCollectionClient::addItemsInAlbum(TMPXItemId &albumId,
- const QList<TMPXItemId> &mediaIds)
+ const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
int err(-1);
if (mCollectionUtility && albumId != TMPXItemId::InvalidId() &&
@@ -315,8 +339,9 @@
// -----------------------------------------------------------------------------
//
int VideoCollectionClient::removeItemsFromAlbum(TMPXItemId &albumId,
- const QList<TMPXItemId> &mediaIds)
+ const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
int err(-1);
if (mCollectionUtility && albumId != TMPXItemId::InvalidId() &&
@@ -329,11 +354,33 @@
}
// -----------------------------------------------------------------------------
+// renameAlbum
+// -----------------------------------------------------------------------------
+//
+int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId,
+ const QString &newTitle)
+{
+ FUNC_LOG;
+ int err(-1);
+
+ if(mCollectionUtility && albumId.iId2 == KVcxMvcMediaTypeAlbum &&
+ !newTitle.isEmpty())
+ {
+ TRAP(err, renameAlbumL(albumId, newTitle));
+ }
+
+ return err;
+}
+
+// -----------------------------------------------------------------------------
// startOpenCollectionL
// -----------------------------------------------------------------------------
//
void VideoCollectionClient::startOpenCollectionL(int level)
{
+ FUNC_LOG;
+ INFO_1("VideoCollectionClient::startOpenCollectionL() level: %d", level);
+
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
@@ -346,15 +393,12 @@
{
collectionPath->AppendL( KVcxMvcCategoryIdAll );
- mOpenCategoryAlbum.iId1 = KVcxMvcCategoryIdAll;
- mOpenCategoryAlbum.iId2 = 1;
-
+ mOpenCategoryAlbum = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeCategory);
mCollectionPathLevel = VideoCollectionCommon::ELevelVideos;
}
else
{
mOpenCategoryAlbum = TMPXItemId::InvalidId();
-
mCollectionPathLevel = VideoCollectionCommon::ELevelCategory;
}
mCollectionUtility->Collection().OpenL( *collectionPath );
@@ -363,13 +407,13 @@
mCollectionOpenStatus = ECollectionOpening;
}
-
// -----------------------------------------------------------------------------
// deleteVideosL
// -----------------------------------------------------------------------------
//
void VideoCollectionClient::deleteVideosL(QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
if(!mCollectionUtility || mediaIds.count() == 0)
{
User::Leave(KErrGeneral);
@@ -411,6 +455,7 @@
//
void VideoCollectionClient::openVideoL(TMPXItemId &videoId)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
@@ -432,6 +477,7 @@
//
void VideoCollectionClient::openCategoryL(TMPXItemId &id)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
@@ -455,10 +501,11 @@
//
void VideoCollectionClient::backL()
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
- }
+ }
if (getCollectionLevel() > 2 )
{
@@ -477,6 +524,7 @@
//
void VideoCollectionClient::getVideoDetailsL(TMPXItemId &videoId)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
@@ -498,6 +546,7 @@
//
void VideoCollectionClient::removeAlbumsL(const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
@@ -533,6 +582,7 @@
else
{
// invalid data provided
+ ERROR(KErrGeneral, "VideoCollectionClient::removeItemsFromAlbumL() no albums found");
User::Leave(KErrGeneral);
}
@@ -546,6 +596,7 @@
//
TMPXItemId VideoCollectionClient::createAlbumL(const QString &title)
{
+ FUNC_LOG;
TMPXItemId albumId = TMPXItemId::InvalidId();
CMPXCommand* cmd = CMPXCommand::NewL();
@@ -580,6 +631,7 @@
void VideoCollectionClient::addItemsInAlbumL(TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
CMPXCommand* cmd = CMPXCommand::NewL();
CleanupStack::PushL(cmd);
cmd->SetTObjectValueL(KMPXCommandGeneralId, KVcxCommandIdMyVideos);
@@ -610,6 +662,7 @@
else
{
// invalid data provided
+ ERROR(KErrGeneral, "VideoCollectionClient::removeItemsFromAlbumL() no videos found");
User::Leave(KErrGeneral);
}
@@ -624,6 +677,7 @@
void VideoCollectionClient::removeItemsFromAlbumL(TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG;
CMPXCommand* cmd = CMPXCommand::NewL();
CleanupStack::PushL(cmd);
cmd->SetTObjectValueL(KMPXCommandGeneralId, KVcxCommandIdMyVideos);
@@ -654,6 +708,7 @@
else
{
// invalid data provided
+ ERROR(KErrGeneral, "VideoCollectionClient::removeItemsFromAlbumL() no videos found");
User::Leave(KErrGeneral);
}
CleanupStack::PopAndDestroy(array);
@@ -661,11 +716,40 @@
}
// -----------------------------------------------------------------------------
+// renameAlbumL
+// -----------------------------------------------------------------------------
+//
+void VideoCollectionClient::renameAlbumL(const TMPXItemId &albumId, const QString newTitle)
+{
+ FUNC_LOG;
+ CMPXMedia *media = CMPXMedia::NewL();
+ CleanupStack::PushL(media);
+ TPtrC titlePtrC(newTitle.utf16());
+ media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, albumId);
+ media->SetTextValueL(KMPXMediaGeneralTitle, titlePtrC);
+
+ CMPXCommand* cmd = CMPXMedia::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionSet);
+ cmd->SetCObjectValueL<CMPXMedia>(KMPXCommandColSetMedia, media);
+ cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue);
+ cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId,
+ TUid::Uid(KVcxUidMyVideosMpxCollection));
+
+ mCollectionUtility->Collection().CommandL(*cmd);
+
+ CleanupStack::PopAndDestroy(cmd);
+ CleanupStack::PopAndDestroy(media);
+}
+
+// -----------------------------------------------------------------------------
// fetchMpxMediaByMpxIdL
// -----------------------------------------------------------------------------
//
void VideoCollectionClient::fetchMpxMediaByMpxIdL(TMPXItemId &aMpxId)
{
+ FUNC_LOG;
if(!mCollectionUtility)
{
User::Leave(KErrGeneral);
@@ -693,3 +777,4 @@
CleanupStack::PopAndDestroy( cmd );
}
+// End of file.
--- a/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionlistener.cpp Mon May 03 12:32:50 2010 +0300
@@ -11,12 +11,13 @@
*
* Contributors:
*
-* Description: VideoCollectionClient class implementation
+* Description: VideoCollectionListener class implementation
*
*/
+// Version : %version: 32 %
+
// INCLUDE FILES
-
#include <mpxmediageneraldefs.h>
#include <mpxmessagegeneraldefs.h>
#include <mpxmessage2.h>
@@ -34,18 +35,19 @@
#include "videodatasignalreceiver.h"
#include "videocollectionutils.h"
#include "videocollectioncommon.h"
+#include "videocollectiontrace.h"
// -----------------------------------------------------------------------------
// VideoCollectionListener
// -----------------------------------------------------------------------------
//
-VideoCollectionListener::VideoCollectionListener(VideoCollectionClient &collectionClient,
- VideoDataSignalReceiver &signalReceiver) :
-mCollectionClient(collectionClient),
-mSignalReceiver(signalReceiver),
-mVideoUtils(VideoCollectionUtils::instance())
+VideoCollectionListener::VideoCollectionListener( VideoCollectionClient &collectionClient,
+ VideoDataSignalReceiver &signalReceiver)
+ : mCollectionClient( collectionClient )
+ , mSignalReceiver( signalReceiver )
+ , mVideoUtils( VideoCollectionUtils::instance() )
{
-
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -54,7 +56,7 @@
//
VideoCollectionListener::~VideoCollectionListener()
{
-
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -65,7 +67,7 @@
const CMPXMedia& /*aMedia*/,
TInt /*aError*/)
{
- // NOP
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -78,29 +80,33 @@
TBool /*aComplete*/,
TInt aError)
{
+ FUNC_LOG;
if(aError != KErrNone)
{
+ ERROR(aError, "VideoCollectionListener::HandleOpenL()");
return;
}
// Check that current level is valid and entries has collection path.
- if(mCollectionClient.getCollectionLevel() < VideoCollectionCommon::ELevelCategory ||
- !aEntries.IsSupported(KMPXMediaGeneralContainerPath))
+ if(mCollectionClient.getCollectionLevel() < VideoCollectionCommon::ELevelCategory )
{
+ ERROR(-1, "VideoCollectionListener::HandleOpenL() invalid level");
return;
}
-
+
CMPXMediaArray *array =
mVideoUtils.mediaValuePtr<CMPXMessageArray>(&aEntries, KMPXMediaArrayContents);
if(!array)
{
- // no videos!
+ ERROR(-1, "VideoCollectionListener::HandleOpenL() array contents is NULL.");
return;
}
- CMPXCollectionPath* path = aEntries.Value<CMPXCollectionPath>(KMPXMediaGeneralContainerPath);
+ CMPXCollectionPath* path =
+ mVideoUtils.mediaValuePtr<CMPXCollectionPath>(&aEntries, KMPXMediaGeneralContainerPath);
if(!path)
{
+ ERROR(-1, "VideoCollectionListener::HandleOpenL() no container path in message.");
return;
}
@@ -136,7 +142,7 @@
const CMPXCollectionPlaylist& /*aPlaylist*/,
TInt /*aError*/)
{
- // NOP
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -147,8 +153,10 @@
CMPXCommand* aCommandResult,
TInt aError)
{
+ FUNC_LOG;
if(aError != KErrNone || !aCommandResult)
{
+ ERROR_1(aError, "VideoCollectionListener::HandleCommandComplete() result: %d", aCommandResult);
return;
}
int commandId = -1;
@@ -210,8 +218,10 @@
CMPXMessage* aMessage,
TInt aError )
{
+ FUNC_LOG;
if(aError)
{
+ ERROR(aError, "VideoCollectionListener::HandleCollectionMessage()");
return;
}
@@ -240,17 +250,17 @@
}
return;
}
-
+
if( mainMessageId == KVcxCommandIdMyVideos)
{
int myVideosMainMsgId = -1;
- if(!mVideoUtils.mediaValue<int>(aMessage, KVcxMediaMyVideosCommandId, myVideosMainMsgId ))
+ if(!mVideoUtils.mediaValue<int>(aMessage, KVcxMediaMyVideosCommandId, myVideosMainMsgId))
{
return;
}
- if ( myVideosMainMsgId == KVcxMessageMyVideosMessageArray )
+ if (myVideosMainMsgId == KVcxMessageMyVideosMessageArray)
{
handleMyVideosMessageArray(aMessage);
}
@@ -271,6 +281,7 @@
//
void VideoCollectionListener::handleMyVideosMessageArray(CMPXMessage *aMessage)
{
+ FUNC_LOG;
CMPXMessageArray* messageArray = NULL;
messageArray = mVideoUtils.mediaValuePtr<CMPXMessageArray>(aMessage, KMPXMessageArrayContents);
@@ -279,7 +290,7 @@
return;
}
- int count = messageArray->Count();
+ int count = messageArray->Count();
int myVideosMsgId;
TMPXMessageId mpxMessageId;
@@ -305,6 +316,7 @@
//
void VideoCollectionListener::handleMyVideosMPXMessage(int &myVideosMsgId, CMPXMessage *aMessage)
{
+ FUNC_LOG;
switch (myVideosMsgId)
{
case KVcxMessageMyVideosGetMediasByMpxIdResp:
@@ -338,6 +350,7 @@
//
void VideoCollectionListener::handleMPXMessage(TMPXMessageId &mpxMessageId, CMPXMessage *aMessage)
{
+ FUNC_LOG;
switch(mpxMessageId)
{
case KMPXMessageGeneral:
@@ -357,6 +370,7 @@
//
void VideoCollectionListener::handleGeneralMPXMessage(CMPXMessage* aMessage)
{
+ FUNC_LOG;
if(mCollectionClient.getOpenStatus() != VideoCollectionClient::ECollectionOpening)
{
return;
@@ -386,7 +400,7 @@
//
void VideoCollectionListener::handleMyVideosItemsChanged(CMPXMessage* aMessage)
{
-
+ FUNC_LOG;
TMPXChangeEventType eventType = EMPXItemModified;
if(!mVideoUtils.mediaValue<TMPXChangeEventType>(
aMessage,KMPXMessageChangeEventType, eventType))
@@ -399,7 +413,7 @@
{
return;
}
-
+ INFO_3("VideoCollectionListener::handleMyVideosItemsChanged event: %d - item id1: %d id2: %d", eventType, itemId.iId1, itemId.iId2);
switch(eventType)
{
case EMPXItemDeleted:
@@ -411,7 +425,7 @@
{
CMPXMedia *media = mVideoUtils.mediaValuePtr<CMPXMedia>(
aMessage, KMPXCommandColAddMedia);
- if (media)
+ if(media)
{
mSignalReceiver.newVideoAvailableSlot(media);
}
@@ -423,11 +437,18 @@
}
case EMPXItemModified:
{
- if (itemId.iId2 == KVcxMvcMediaTypeAlbum)
+ INFO("VideoCollectionListener::handleMyVideosItemsChanged EMPXItemModified");
+ // Inform that item data has changed.
+ mSignalReceiver.itemModifiedSlot(itemId);
+ // Update category contents.
+ if(itemId.iId2 == KVcxMvcMediaTypeAlbum ||
+ itemId.iId2 == KVcxMvcMediaTypeCategory)
{
- // re-open the album in case album corresponds recently opened.
- // to fetch the album contents.
+ INFO("VideoCollectionListener::handleMyVideosItemsChanged album or category modified, opening.");
mCollectionClient.openItem(itemId);
+ // collection is already opened at this stage, so we can safely set value here
+ // to make sure we do not let any other messages unhandled
+ mCollectionClient.setOpenStatus(VideoCollectionClient::ECollectionOpened, false);
}
break;
}
@@ -445,7 +466,7 @@
//
void VideoCollectionListener::handleMyVideosDeleteMessage(CMPXMessage* aMessage)
{
-
+ FUNC_LOG;
CMPXMediaArray *messageArray =
mVideoUtils.mediaValuePtr<CMPXMediaArray>(aMessage, KMPXMediaArrayContents);
if(!messageArray || messageArray->Count() == 0)
@@ -488,14 +509,14 @@
//
void VideoCollectionListener::handleGetMediasByMpxIdResp(CMPXMessage* aMessage)
{
-
+ FUNC_LOG;
CMPXMediaArray* array =
mVideoUtils.mediaValuePtr<CMPXMediaArray>(aMessage, KMPXMediaArrayContents);
if(!array || array->Count() < 1)
{
return;
}
- mSignalReceiver.newVideoAvailableSlot((*array)[0]);
+ mSignalReceiver.newVideoAvailableSlot((*array)[0]);
}
// -----------------------------------------------------------------------------
@@ -504,16 +525,13 @@
//
void VideoCollectionListener::handleGetVideoDetailsResp(CMPXMessage* aMessage)
{
+ FUNC_LOG;
CMPXMedia *item = mVideoUtils.mediaValuePtr<CMPXMedia>(aMessage,KMPXCommandColAddMedia);
if(!item)
{
return;
}
- TMPXItemId itemId;
- if( !mVideoUtils.mediaValue<TMPXItemId>(item, KMPXMediaGeneralId, itemId))
- {
- return;
- }
- mSignalReceiver.videoDetailsCompletedSlot(itemId);
+ mSignalReceiver.videoDetailsCompletedSlot(item);
}
+// End of file.
--- a/videocollection/videocollectionwrapper/src/videocollectionutils.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionutils.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,12 +15,16 @@
*
*/
-// INCLUDE FILES
-
+// Version : %version: %
+// INCLUDE FILES
#include <qobject.h>
+#include <QTime>
+#include <hbglobal.h>
+#include <hbextendedlocale.h>
+
#include "videocollectionutils.h"
-
+#include "videocollectiontrace.h"
// -----------------------------------------------------------------------------
// instance
@@ -38,7 +42,7 @@
//
VideoCollectionUtils::VideoCollectionUtils()
{
-
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -47,7 +51,7 @@
//
VideoCollectionUtils::~VideoCollectionUtils()
{
-
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -56,9 +60,14 @@
//
QString VideoCollectionUtils::prepareLengthString(quint32 length)
{
+ FUNC_LOG;
const int secondsInMinute( 60 );
const int secondsInHour( 3600 );
- QString lengthStr("");
+ QString hour;
+ QString min;
+ QString sec;
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
if ( length > 0 )
{
@@ -70,11 +79,11 @@
{
if(hours == 1)
{
- lengthStr = QObject::tr("%1 hour ").arg(QString::number(hours)); //localisation
+ hour = QObject::tr("%1 hour ").arg(locale.toString(hours)); //localisation
}
else
{
- lengthStr += QObject::tr("%1 hours ").arg(QString::number(hours)); //localisation
+ hour = QObject::tr("%1 hours ").arg(locale.toString(hours)); //localisation
}
}
@@ -82,130 +91,100 @@
{
if(minutes == 1)
{
- lengthStr += QObject::tr("%1 minute ").arg(QString::number(minutes)); //localisation
+ min = QObject::tr("%1 minute ").arg(locale.toString(minutes)); //localisation
}
else
{
- lengthStr += QObject::tr("%1 minutes ").arg(QString::number(minutes)); //localisation
+ min = QObject::tr("%1 minutes ").arg(locale.toString(minutes)); //localisation
}
}
- if (seconds > 0 && hours == 0)
+ if (seconds > 0)
{
if(seconds == 1)
{
- lengthStr += QObject::tr("%1 second").arg(QString::number(seconds)); //localisation
+ sec = QObject::tr("%1 second").arg(locale.toString(seconds)); //localisation
}
else
{
- lengthStr += QObject::tr("%1 seconds").arg(QString::number(seconds)); //localisation
+ sec = QObject::tr("%1 seconds").arg(locale.toString(seconds)); //localisation
}
}
- } else {
- lengthStr += QObject::tr("0 seconds"); //TODO: Localisation
+ }
+ else
+ {
+ sec = QObject::tr("0 seconds"); //localisation
}
- return lengthStr;
+ QString lengthStr(hbTrId( "txt_videos_list_l1_l2_l3" ).arg( hour ).arg( min ).arg( sec ));
+
+ return lengthStr.trimmed();
}
// -----------------------------------------------------------------------------
-// VideoCollectionUtils::prepareLengthStrings()
+// VideoCollectionUtils::prepareShortLengthString()
// -----------------------------------------------------------------------------
//
-const QStringList VideoCollectionUtils::prepareLengthStrings(quint32 total)
+const QString VideoCollectionUtils::prepareShortLengthString(quint32 total)
{
- const int secondsInMinute( 60 );
+ const int secondsInMinute( 60 );
const int secondsInHour( 3600 );
- quint32 hours(0);
- quint32 minutes(0);
- quint32 seconds(0);
-
- QString hrs("");
- QString mins("");
- QString secs("");
+ int hour = total / secondsInHour;
+ total = total % secondsInHour;
+ int minutes = total / secondsInMinute;
+ total = total % secondsInMinute;
+ int second = total;
- if ( total > 0 )
- {
- hours = (total / secondsInHour);
- total = total - (hours * secondsInHour);
- minutes = (total / secondsInMinute);
- seconds = (total % secondsInMinute);
- }
-
- hrs = QString::number(hours);
-
- if (minutes < 10)
- {
- mins = "0" + QString::number(minutes);
-
- }
- else
- {
- mins = QString::number(minutes);
- }
+ QTime time( hour ,minutes ,second );
+ QString str;
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
- if (seconds < 10)
- {
- secs = "0" + QString::number(seconds);
-
- }
- else
- {
- secs = QString::number(seconds);
- }
-
- QStringList retVal;
-
- retVal.append(hrs);
- retVal.append(mins);
- retVal.append(secs);
-
- return retVal;
+ str = locale.format( time, r_qtn_time_durat_long_with_zero );
+
+ return str;
}
-
// -----------------------------------------------------------------------------
// prepareSizeString
// -----------------------------------------------------------------------------
//
QString VideoCollectionUtils::prepareSizeString(quint32 size)
{
+ FUNC_LOG;
const int videoSizeGB( 0x40000000 );
const int videoSizeHalfGB( 0x20000000 );
const int videoSizeMB( 0x100000 );
const int videoSizeHalfMB( 0x80000 );
const int videoSizeKB( 0x400 );
- const int videoSizeHalfKB( 0x200 );
-
+
QString sizeStr("");
if ( size > 0 )
{
quint32 dispSize = 0;
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
if ( size >= videoSizeGB )
{
dispSize = size + videoSizeHalfGB;
dispSize /= videoSizeGB;
- sizeStr = QString(QObject::tr("%1 GB").arg(QString::number(dispSize))); //localisation
+ sizeStr = QString(hbTrId("txt_videos_list_l1_gb").arg(locale.toString(dispSize)));
}
else if ( size >= videoSizeMB )
{
dispSize = size + videoSizeHalfMB;
dispSize /= videoSizeMB;
- sizeStr = QString(QObject::tr("%1 MB").arg(QString::number(dispSize))); //localisation
- }
- else if (size >= videoSizeKB)
- {
- dispSize = size + videoSizeHalfKB;
- dispSize /= videoSizeKB;
- sizeStr = QString(QObject::tr("%1 kB").arg(QString::number(dispSize))); //localisation
+ sizeStr = QString(hbTrId("txt_videos_list_l1_mb").arg(locale.toString(dispSize)));
}
else
{
- sizeStr = QString(QObject::tr("%1B").arg(QString::number(size))); //localisation
+ dispSize = size + videoSizeKB;
+ dispSize /= videoSizeKB;
+ sizeStr = QString(hbTrId("txt_videos_list_l1_kb").arg(locale.toString(dispSize)));
}
}
-
+
return sizeStr;
}
--- a/videocollection/videocollectionwrapper/src/videocollectionwrapper.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,12 +15,15 @@
*
*/
+// Version : %version: %
+
// INCLUDE FILES
#include <qabstractitemmodel.h>
-#include <QDebug>
+
#include "videocollectionwrapper.h"
#include "videocollectionwrapper_p.h"
#include "videosortfilterproxymodel.h"
+#include "videocollectiontrace.h"
// -----------------------------------------------------------------------------
// VideoCollectionWrapper::CVideoCollectionWrapper()
@@ -28,6 +31,7 @@
//
VideoCollectionWrapper &VideoCollectionWrapper::instance()
{
+ FUNC_LOG;
static VideoCollectionWrapper _staticWrapper;
return _staticWrapper;
@@ -41,7 +45,7 @@
d( new VideoCollectionWrapperPrivate ),
mReferenceCount(0)
{
- qDebug() << "CVideoCollectionWrapper::CVideoCollectionWrapper(): Constructing singleton";
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -50,6 +54,7 @@
//
VideoCollectionWrapper::~VideoCollectionWrapper()
{
+ FUNC_LOG;
// NOP
}
@@ -57,8 +62,9 @@
// CVideoCollectionWrapper::getModel()
// -----------------------------------------------------------------------------
//
-VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(int type)
+VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(VideoCollectionCommon::TModelType type)
{
+ FUNC_LOG;
if(d)
{
return d->getModel(type);
@@ -72,6 +78,7 @@
//
void VideoCollectionWrapper::sendAsyncStatus(int statusCode, QVariant &additional)
{
+ FUNC_LOG;
emit asyncStatus(statusCode, additional);
}
--- a/videocollection/videocollectionwrapper/src/videocollectionwrapper_p.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videocollectionwrapper_p.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,17 +15,20 @@
*
*/
+// Version : %version: %
+
// INCLUDE FILES
-
#include <qapplication.h>
#include <qabstractitemmodel.h>
#include <vcxmyvideosdefs.h>
+
#include "videocollectionwrapper.h"
#include "videocollectionwrapper_p.h"
#include "videolistdatamodel.h"
#include "videosortfilterproxymodel.h"
#include "videocollectionclient.h"
#include "videocollectioncommon.h"
+#include "videocollectiontrace.h"
// ================= MEMBER FUNCTIONS =======================
//
@@ -34,12 +37,13 @@
// VideoCollectionWrapperPrivate::VideoCollectionWrapperPrivate()
// -----------------------------------------------------------------------------
//
-VideoCollectionWrapperPrivate::VideoCollectionWrapperPrivate() :
-mAllVideosModel(0),
-mCollectionsModel(0),
-mGenericModel(0),
-mSourceModel(0)
+VideoCollectionWrapperPrivate::VideoCollectionWrapperPrivate()
+ : mAllVideosModel( 0 )
+ , mCollectionsModel( 0 )
+ , mGenericModel( 0 )
+ , mSourceModel( 0 )
{
+ FUNC_LOG;
// NOP
}
@@ -49,6 +53,7 @@
//
VideoCollectionWrapperPrivate::~VideoCollectionWrapperPrivate()
{
+ FUNC_LOG;
// NOP here
}
@@ -57,9 +62,11 @@
// VideoCollectionWrapperPrivate::getModel()
// -----------------------------------------------------------------------------
//
-VideoSortFilterProxyModel* VideoCollectionWrapperPrivate::getModel(int &type)
+VideoSortFilterProxyModel* VideoCollectionWrapperPrivate::getModel(VideoCollectionCommon::TModelType &type)
{
-
+ FUNC_LOG;
+ INFO_1("VideoCollectionWrapperPrivate::getModel() type: %d", type);
+
VideoSortFilterProxyModel *model = 0;
if(!mSourceModel)
{
@@ -67,20 +74,21 @@
if(!mSourceModel || mSourceModel->initialize() < 0 ||
!connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuitSlot())) )
{
+ ERROR(-1, "VideoCollectionWrapperPrivate::getModel() sourceModel setup failed.");
return 0;
}
}
bool needsInitialization = false;
- if(type == VideoCollectionWrapper::EAllVideos)
+ if(type == VideoCollectionCommon::EModelTypeAllVideos)
{
if(!mAllVideosModel)
{
- mAllVideosModel = new VideoSortFilterProxyModel(type);
+ mAllVideosModel = new VideoSortFilterProxyModel(type);
needsInitialization = true;
}
model = mAllVideosModel;
}
- else if(type == VideoCollectionWrapper::ECollections)
+ else if(type == VideoCollectionCommon::EModelTypeCollections)
{
if(!mCollectionsModel)
{
@@ -89,7 +97,7 @@
}
model = mCollectionsModel;
}
- else if(type == VideoCollectionWrapper::ECollectionContent)
+ else if(type == VideoCollectionCommon::EModelTypeCollectionContent)
{
if(!mCollectionContentModel)
{
@@ -98,7 +106,7 @@
}
model = mCollectionContentModel;
}
- else if(type == VideoCollectionWrapper::EGeneric)
+ else if(type == VideoCollectionCommon::EModelTypeGeneric)
{
if(!mGenericModel)
{
@@ -110,12 +118,13 @@
if(needsInitialization)
{
- if(model && model->initialize(mSourceModel) < 0 )
+ if(model && model->initialize(mSourceModel) < 0)
{
+ ERROR(-1, "VideoCollectionWrapperPrivate::getModel() no model or init failed.");
delete model;
return 0;
}
- if (!connect(model, SIGNAL(shortDetailsReady(TMPXItemId)), mSourceModel, SIGNAL(shortDetailsReady(TMPXItemId))))
+ if(!connect(model, SIGNAL(shortDetailsReady(TMPXItemId)), mSourceModel, SIGNAL(shortDetailsReady(TMPXItemId))))
{
delete model;
return 0;
@@ -130,6 +139,7 @@
//
void VideoCollectionWrapperPrivate::aboutToQuitSlot()
{
+ FUNC_LOG;
if(!mSourceModel.isNull())
{
delete mSourceModel;
--- a/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videodatacontainer.cpp Mon May 03 12:32:50 2010 +0300
@@ -11,14 +11,19 @@
*
* Contributors:
*
-* Description: VideoListData class declaration*
+* Description: VideoDataContainer class declaration*
*/
+// Version : %version: %
+
+// INCLUDE FILES
#include <mpxmediageneraldefs.h>
#include <mpxmedia.h>
#include <vcxmyvideosdefs.h>
+
#include "videodatacontainer.h"
#include "videocollectionutils.h"
+#include "videocollectiontrace.h"
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
@@ -30,14 +35,13 @@
return qHash(keyPair);
}
-
// -----------------------------------------------------------------------------
// VideoDataContainer
// -----------------------------------------------------------------------------
//
VideoDataContainer::VideoDataContainer()
{
- // NOP
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -46,6 +50,7 @@
//
VideoDataContainer::~VideoDataContainer()
{
+ FUNC_LOG;
clear();
clearRemoved();
}
@@ -56,6 +61,7 @@
//
void VideoDataContainer::clear()
{
+ FUNC_LOG;
QHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator i = mMediaData.begin();
while(i != mMediaData.end())
{
@@ -101,6 +107,7 @@
// could not get id or id does not match ==> NOP
return;
}
+
QHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator iter = mMediaData.find(mediaId);
// if item is in the removal list, not allowed to append
if(mRemovedMedia.contains(mediaId))
@@ -131,7 +138,6 @@
}
return 0;
}
-
// -----------------------------------------------------------------------------
// indexOfId
@@ -144,7 +150,6 @@
{
return iter->first;
}
-
return -1;
}
@@ -225,6 +230,7 @@
//
int VideoDataContainer::clearRemoved(QList<TMPXItemId> *itemIds)
{
+ FUNC_LOG;
int count = 0;
QList<TMPXItemId> ids;
@@ -259,6 +265,7 @@
//
int VideoDataContainer::restoreRemovedItems(QList<TMPXItemId> *itemIds)
{
+ FUNC_LOG;
int count = 0;
QList<TMPXItemId> ids;
@@ -282,7 +289,7 @@
{
// append data to actual containers and remove item from deleted hash
mMediaIds.append(iter.key());
- mMediaData[iter.key()] = qMakePair(mMediaIds.count() - 1, iter.value());
+ mMediaData[iter.key()] = qMakePair(mMediaIds.count() - 1, iter.value());
mRemovedMedia.remove((*idIter));
count++;
}
@@ -303,7 +310,7 @@
{
return itemIter.value();
}
- return 0;
+ return 0;
}
// end of file
--- a/videocollection/videocollectionwrapper/src/videodeleteworker.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videodeleteworker.cpp Mon May 03 12:32:50 2010 +0300
@@ -14,14 +14,16 @@
* Description: VideoDeleteWorker class implementation
*
*/
-// INCLUDE FILES
+
+// Version : %version: %
+// INCLUDE FILES
#include <qtimer.h>
+
#include "videocollectioncommon.h"
#include "videocollectionclient.h"
#include "videodeleteworker.h"
-
-
+#include "videocollectiontrace.h"
// ================= MEMBER FUNCTIONS =======================
//
@@ -47,6 +49,7 @@
mLastStatus(0),
mLastStatusData(QVariant())
{
+ FUNC_LOG;
}
@@ -56,6 +59,7 @@
//
VideoDeleteWorker::~VideoDeleteWorker()
{
+ FUNC_LOG;
if(mRequestWaitTimer && mRequestWaitTimer->isActive())
{
mRequestWaitTimer->stop();
@@ -71,6 +75,7 @@
//
void VideoDeleteWorker::requestDelete(const QList<TMPXItemId> &indexList)
{
+ FUNC_LOG;
if(!mRequestWaitTimer)
{
mRequestWaitTimer = new QTimer();
@@ -95,6 +100,7 @@
//
int VideoDeleteWorker::removeFromRequest(TMPXItemId &itemId)
{
+ FUNC_LOG;
mRemoveBuffer.remove(itemId);
return mRemoveBuffer.count();
}
@@ -105,6 +111,7 @@
//
bool VideoDeleteWorker::isDeleting()
{
+ FUNC_LOG;
return mRemoveBuffer.count() ? true : false;
}
@@ -114,6 +121,9 @@
//
void VideoDeleteWorker::updateStatus(int status, QVariant data)
{
+ FUNC_LOG;
+ INFO_1("VideoDeleteWorker::updateStatus() status: %d", status);
+
// do not update invalid status
if(status != VideoCollectionCommon::statusDeleteSucceed &&
status != VideoCollectionCommon::statusSingleDeleteFail &&
@@ -159,6 +169,7 @@
//
int VideoDeleteWorker::getLastStatus(QVariant &data)
{
+ FUNC_LOG;
data = mLastStatusData;
return mLastStatus;
}
@@ -169,6 +180,7 @@
//
void VideoDeleteWorker::clearStatus()
{
+ FUNC_LOG;
mLastStatus = 0;
mLastStatusData = QVariant();
}
@@ -179,15 +191,16 @@
//
void VideoDeleteWorker::continueSlot()
{
- if(!mRequestWaitTimer || !mRemoveBuffer.count())
- {
- return;
- }
- if(!mRequestWaitTimer->isActive())
- {
- mRequestWaitTimer->setSingleShot(true);
- mRequestWaitTimer->start(0);
- }
+ FUNC_LOG;
+ if(!mRequestWaitTimer || !mRemoveBuffer.count())
+ {
+ return;
+ }
+ if(!mRequestWaitTimer->isActive())
+ {
+ mRequestWaitTimer->setSingleShot(true);
+ mRequestWaitTimer->start(0);
+ }
}
// -----------------------------------------------------------------------------
@@ -196,6 +209,7 @@
//
void VideoDeleteWorker::execDeleteBlockSlot()
{
+ FUNC_LOG;
if(!mRemoveBuffer.count())
{
return;
@@ -226,6 +240,7 @@
//
void VideoDeleteWorker::flushAll()
{
+ FUNC_LOG;
if(!mRemoveBuffer.count())
{
return;
@@ -234,7 +249,5 @@
mCollectionClient.deleteVideos(&ids);
mRemoveBuffer.clear();
}
-
-
// End of file
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,10 +15,12 @@
*
*/
+// Version : %version: 51 %
+
// INCLUDE FILES
-
#include <hbglobal.h>
#include <vcxmyvideosdefs.h>
+
#include "videolistdatamodel.h"
#include "videolistdatamodel_p.h"
#include "videocollectionclient.h"
@@ -26,6 +28,7 @@
#include "videocollectionutils.h"
#include "videodeleteworker.h"
#include "videocollectionwrapper.h"
+#include "videocollectiontrace.h"
// ================= MEMBER FUNCTIONS =======================
//
@@ -34,13 +37,14 @@
// VideoListDataModel()
// -----------------------------------------------------------------------------
//
-VideoListDataModel::VideoListDataModel(QObject *parent) :
-QAbstractItemModel(parent),
-d_ptr( new VideoListDataModelPrivate(this)),
-mCollectionClient(0),
-mDeleteWorker(0),
-mInitialized(false)
+VideoListDataModel::VideoListDataModel( QObject *parent )
+ : QAbstractItemModel( parent )
+ , d_ptr( new VideoListDataModelPrivate( this ) )
+ , mCollectionClient( 0 )
+ , mDeleteWorker( 0 )
+ , mInitialized( false )
{
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -49,6 +53,7 @@
//
VideoListDataModel::~VideoListDataModel()
{
+ FUNC_LOG;
delete mDeleteWorker;
delete d_ptr;
delete mCollectionClient;
@@ -60,6 +65,7 @@
//
int VideoListDataModel::initialize()
{
+ FUNC_LOG;
if(mInitialized)
{
return 0;
@@ -69,6 +75,7 @@
mCollectionClient = new VideoCollectionClient();
if(!mCollectionClient || mCollectionClient->initialize(d_ptr) < 0)
{
+ ERROR(-1, "VideoListDataModel::initialize() collection client setup failed.");
delete mCollectionClient;
mCollectionClient = 0;
return -1;
@@ -88,11 +95,13 @@
if( d_ptr->initialize() == -1)
{
+ ERROR(-1, "VideoListDataModel::initialize() private model init failed.");
return -1;
}
if(connectSignals() == -1)
{
+ ERROR(-1, "VideoListDataModel::initialize() failed to connect signals.");
disconnectSignals();
return -1;
}
@@ -107,6 +116,7 @@
//
VideoCollectionClient* VideoListDataModel::getCollectionClient()
{
+ FUNC_LOG;
return mCollectionClient;
}
@@ -116,13 +126,14 @@
//
int VideoListDataModel::connectSignals()
{
+ FUNC_LOG;
if(!connect(d_ptr, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))))
{
return -1;
}
- if(!connect(d_ptr, SIGNAL(videoDetailsReady(TMPXItemId)),
- this, SIGNAL(fullVideoDetailsReady(TMPXItemId))))
+ if(!connect(d_ptr, SIGNAL(videoDetailsReady(QVariant&)),
+ this, SIGNAL(fullVideoDetailsReady(QVariant&))))
{
return -1;
}
@@ -149,10 +160,11 @@
//
void VideoListDataModel::disconnectSignals()
{
+ FUNC_LOG;
disconnect(d_ptr, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
- disconnect(d_ptr, SIGNAL(videoDetailsReady(TMPXItemId)),
- this, SIGNAL(fullVideoDetailsReady(TMPXItemId)));
+ disconnect(d_ptr, SIGNAL(videoDetailsReady(QVariant&)),
+ this, SIGNAL(fullVideoDetailsReady(QVariant&)));
disconnect(this, SIGNAL(modelChanged()), mDeleteWorker, SLOT(continueSlot()));
disconnect(this, SIGNAL(modelReady()), mDeleteWorker, SLOT(continueSlot()));
disconnect(mDeleteWorker, SIGNAL(deleteStartupFailed(QList<TMPXItemId>)),
@@ -250,15 +262,9 @@
}
else //video
{
- const QString sizeStr = prepareSizeString(index);
- const QStringList list = prepareLengthStrings( index );
- QString duration;
- duration.append(list.at(0));
- duration.append(":");
- duration.append(list.at(1));
- duration.append(":");
- duration.append(list.at(2));
- retString = hbTrId("txt_videos_dblist_captured_val_1_l1").arg(duration).arg(sizeStr);
+ const QString duration = prepareShortLengthString( index );
+
+ retString = doDetailRow(index, duration);
}
return retString;
}
@@ -299,13 +305,53 @@
}
// -----------------------------------------------------------------------------
-// VideoListDataModel::prepareLengthStrings()
+// VideoListDataModel::prepareShortLengthString()
+// -----------------------------------------------------------------------------
+//
+QString VideoListDataModel::prepareShortLengthString(int index) const
+{
+ quint32 total = d_ptr->getVideodurationFromIndex(index);
+ return VideoCollectionUtils::instance().prepareShortLengthString(total);
+}
+
+// -----------------------------------------------------------------------------
+// VideoListDataModel::doDetailRow()
// -----------------------------------------------------------------------------
//
-QStringList VideoListDataModel::prepareLengthStrings(int index) const
+QString VideoListDataModel::doDetailRow(int index, const QString duration) const
{
- quint32 total = d_ptr->getVideodurationFromIndex(index);
- return VideoCollectionUtils::instance().prepareLengthStrings(total);
+ QString detailStr("");
+
+ quint32 size = d_ptr->getVideoSizeFromIndex(index);
+
+ const int videoSizeGB( 0x40000000 );
+ const int videoSizeHalfGB( 0x20000000 );
+ const int videoSizeMB( 0x100000 );
+ const int videoSizeHalfMB( 0x80000 );
+ const int videoSizeKB( 0x400 );
+
+ quint32 dispSize = 0;
+
+ if ( size >= videoSizeGB )
+ {
+ dispSize = size + videoSizeHalfGB;
+ dispSize /= videoSizeGB;
+ detailStr = hbTrId("txt_videos_dblist_captured_val_l1_l2_gb").arg(duration).arg(QString::number(dispSize));
+ }
+ else if ( size >= videoSizeMB )
+ {
+ dispSize = size + videoSizeHalfMB;
+ dispSize /= videoSizeMB;
+ detailStr = hbTrId("txt_videos_dblist_captured_val_l1_l2_mb").arg(duration).arg(QString::number(dispSize));
+ }
+ else
+ {
+ dispSize = size + videoSizeKB;
+ dispSize /= videoSizeKB;
+ detailStr = hbTrId("txt_videos_dblist_captured_val_l1_l2_kb").arg(duration).arg(QString::number(dispSize));
+ }
+
+ return detailStr;
}
// -----------------------------------------------------------------------------
@@ -316,7 +362,6 @@
{
QVariant returnValue = QVariant();
-
if (index.isValid())
{
int rowIndex = index.row();
@@ -345,19 +390,24 @@
{
quint32 size = d_ptr->getVideoSizeFromIndex(rowIndex);
returnValue = size;
-
}
- else if(role == VideoCollectionCommon::KeyMetaData)
- {
- returnValue = d_ptr->getMetaDataFromIndex(rowIndex);
- }
- else if(role == VideoCollectionCommon::KeyFilePath)
+ else if (role == VideoCollectionCommon::KeyFilePath)
{
QString path = d_ptr->getFilePathFromIndex(rowIndex);
if(!(path.isNull()) && !(path.isEmpty())) {
returnValue = path;
}
}
+ else if (role == VideoCollectionCommon::KeyNumberOfItems)
+ {
+ quint32 numberOfItems = d_ptr->getCategoryVideoCountFromIndex(rowIndex);
+ returnValue = numberOfItems;
+ }
+ else if (role == VideoCollectionCommon::KeyTitle)
+ {
+ QString title = d_ptr->getVideoNameFromIndex(rowIndex);
+ returnValue = title;
+ }
}
return returnValue;
@@ -387,7 +437,6 @@
//
QModelIndex VideoListDataModel::index(int row, int column, const QModelIndex & /*parent*/) const
{
-
if(row >= 0 && row < d_ptr->getVideoCount())
{
return createIndex(row, column);
@@ -411,6 +460,7 @@
//
bool VideoListDataModel::removeRows(const QModelIndexList &indexList)
{
+ FUNC_LOG;
if(!mCollectionClient || !mDeleteWorker)
{
return false;
@@ -466,6 +516,7 @@
//
void VideoListDataModel::setAlbumInUse(TMPXItemId albumId)
{
+ FUNC_LOG;
d_ptr->setAlbumInUse(albumId);
}
@@ -475,6 +526,7 @@
//
TMPXItemId VideoListDataModel::albumInUse()
{
+ FUNC_LOG;
return d_ptr->mCurrentAlbum;
}
@@ -484,11 +536,13 @@
//
int VideoListDataModel::removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items)
{
+ FUNC_LOG;
int removeCount = d_ptr->removeItemsFromAlbum(albumId, items);
if(removeCount)
{
if(mCollectionClient->removeItemsFromAlbum(albumId, items) < 0)
{
+ ERROR(-1, "VideoListDataModel::removeItemsFromAlbum() remove failed.");
return -1;
}
emit albumChanged();
@@ -502,6 +556,7 @@
//
void VideoListDataModel::deleteStartingFailsSlot(QList<TMPXItemId> ids)
{
+ FUNC_LOG;
if(ids.count())
{
d_ptr->restoreRemoved(&ids);
@@ -518,6 +573,7 @@
//
void VideoListDataModel::reportAsyncStatus(int statusCode, QVariant &additional)
{
+ FUNC_LOG;
bool report = true;
if(statusCode == VideoCollectionCommon::statusSingleDeleteFail ||
statusCode == VideoCollectionCommon::statusMultipleDeleteFail ||
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,23 +15,27 @@
*
*/
-// INCLUDE FILES
+// Version : %version: %
+// INCLUDE FILES
+#include <hbglobal.h>
#include <mpxmediageneraldefs.h>
+#include <mpxmediavideodefs.h>
#include <thumbnailmanager_qt.h>
#include <mpxmediaarray.h>
#include <mpxmedia.h>
#include <qvariant.h>
+#include <hbextendedlocale.h>
#include "videolistdatamodel.h"
#include "videocollectionclient.h"
#include "videodeleteworker.h"
-
#include "videolistdatamodel_p.h"
#include "videothumbnaildata.h"
#include "vcxmyvideosdefs.h"
#include "videocollectionutils.h"
#include "videocollectioncommon.h"
+#include "videocollectiontrace.h"
/**
* global qHash function required fo creating hash values for TMPXItemId -keys
@@ -39,7 +43,6 @@
inline uint qHash(TMPXItemId key)
{
QPair<uint, uint> keyPair(key.iId1, key.iId2);
-
return qHash(keyPair);
}
@@ -56,6 +59,7 @@
mInitialized(false),
mCurrentAlbum(TMPXItemId::InvalidId())
{
+ FUNC_LOG;
}
// -----------------------------------------------------------------------------
@@ -64,6 +68,7 @@
//
VideoListDataModelPrivate::~VideoListDataModelPrivate()
{
+ FUNC_LOG;
QHash<TMPXItemId, QSet<TMPXItemId> >::iterator iter = mAlbumData.begin();
while(iter != mAlbumData.end())
{
@@ -80,6 +85,7 @@
//
int VideoListDataModelPrivate::initialize()
{
+ FUNC_LOG;
if(mInitialized)
{
return 0;
@@ -180,9 +186,18 @@
//
quint32 VideoListDataModelPrivate::getVideodurationFromIndex( int index ) const
{
+ CMPXMedia *media = mMediaData.fromIndex(index);
+ return getVideoDuration(media);
+}
+
+// -----------------------------------------------------------------------------
+// getVideodurationFromIndex
+// -----------------------------------------------------------------------------
+//
+quint32 VideoListDataModelPrivate::getVideoDuration(CMPXMedia* media) const
+{
quint32 returnDuration(0);
float duration(0);
- CMPXMedia *media = mMediaData.fromIndex(index);
VideoCollectionUtils::instance().mediaValue<float>(media, KVcxMediaMyVideosDuration, duration );
returnDuration = static_cast<quint32>(duration);
return returnDuration;
@@ -194,9 +209,18 @@
//
QDateTime VideoListDataModelPrivate::getVideoDateFromIndex( int index ) const
{
+ return getVideoDate(mMediaData.fromIndex(index));
+}
+
+// -----------------------------------------------------------------------------
+// getVideoDate
+// -----------------------------------------------------------------------------
+//
+QDateTime VideoListDataModelPrivate::getVideoDate(CMPXMedia* media) const
+{
QDateTime date;
quint64 dateTimeValue;
- if(!VideoCollectionUtils::instance().mediaValue<quint64>(mMediaData.fromIndex(index), KMPXMediaGeneralDate, dateTimeValue))
+ if(!VideoCollectionUtils::instance().mediaValue<quint64>(media, KMPXMediaGeneralDate, dateTimeValue))
{
return date;
}
@@ -207,104 +231,6 @@
}
// -----------------------------------------------------------------------------
-// getMetaDataFromIndex
-// -----------------------------------------------------------------------------
-//
-QMap<QString, QVariant> VideoListDataModelPrivate::getMetaDataFromIndex(int index) const
-{
- using namespace VideoCollectionCommon;
- QMap<QString, QVariant> map;
- CMPXMedia *media = mMediaData.fromIndex(index);
- if(!media) {
- return map;
- }
-
- // MetaKeyDate
- QDateTime date = getVideoDateFromIndex(index);
- if(date.isValid()) {
- map[MetaKeyDate] = date.date();
- }
-
- //TODO: Localisation
- // MetaKeyDurationString
- quint32 dur = getVideodurationFromIndex(index);
- QString duration = VideoCollectionUtils::instance().prepareLengthString(dur);
- if(!duration.isNull() && !duration.isEmpty()) {
- map[MetaKeyDurationString] = duration;
- }
-
- //TODO: Localisation
- // MetaKeySizeString
- quint32 s = getVideoSizeFromIndex(index);
- QString size = VideoCollectionUtils::instance().prepareSizeString(s);
- if(!size.isNull() && !size.isEmpty()) {
- map[MetaKeySizeString] = size;
- }
-
- // MetaKeyStarRating
- quint8 rating = 0;
- if(VideoCollectionUtils::instance().mediaValue<quint8>(media, KVcxMediaMyVideosRating, rating))
- {
- map[MetaKeyStarRating] = rating;
- }
-
- // MetaKeyDRMInfo
-
- // MetaKeyServiceURL
-
- // MetaKeyDescription
- QString desc;
- if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralComment, desc)) {
- map[MetaKeyDescription] = desc;
- }
-
- // MetaKeyModifiedDate
- quint64 dateTimeValue;
- if(VideoCollectionUtils::instance().mediaValue<quint64>(media, KVcxMediaMyVideosModifiedDate, dateTimeValue)) {
- TDateTime temp = TTime( dateTimeValue ).DateTime();
- QDateTime date = QDateTime(QDate(temp.Year(), temp.Month()+1, temp.Day()),
- QTime(temp.Hour(), temp.Minute(), temp.Second(), temp.MicroSecond()));
- map[MetaKeyModifiedDate] = date.date();
- }
-
- // MetaKeyShotLocation
-
- // MetaKeyAuthor
- QString author;
- if(VideoCollectionUtils::instance().mediaValue<QString>(media, KVcxMediaMyVideosAuthor, author)) {
- map[MetaKeyAuthor] = author;
- }
-
- // MetaKeyCopyright
- QString copyright;
- if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralCopyright, copyright)) {
- map[MetaKeyCopyright] = copyright;
- }
-
- // MetaKeyAudioType
-
- // MetaKeyLanguageString
- QString language;
- if(VideoCollectionUtils::instance().mediaValue<QString>(media, KVcxMediaMyVideosAudioLanguage, language)) {
- map[MetaKeyLanguageString] = language;
- }
-
- // MetaKeyKeywords
-
- // MetaKeyVideoResolutionString
-
- // MetaKeyBitRate
-
- // MetaKeyFormat
- QString format;
- if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralMimeType, format)) {
- map[MetaKeyFormat] = format;
- }
-
- return map;
-}
-
-// -----------------------------------------------------------------------------
// markVideosRemoved
// -----------------------------------------------------------------------------
//
@@ -319,6 +245,7 @@
//
void VideoListDataModelPrivate::restoreRemoved(QList<TMPXItemId> *idList)
{
+ FUNC_LOG;
int startIndex = mMediaData.count();
int restored = mMediaData.restoreRemovedItems(idList);
if(restored > 0)
@@ -383,6 +310,7 @@
//
void VideoListDataModelPrivate::setAlbumInUse(TMPXItemId albumId)
{
+ FUNC_LOG;
mCurrentAlbum = albumId;
}
@@ -393,6 +321,7 @@
int VideoListDataModelPrivate::removeItemsFromAlbum(TMPXItemId &albumId,
const QList<TMPXItemId> &items)
{
+ FUNC_LOG;
QHash<TMPXItemId, QSet<TMPXItemId> >::iterator iter = mAlbumData.find(albumId);
if(iter == mAlbumData.end())
{
@@ -431,6 +360,9 @@
CMPXMediaArray *videoArray,
unsigned int startIndex)
{
+ FUNC_LOG;
+ INFO_2("VideoListDataModelPrivate::appendDataToContainerL() array count: %d, start index: %d", videoArray->Count(), startIndex);
+
int count = videoArray->Count();
if (!videoArray ||
startIndex >= count)
@@ -451,7 +383,7 @@
mMediaData.append(newMedia);
newMedia = 0;
}
- }
+ }
}
// -----------------------------------------------------------------------------
@@ -491,6 +423,7 @@
void VideoListDataModelPrivate::albumDataChangedL(TMPXItemId albumId,
CMPXMediaArray *videoArray)
{
+ FUNC_LOG;
if (!videoArray || albumId == TMPXItemId::InvalidId())
{
return;
@@ -503,7 +436,6 @@
int videoCount = videoArray->Count();
CMPXMedia *media = 0;
TMPXItemId id = TMPXItemId::InvalidId();
- QModelIndex index;
for (int i = videoCount - 1; i >= 0; i--)
{
media = videoArray->AtL(i);
@@ -530,8 +462,6 @@
//
void VideoListDataModelPrivate::thumbnailsFetchedSlot(QList<TMPXItemId> mediaIds)
{
- // TODO: find way to optimize dataChanged events
-
TMPXItemId id;
QModelIndex rowIndex;
@@ -552,11 +482,12 @@
//
void VideoListDataModelPrivate::newVideoListSlot( CMPXMediaArray *newVideoList )
{
+ FUNC_LOG;
if( !newVideoList )
{
return;
}
-
+
int startIndex = mMediaData.count();
TRAP_IGNORE(appendDataToContainerL(newVideoList));
@@ -577,6 +508,7 @@
//
void VideoListDataModelPrivate::appendVideoListSlot(CMPXMediaArray* videoList)
{
+ FUNC_LOG;
if(!videoList)
{
return;
@@ -606,6 +538,7 @@
//
void VideoListDataModelPrivate::newVideoAvailableSlot(CMPXMedia *newVideo)
{
+ FUNC_LOG;
if(!newVideo )
{
return;
@@ -641,6 +574,7 @@
//
void VideoListDataModelPrivate::itemDeletedSlot(TMPXItemId itemId)
{
+ FUNC_LOG;
if(itemId == TMPXItemId::InvalidId())
{
return;
@@ -662,6 +596,7 @@
//
void VideoListDataModelPrivate::albumRemoved(TMPXItemId albumId)
{
+ FUNC_LOG;
if (albumId == TMPXItemId::InvalidId() || albumId.iId2 != KVcxMvcMediaTypeAlbum)
{
return;
@@ -705,6 +640,7 @@
//
void VideoListDataModelPrivate::videoDeleted(TMPXItemId videoId)
{
+ FUNC_LOG;
if(videoId == TMPXItemId::InvalidId())
{
return;
@@ -726,7 +662,7 @@
if(index >= 0)
{
q_ptr->beginRemoveRows(QModelIndex(), index, index);
- mMediaData.remove(videoId);
+ mMediaData.remove(videoId);
q_ptr->endRemoveRows();
emit q_ptr->modelChanged();
}
@@ -739,6 +675,7 @@
//
void VideoListDataModelPrivate::videoDeleteCompletedSlot(int overallCount, QList<TMPXItemId> *failedMediaIds)
{
+ FUNC_LOG;
Q_UNUSED(overallCount);
if(!failedMediaIds)
{
@@ -763,7 +700,7 @@
data = failedMediaIds->count();
}
restoreRemoved(failedMediaIds);
- }
+ }
q_ptr->reportAsyncStatus(status, data);
emit q_ptr->modelChanged();
}
@@ -774,6 +711,7 @@
//
void VideoListDataModelPrivate::albumRemoveFailureSlot(QList<TMPXItemId> *failedMediaIds)
{
+ FUNC_LOG;
if(!failedMediaIds)
{
return;
@@ -803,12 +741,124 @@
// VideoDetailsCompleted
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::videoDetailsCompletedSlot(TMPXItemId videoId)
+void VideoListDataModelPrivate::videoDetailsCompletedSlot(CMPXMedia* media)
{
- if(videoId != TMPXItemId::InvalidId())
+ FUNC_LOG;
+ if(!media)
+ {
+ return;
+ }
+
+ using namespace VideoCollectionCommon;
+ QMap<QString, QVariant> map;
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ // MetaKeyDate
+ QDateTime date = getVideoDate(media);
+ if(date.isValid()) {
+ map[MetaKeyDate] = locale.format( date.date(), r_qtn_date_usual );
+ }
+
+ //TODO: Localisation
+ // MetaKeyDurationString
+ quint32 dur = getVideoDuration(media);
+ QString duration = VideoCollectionUtils::instance().prepareLengthString(dur);
+ if(!duration.isNull() && !duration.isEmpty()) {
+ map[MetaKeyDurationString] = duration;
+ }
+
+ //TODO: Localisation
+ // MetaKeySizeString
+ quint32 s;
+ VideoCollectionUtils::instance().mediaValue<quint32>(media, KMPXMediaGeneralSize, s );
+ QString size = VideoCollectionUtils::instance().prepareSizeString(s);
+ if(!size.isNull() && !size.isEmpty()) {
+ map[MetaKeySizeString] = size;
+ }
+
+ // MetaKeyStarRating
+ quint8 rating = 0;
+ if(VideoCollectionUtils::instance().mediaValue<quint8>(media, KVcxMediaMyVideosRating, rating))
{
- emit videoDetailsReady(videoId);
+ map[MetaKeyStarRating] = rating;
+ }
+
+ // MetaKeyDRMInfo
+
+ // MetaKeyServiceURL
+
+ // MetaKeyDescription
+ QString desc;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralComment, desc)) {
+ map[MetaKeyDescription] = desc;
+ }
+
+ // MetaKeyModifiedDate
+ quint64 dateTimeValue;
+ if(VideoCollectionUtils::instance().mediaValue<quint64>(media, KVcxMediaMyVideosModifiedDate, dateTimeValue)) {
+ TDateTime temp = TTime( dateTimeValue ).DateTime();
+ QDateTime date = QDateTime(QDate(temp.Year(), temp.Month()+1, temp.Day()),
+ QTime(temp.Hour(), temp.Minute(), temp.Second(), temp.MicroSecond()));
+ map[MetaKeyModifiedDate] = locale.format( date.date(), r_qtn_date_usual );
+ }
+
+ // MetaKeyShotLocation
+
+ // MetaKeyAuthor
+ QString author;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KVcxMediaMyVideosAuthor, author)) {
+ map[MetaKeyAuthor] = author;
+ }
+
+ // MetaKeyCopyright
+ QString copyright;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralCopyright, copyright)) {
+ map[MetaKeyCopyright] = copyright;
}
+
+ // MetaKeyAudioType
+
+ // MetaKeyLanguageString
+ QString language;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KVcxMediaMyVideosAudioLanguage, language)) {
+ map[MetaKeyLanguageString] = language;
+ }
+
+ // MetaKeyKeywords
+
+ // MetaKeyVideoResolutionString
+ quint16 width;
+ quint16 heigth;
+ if(VideoCollectionUtils::instance().mediaValue<quint16>(media, KMPXMediaVideoWidth, width) &&
+ VideoCollectionUtils::instance().mediaValue<quint16>(media, KMPXMediaVideoHeight, heigth))
+ {
+ map[MetaKeyVideoResolutionString] = hbTrId("txt_videos_list_l1l2").arg(width).arg(heigth);
+ }
+
+ // MetaKeyBitRate
+ qint16 bitrate;
+ if(VideoCollectionUtils::instance().mediaValue<qint16>(media, KMPXMediaVideoBitRate, bitrate))
+ {
+ const char* loc = "txt_videos_list_l1_kbps";
+
+ if(bitrate > 999)
+ {
+ loc = "txt_videos_list_l1_mbps";
+ bitrate = (double)bitrate / (double)1000 + 0.5;
+ }
+
+ map[MetaKeyBitRate] = hbTrId(loc, bitrate);
+ }
+
+ // MetaKeyFormat
+ QString format;
+ if(VideoCollectionUtils::instance().mediaValue<QString>(media, KMPXMediaGeneralMimeType, format)) {
+ map[MetaKeyFormat] = format;
+ }
+
+ QVariant variant = QVariant(map);
+ emit videoDetailsReady(variant);
}
// -----------------------------------------------------------------------------
@@ -818,8 +868,28 @@
void VideoListDataModelPrivate::albumListAvailableSlot(TMPXItemId albumId,
CMPXMediaArray *albumItems)
{
+ FUNC_LOG;
// currently only one album is kept in memory
TRAP_IGNORE(albumDataChangedL(albumId, albumItems));
}
+// -----------------------------------------------------------------------------
+// itemModifiedSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::itemModifiedSlot(const TMPXItemId &itemId)
+{
+ FUNC_LOG;
+ int index = mMediaData.indexOfId(itemId);
+ if(index != -1)
+ {
+ QModelIndex rowIndex = q_ptr->index(index, 0);
+ if(rowIndex.isValid())
+ {
+ emit dataChanged(rowIndex, rowIndex);
+ emit q_ptr->itemModified(itemId);
+ }
+ }
+}
+
// End of file
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,9 @@
*
*/
+// Version : %version: 63 %
+
+// INCLUDE FILES
#include <qstringlist.h>
#include <qset.h>
#include <qtimer.h>
@@ -27,23 +30,26 @@
#include "videolistdatamodel.h"
#include "videocollectionclient.h"
#include "videocollectionwrapper.h"
+#include "videocollectiontrace.h"
// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::VideoSortFilterProxyModel
// -----------------------------------------------------------------------------
//
-VideoSortFilterProxyModel::VideoSortFilterProxyModel(int type, QObject *parent) :
+VideoSortFilterProxyModel::VideoSortFilterProxyModel(VideoCollectionCommon::TModelType type, QObject *parent) :
QSortFilterProxyModel(parent),
mModel(0),
mCollectionClient(0),
mType(type),
-mLevel(-1),
+mLevel(VideoCollectionCommon::ELevelInvalid),
mGenericFilterId(TMPXItemId::InvalidId()),
mGenericFilterValue(false),
mIdleSortTimer(0),
-mWantedSortRole(VideoCollectionCommon::KeyDateTime)
+mWantedSortRole(VideoCollectionCommon::KeyDateTime),
+mWantedSortOrder(Qt::AscendingOrder)
{
- // NOP
+ FUNC_LOG_ADDR(this);
+ INFO_2("VideoSortFilterProxyModel::VideoSortFilterProxyModel() [0x%x]: type: %d", this, type);
}
// -----------------------------------------------------------------------------
@@ -52,7 +58,7 @@
//
VideoSortFilterProxyModel::~VideoSortFilterProxyModel()
{
- // NOP
+ FUNC_LOG_ADDR(this);
}
// -----------------------------------------------------------------------------
@@ -61,6 +67,7 @@
//
int VideoSortFilterProxyModel::initialize(VideoListDataModel *sourceModel)
{
+ FUNC_LOG_ADDR(this);
if(!sourceModel)
{
return -1;
@@ -71,6 +78,7 @@
mModel = sourceModel;
if(!connectSignals())
{
+ ERROR_1(-1, "VideoSortFilterProxyModel::initialize() [0x%x] failed to connect signals.", this);
disconnectSignals();
mModel = 0;
return -1;
@@ -87,6 +95,7 @@
//
bool VideoSortFilterProxyModel::connectSignals()
{
+ FUNC_LOG_ADDR(this);
if(!connect(mModel, SIGNAL(modelReady()),
this, SIGNAL(modelReady())))
{
@@ -97,7 +106,7 @@
{
return false;
}
- if(mType == VideoCollectionWrapper::ECollectionContent)
+ if(mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
if(!connect(mModel, SIGNAL(albumChanged()),
this, SLOT(albumChangedSlot())))
@@ -105,6 +114,14 @@
return false;
}
}
+ if(mType == VideoCollectionCommon::EModelTypeCollections)
+ {
+ if(!connect(mModel, SIGNAL(itemModified(const TMPXItemId &)),
+ this, SLOT(itemModifiedSlot(const TMPXItemId &))))
+ {
+ return false;
+ }
+ }
return true;
}
@@ -114,21 +131,29 @@
//
void VideoSortFilterProxyModel::disconnectSignals()
{
+ FUNC_LOG_ADDR(this);
disconnect(mModel, SIGNAL(modelReady()), this, SIGNAL(modelReady()));
disconnect(mModel, SIGNAL(modelChanged()), this, SIGNAL(modelChanged()));
- if(mType == VideoCollectionWrapper::ECollectionContent)
+ if(mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
disconnect(mModel, SIGNAL(albumChanged()), this, SLOT(albumChangedSlot()));
}
-
+ if(mType == VideoCollectionCommon::EModelTypeCollections)
+ {
+ disconnect(mModel, SIGNAL(itemModified(const TMPXItemId &)),
+ this, SLOT(itemModifiedSlot(const TMPXItemId &)));
+ }
}
// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::open
// -----------------------------------------------------------------------------
//
-int VideoSortFilterProxyModel::open(int level)
+int VideoSortFilterProxyModel::open(VideoCollectionCommon::TCollectionLevels level)
{
+ FUNC_LOG_ADDR(this);
+ INFO_2("VideoSortFilterProxyModel::open() [0x%x] level: %d", this, level);
+
if(!mCollectionClient)
{
return -1;
@@ -136,6 +161,7 @@
if(mLevel != level)
{
+ INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening different level, invalidating.", this);
mLevel = level;
invalidateFilter();
}
@@ -151,12 +177,23 @@
void VideoSortFilterProxyModel::doSorting(int sortingRole, Qt::SortOrder order,
bool async)
{
- if((sortingRole != Qt::DisplayRole) &&
- (sortingRole != VideoCollectionCommon::KeySizeValue) &&
- (sortingRole != VideoCollectionCommon::KeyDateTime))
+ FUNC_LOG_ADDR(this);
+ INFO_3("VideoSortFilterProxyModel::doSorting() [0x%x] sortingRole: %d, order: %d", this, sortingRole, order);
+
+ if(sortingRole != VideoCollectionCommon::KeyTitle &&
+ sortingRole != VideoCollectionCommon::KeySizeValue &&
+ sortingRole != VideoCollectionCommon::KeyDateTime &&
+ sortingRole != VideoCollectionCommon::KeyNumberOfItems)
{
- // default sorting order is by date
- mWantedSortRole = VideoCollectionCommon::KeyDateTime;
+ // default sorting order is by date for other models but collections.
+ if(mType != VideoCollectionCommon::EModelTypeCollections)
+ {
+ mWantedSortRole = VideoCollectionCommon::KeyDateTime;
+ }
+ else
+ {
+ mWantedSortRole = VideoCollectionCommon::KeyTitle;
+ }
}
else
{
@@ -180,7 +217,9 @@
connect(mIdleSortTimer, SIGNAL(timeout()), this, SLOT(processSorting()));
}
mIdleSortTimer->start(0);
- } else {
+ }
+ else
+ {
processSorting();
}
}
@@ -190,6 +229,7 @@
//
void VideoSortFilterProxyModel::getSorting(int &sortingRole, Qt::SortOrder &order)
{
+ FUNC_LOG_ADDR(this);
sortingRole = mWantedSortRole;
order = mWantedSortOrder;
}
@@ -200,6 +240,7 @@
//
int VideoSortFilterProxyModel::deleteItems(const QModelIndexList &indexList)
{
+ FUNC_LOG_ADDR(this);
if(mModel)
{
QModelIndexList mappedList;
@@ -224,6 +265,7 @@
//
int VideoSortFilterProxyModel::openItem(TMPXItemId mediaId)
{
+ FUNC_LOG_ADDR(this);
if(mediaId != TMPXItemId::InvalidId() && mCollectionClient)
{
if(mCollectionClient->openItem(mediaId) == 0)
@@ -232,6 +274,7 @@
{
mLevel = VideoCollectionCommon::ELevelAlbum;
mModel->setAlbumInUse(mediaId);
+ INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening album or category, invalidating.", this);
invalidateFilter();
}
return 0;
@@ -246,6 +289,7 @@
//
int VideoSortFilterProxyModel::back()
{
+ FUNC_LOG_ADDR(this);
if(mCollectionClient && mCollectionClient->back() == 0)
{
if(mLevel == VideoCollectionCommon::ELevelAlbum)
@@ -267,6 +311,7 @@
//
int VideoSortFilterProxyModel::fetchItemDetails(const QModelIndex &index)
{
+ FUNC_LOG_ADDR(this);
// no need to map index beforehand, because
// getMediaIdAtIndex maps it
TMPXItemId mpxId1 = getMediaIdAtIndex(index);
@@ -274,7 +319,6 @@
{
if(mCollectionClient->getVideoDetails(mpxId1) == 0)
{
-
emit shortDetailsReady(mpxId1);
return 0;
}
@@ -288,6 +332,7 @@
//
void VideoSortFilterProxyModel::processSorting()
{
+ FUNC_LOG_ADDR(this);
if(mIdleSortTimer)
{
mIdleSortTimer->stop();
@@ -330,7 +375,7 @@
TMPXItemId rightId = mModel->mediaIdAtIndex(right.row());
// Default categories are always first in the following order:
- // Recently played (missing currently
+ // Recently played (missing currently)
// Captured
// Downloaded
// Podcasts (missing currently)
@@ -368,8 +413,9 @@
}
// Do comparisation based on the role:
- // Qt::DisplayRole,
+ // VideoCollectionCommon::KeyTitle,
// VideoCollectionCommon::KeySizeValue,
+ // VideoCollectionCommon::KeyNumberOfItems,
// VideoCollectionCommon::KeyDateValue
//
// If role does not match, do not sort
@@ -381,13 +427,14 @@
{
return false;
}
- if(sRole == Qt::DisplayRole)
+ if(sRole == VideoCollectionCommon::KeyTitle)
{
- QString leftString = leftData.toStringList().first().toUpper();
- QString rightString = rightData.toStringList().first().toUpper();
+ QString leftString = leftData.toString().toUpper();
+ QString rightString = rightData.toString().toUpper();
return QString::localeAwareCompare(leftString, rightString) < 0;
}
- else if(sRole == VideoCollectionCommon::KeySizeValue)
+ else if(sRole == VideoCollectionCommon::KeySizeValue ||
+ sRole == VideoCollectionCommon::KeyNumberOfItems)
{
quint32 leftSize = leftData.toUInt();
quint32 rightSize = rightData.toUInt();
@@ -412,7 +459,9 @@
Q_UNUSED(source_parent);
if(!sourceModel())
+ {
return false;
+ }
if(source_row < 0 || source_row >= sourceModel()->rowCount())
{
@@ -424,21 +473,21 @@
return false;
}
- if (mType == VideoCollectionWrapper::EAllVideos)
+ if (mType == VideoCollectionCommon::EModelTypeAllVideos)
{
if(id.iId2 == KVcxMvcMediaTypeVideo)
{
return true;
}
}
- else if(mType == VideoCollectionWrapper::ECollections)
+ else if(mType == VideoCollectionCommon::EModelTypeCollections)
{
if(mLevel == VideoCollectionCommon::ELevelCategory && id.iId2 != KVcxMvcMediaTypeVideo)
{
return true;
}
}
- else if (mType == VideoCollectionWrapper::ECollectionContent)
+ else if (mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
// if item belongs to the open album, accept it
if (mModel->belongsToAlbum(id))
@@ -446,7 +495,7 @@
return true;
}
}
- else if(mType == VideoCollectionWrapper::EGeneric)
+ else if(mType == VideoCollectionCommon::EModelTypeGeneric)
{
if(mLevel == VideoCollectionCommon::ELevelVideos && id.iId2 == KVcxMvcMediaTypeVideo)
{
@@ -459,7 +508,6 @@
{
return true;
}
-
}
else if(mLevel == VideoCollectionCommon::ELevelCategory && id.iId2 == KVcxMvcMediaTypeAlbum)
{
@@ -521,6 +569,7 @@
//
TMPXItemId VideoSortFilterProxyModel::addNewAlbum(const QString &title)
{
+ FUNC_LOG_ADDR(this);
TMPXItemId id = TMPXItemId::InvalidId();
if (mCollectionClient)
@@ -537,6 +586,7 @@
//
int VideoSortFilterProxyModel::removeAlbums(const QModelIndexList &indexList)
{
+ FUNC_LOG_ADDR(this);
int err(-1);
if (mCollectionClient)
@@ -569,13 +619,14 @@
QString VideoSortFilterProxyModel::resolveAlbumName(
const QString& albumName) const
{
+ FUNC_LOG_ADDR(this);
QString resolvedName = albumName.trimmed();
// for checking names, we need to use collection list proxy model
// to get all existing album names including default ones
VideoSortFilterProxyModel *collectionModel =
VideoCollectionWrapper::instance().getModel(
- VideoCollectionWrapper::ECollections);
+ VideoCollectionCommon::EModelTypeCollections);
if(!collectionModel || !mModel)
{
return resolvedName;
@@ -588,11 +639,10 @@
// create set of existing names
while (proxyIndex.isValid())
{
- data = mModel->data(collectionModel->mapToSource(proxyIndex), Qt::DisplayRole);
+ data = mModel->data(collectionModel->mapToSource(proxyIndex), VideoCollectionCommon::KeyTitle);
if (data.isValid())
{
- QStringList stringList = data.toStringList();
- names.insert(stringList.at(0));
+ names.insert(data.toString());
}
proxyIndex = collectionModel->index(++i, 0, QModelIndex());
}
@@ -618,6 +668,7 @@
int VideoSortFilterProxyModel::addItemsInAlbum(TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG_ADDR(this);
int err(-1);
if (mCollectionClient)
@@ -636,6 +687,7 @@
int VideoSortFilterProxyModel::removeItemsFromAlbum(TMPXItemId &albumId,
const QList<TMPXItemId> &mediaIds)
{
+ FUNC_LOG_ADDR(this);
int err(-1);
if (mModel)
@@ -645,6 +697,7 @@
if(err > 0)
{
// if there really were items to be removed, invalid filter
+ INFO_1("VideoSortFilterProxyModel::removeItemsFromAlbum() [0x%x] items removed, invaliding.", this);
invalidateFilter();
err = 0;
}
@@ -653,22 +706,41 @@
}
// -----------------------------------------------------------------------------
+// VideoSortFilterProxyModel::renameAlbum()
+// -----------------------------------------------------------------------------
+//
+int VideoSortFilterProxyModel::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+{
+ FUNC_LOG_ADDR(this);
+ int err(-1);
+
+ if(mCollectionClient)
+ {
+ return mCollectionClient->renameAlbum(albumId, newTitle);
+ }
+ return err;
+}
+
+// -----------------------------------------------------------------------------
// VideoSortFilterProxyModel::getOpenItem()
// -----------------------------------------------------------------------------
//
TMPXItemId VideoSortFilterProxyModel::getOpenItem() const
{
+ FUNC_LOG_ADDR(this);
TMPXItemId itemId = TMPXItemId::InvalidId();
if(mModel && mCollectionClient)
{
- if(mType == VideoCollectionWrapper::EAllVideos)
+ if(mType == VideoCollectionCommon::EModelTypeAllVideos)
{
+ INFO_1("VideoSortFilterProxyModel::getOpenItem() [0x%x] all videos is open.", this);
itemId.iId1 = KVcxMvcCategoryIdAll;
- itemId.iId2 = KVcxMvcMediaTypeCategory;
+ itemId.iId2 = KVcxMvcMediaTypeCategory;
}
- else if(mType == VideoCollectionWrapper::ECollectionContent)
+ else if(mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
+ INFO_1("VideoSortFilterProxyModel::getOpenItem() [0x%x] category or album is open.", this);
itemId = mModel->albumInUse();
}
}
@@ -682,10 +754,13 @@
//
void VideoSortFilterProxyModel::setGenericIdFilter(TMPXItemId itemId, bool filterValue)
{
- if(mType == VideoCollectionWrapper::EGeneric)
+ FUNC_LOG_ADDR(this);
+ if(mType == VideoCollectionCommon::EModelTypeGeneric)
{
+ INFO_3("VideoSortFilterProxyModel::setGenericIdFilter() [0x%x] itemId.iId2: %d, filterValue: %d", this, itemId.iId2, filterValue);
mGenericFilterId = itemId;
mGenericFilterValue = filterValue;
+ INFO_1("VideoSortFilterProxyModel::setGenericIdFilter() [0x%x] invalidating.", this);
invalidateFilter();
}
}
@@ -696,8 +771,13 @@
//
void VideoSortFilterProxyModel::setAlbumInUse(TMPXItemId albumId)
{
- mModel->setAlbumInUse(albumId);
- invalidateFilter();
+ FUNC_LOG_ADDR(this);
+ if(mModel)
+ {
+ INFO_1("VideoSortFilterProxyModel::setAlbumInUse() [0x%x] invalidating.", this);
+ mModel->setAlbumInUse(albumId);
+ invalidateFilter();
+ }
}
// -----------------------------------------------------------------------------
@@ -706,12 +786,41 @@
//
void VideoSortFilterProxyModel::albumChangedSlot()
{
+ FUNC_LOG_ADDR(this);
// ignore if not collection content model
- if (mType == VideoCollectionWrapper::ECollectionContent)
+ if (mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
- invalidateFilter();
+ INFO_1("VideoSortFilterProxyModel::albumChangedSlot() [0x%x] invalidating.", this);
+ //otherwise newle created album content won't sort
+ setSortRole(mWantedSortRole);
+ sort(0, mWantedSortOrder);
+ invalidateFilter();
}
}
-// end of file
+// -----------------------------------------------------------------------------
+// VideoSortFilterProxyModel::itemModifiedSlot()
+// -----------------------------------------------------------------------------
+//
+void VideoSortFilterProxyModel::itemModifiedSlot(const TMPXItemId &itemId)
+{
+ FUNC_LOG_ADDR(this);
+ if(mType == VideoCollectionCommon::EModelTypeCollections &&
+ (itemId.iId2 == KVcxMvcMediaTypeAlbum || itemId.iId2 == KVcxMvcMediaTypeCategory))
+ {
+ INFO_1("VideoSortFilterProxyModel::itemModifiedSlot() [0x%x] invalidating.", this);
+ invalidate();
+ }
+}
+// -----------------------------------------------------------------------------
+// VideoSortFilterProxyModel::getType()
+// -----------------------------------------------------------------------------
+//
+VideoCollectionCommon::TModelType VideoSortFilterProxyModel::getType()
+{
+ FUNC_LOG_ADDR(this);
+ return mType;
+}
+
+// End of file
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,10 @@
*
*/
+// Version : %version: %
+
// INCLUDE FILES
+#include "videocollectiontrace.h"
#include "videothumbnaildata.h"
#include "videothumbnaildata_p.h"
@@ -28,6 +31,7 @@
//
VideoThumbnailData &VideoThumbnailData::instance()
{
+ FUNC_LOG;
static VideoThumbnailData _thumbnailData;
return _thumbnailData;
}
@@ -39,6 +43,7 @@
VideoThumbnailData::VideoThumbnailData() :
d_ptr(new VideoThumbnailDataPrivate())
{
+ FUNC_LOG;
connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
}
@@ -49,6 +54,7 @@
//
VideoThumbnailData::~VideoThumbnailData()
{
+ FUNC_LOG;
disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)),
this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
delete d_ptr;
@@ -60,6 +66,7 @@
//
bool VideoThumbnailData::removeThumbnail(TMPXItemId mediaId)
{
+ FUNC_LOG;
return d_ptr->removeThumbnail(mediaId);
}
@@ -69,6 +76,7 @@
//
const QIcon* VideoThumbnailData::getThumbnail(TMPXItemId mediaId)
{
+ FUNC_LOG;
return d_ptr->getThumbnail(mediaId);
}
@@ -78,6 +86,7 @@
//
void VideoThumbnailData::startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex)
{
+ FUNC_LOG;
d_ptr->startBackgroundFetching(model, fetchIndex);
}
@@ -87,6 +96,7 @@
//
void VideoThumbnailData::enableBackgroundFetching(bool enable)
{
+ FUNC_LOG;
d_ptr->enableBackgroundFetching(enable);
}
@@ -96,6 +106,7 @@
//
void VideoThumbnailData::enableThumbnailCreation(bool enable)
{
+ FUNC_LOG;
d_ptr->enableThumbnailCreation(enable);
}
@@ -105,6 +116,7 @@
//
void VideoThumbnailData::freeThumbnailData()
{
+ FUNC_LOG;
d_ptr->freeThumbnailData();
}
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: 20 %
+
// INCLUDE FILES
#include <qapplication.h>
#include <qpixmap.h>
@@ -23,11 +25,13 @@
#include <hbicon.h>
#include <vcxmyvideosdefs.h>
+#include <videocollectioncommon.h>
#include "videothumbnaildata_p.h"
#include "videocollectionwrapper.h"
#include "videosortfilterproxymodel.h"
#include "videothumbnailfetcher.h"
+#include "videocollectiontrace.h"
// Maximum thumbnails kept in memory.
const int THUMBNAIL_CACHE_SIZE = 60;
@@ -58,16 +62,17 @@
// VideoThumbnailDataPrivate::VideoThumbnailDataPrivate()
// -----------------------------------------------------------------------------
//
-VideoThumbnailDataPrivate::VideoThumbnailDataPrivate() :
- mThumbnailFetcher(0),
- mCurrentModel(0),
- mCurrentFetchIndex(0),
- mCurrentBackgroundFetchCount(0),
- mBgFetchTimer(0),
- mTbnReportTimer(0),
- mSignalsConnected(false),
- mBackgroundFetchingEnabled(true)
+VideoThumbnailDataPrivate::VideoThumbnailDataPrivate()
+ : mThumbnailFetcher( 0 )
+ , mCurrentModel( 0 )
+ , mCurrentFetchIndex( 0 )
+ , mCurrentBackgroundFetchCount( 0 )
+ , mBgFetchTimer( 0 )
+ , mTbnReportTimer( 0 )
+ , mSignalsConnected( false )
+ , mBackgroundFetchingEnabled( true )
{
+ FUNC_LOG;
initialize();
}
@@ -77,6 +82,7 @@
//
VideoThumbnailDataPrivate::~VideoThumbnailDataPrivate()
{
+ FUNC_LOG;
cleanup();
}
@@ -86,6 +92,7 @@
//
int VideoThumbnailDataPrivate::initialize()
{
+ FUNC_LOG;
mThumbnailData.setMaxCost(THUMBNAIL_CACHE_SIZE);
if(!mThumbnailFetcher)
@@ -105,6 +112,7 @@
if(connectSignals() < 0)
{
+ ERROR(-1, "VideoThumbnailDataPrivate::initialize() failed to connect signals.");
cleanup();
return -1;
}
@@ -118,6 +126,7 @@
//
void VideoThumbnailDataPrivate::cleanup()
{
+ FUNC_LOG;
disconnectSignals();
delete mThumbnailFetcher;
@@ -146,10 +155,11 @@
//
void VideoThumbnailDataPrivate::disconnectSignals()
{
+ FUNC_LOG;
if(mSignalsConnected)
{
VideoSortFilterProxyModel *model =
- VideoCollectionWrapper::instance().getModel(VideoCollectionWrapper::EAllVideos);
+ VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeAllVideos);
if(model)
{
disconnect(model->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelChangedSlot()));
@@ -171,10 +181,11 @@
//
int VideoThumbnailDataPrivate::connectSignals()
{
+ FUNC_LOG;
if(!mSignalsConnected)
{
VideoSortFilterProxyModel *model =
- VideoCollectionWrapper::instance().getModel(VideoCollectionWrapper::EAllVideos);
+ VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeAllVideos);
if(!model)
return -1;
if(!connect(mThumbnailFetcher, SIGNAL(thumbnailReady( QPixmap , void *, int )),
@@ -220,6 +231,7 @@
//
int VideoThumbnailDataPrivate::startFetchingThumbnails(const QList<QModelIndex> &indexes, int priority)
{
+ FUNC_LOG;
if(!mCurrentModel || !mThumbnailFetcher)
{
return -1;
@@ -265,13 +277,13 @@
QString fileName = mCurrentModel->getMediaFilePathForId(mediaId);
- // object containing media id to be passed throught
- // thumbnail generation process.
- TMPXItemId *internal = new TMPXItemId(mediaId.iId1, mediaId.iId2);
-
// Thumbnail fetcher signals into thumbnailReadySlot when thumbnail ready
if(fileName.length() > 0)
{
+ // object containing media id to be passed throught
+ // thumbnail generation process.
+ TMPXItemId *internal = new TMPXItemId(mediaId.iId1, mediaId.iId2);
+
mThumbnailFetcher->addFetch(fileName, internal, priority);
}
@@ -284,6 +296,7 @@
//
void VideoThumbnailDataPrivate::doBackgroundFetching()
{
+ FUNC_LOG;
if(!mCurrentModel || !mThumbnailFetcher)
{
return;
@@ -335,6 +348,7 @@
//
void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
{
+ FUNC_LOG;
QModelIndex index;
for(int i = startIndex; i < endIndex; i++)
{
@@ -389,6 +403,7 @@
//
void VideoThumbnailDataPrivate::reportThumbnailsReadySlot()
{
+ FUNC_LOG;
emit thumbnailsFetched(mReadyThumbnailMediaIds);
mReadyThumbnailMediaIds.clear();
}
@@ -399,6 +414,7 @@
//
void VideoThumbnailDataPrivate::allThumbnailsFetchedSlot()
{
+ FUNC_LOG;
continueBackgroundFetch();
}
@@ -408,6 +424,7 @@
//
void VideoThumbnailDataPrivate::modelChangedSlot()
{
+ FUNC_LOG;
startBackgroundFetching(mCurrentModel, mCurrentFetchIndex);
}
@@ -438,7 +455,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdAlbum))
{
- mDefaultThumbnails[defaultIdAlbum] = HbIcon(":/icons/default_thumbnail_collection.svg");
+ mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection");
}
return &mDefaultThumbnails[defaultIdAlbum].qicon();
}
@@ -468,7 +485,7 @@
{
if(!mDefaultThumbnails.contains(defaultIdAlbum))
{
- mDefaultThumbnails[defaultIdAlbum] = HbIcon(":/icons/default_thumbnail_collection.svg");
+ mDefaultThumbnails[defaultIdAlbum] = HbIcon("qtg_large_video_collection");
}
return &mDefaultThumbnails[defaultIdAlbum].qicon();
}
@@ -482,6 +499,7 @@
//
bool VideoThumbnailDataPrivate::removeThumbnail(TMPXItemId mediaId)
{
+ FUNC_LOG;
return mThumbnailData.remove(mediaId);
}
@@ -491,6 +509,8 @@
//
void VideoThumbnailDataPrivate::enableBackgroundFetching(bool enable)
{
+ FUNC_LOG;
+ INFO_1("VideoThumbnailDataPrivate::enableBackgroundFetching() enable: %d", enable);
mBackgroundFetchingEnabled = enable;
startBackgroundFetching(mCurrentModel, 0);
}
@@ -501,8 +521,12 @@
//
void VideoThumbnailDataPrivate::enableThumbnailCreation(bool enable)
{
+ FUNC_LOG;
+ INFO_1("VideoThumbnailDataPrivate::enableThumbnailCreation() enable: %d", enable);
if(mThumbnailFetcher)
+ {
mThumbnailFetcher->enableThumbnailCreation(enable);
+ }
}
// -----------------------------------------------------------------------------
@@ -511,15 +535,22 @@
//
void VideoThumbnailDataPrivate::freeThumbnailData()
{
+ FUNC_LOG;
// Stop timers.
if(mBgFetchTimer)
+ {
mBgFetchTimer->stop();
+ }
if(mTbnReportTimer)
+ {
mTbnReportTimer->stop();
+ }
if(mThumbnailFetcher)
+ {
mThumbnailFetcher->cancelFetches();
+ }
// Clear data.
mReadyThumbnailMediaIds.clear();
@@ -533,14 +564,19 @@
//
void VideoThumbnailDataPrivate::startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex)
{
+ FUNC_LOG;
if(!mBackgroundFetchingEnabled || !mThumbnailFetcher)
+ {
return;
+ }
mThumbnailFetcher->cancelFetches();
// If model is null, we continue using the current one.
if(model)
+ {
mCurrentModel = model;
+ }
mCurrentFetchIndex = fetchIndex;
mCurrentBackgroundFetchCount = 0;
@@ -553,8 +589,11 @@
//
void VideoThumbnailDataPrivate::continueBackgroundFetch()
{
+ FUNC_LOG;
if(!mBackgroundFetchingEnabled)
+ {
return;
+ }
if(mBgFetchTimer)
{
@@ -570,6 +609,7 @@
//
void VideoThumbnailDataPrivate::aboutToQuitSlot()
{
+ FUNC_LOG;
cleanup();
}
--- a/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnailfetcher.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,12 +15,14 @@
*
*/
+// Version : %version: %
+
// INCLUDE FILES
-
#include <qpixmap.h>
#include <thumbnailmanager_qt.h>
#include "videothumbnailfetcher.h"
+#include "videocollectiontrace.h"
// ================= MEMBER FUNCTIONS =======================
//
@@ -29,11 +31,12 @@
// VideoThumbnailFetcher::VideoThumbnailFetcher()
// -----------------------------------------------------------------------------
//
-VideoThumbnailFetcher::VideoThumbnailFetcher() :
- mThumbnailManager(0),
- mPaused(false),
- mTbnCreationEnabled(true)
+VideoThumbnailFetcher::VideoThumbnailFetcher()
+ : mThumbnailManager( 0 )
+ , mPaused( false )
+ , mTbnCreationEnabled( true )
{
+ FUNC_LOG;
mThumbnailManager = new ThumbnailManager();
mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailMedium);
mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForPerformance);
@@ -49,6 +52,7 @@
//
VideoThumbnailFetcher::~VideoThumbnailFetcher()
{
+ FUNC_LOG;
cancelFetches();
disconnect(mThumbnailManager, SIGNAL(thumbnailReady( QPixmap , void * , int , int )),
@@ -77,6 +81,7 @@
//
void VideoThumbnailFetcher::continueFetching()
{
+ FUNC_LOG;
mPaused = false;
// First fetch all thumbnails that have been created already, next
@@ -103,8 +108,11 @@
//
void VideoThumbnailFetcher::startThumbnailFetches()
{
+ FUNC_LOG;
if(!mThumbnailManager)
+ {
return;
+ }
// Only fetch those thumbnails that are already been created.
mThumbnailManager->setMode(ThumbnailManager::DoNotCreate);
@@ -137,14 +145,19 @@
//
void VideoThumbnailFetcher::startThumbnailCreation()
{
+ FUNC_LOG;
if(!mThumbnailManager || !mTbnCreationEnabled)
+ {
return;
+ }
mThumbnailManager->setMode(ThumbnailManager::CropToAspectRatio);
// Do nothing if list is empty.
if(mCreationList.isEmpty())
+ {
return;
+ }
// Find fetch with highest priority.
int highestPriority = 0;
@@ -185,6 +198,7 @@
//
void VideoThumbnailFetcher::pauseFetching()
{
+ FUNC_LOG;
mPaused = true;
}
@@ -194,6 +208,7 @@
//
void VideoThumbnailFetcher::cancelFetches()
{
+ FUNC_LOG;
// Clear list of started fetches, thumbnail manager has the internal
// pointer.
QList<int> keys = mStartedFetchList.keys();
@@ -228,6 +243,7 @@
//
void VideoThumbnailFetcher::enableThumbnailCreation(bool enable)
{
+ FUNC_LOG;
mTbnCreationEnabled = enable;
}
@@ -257,12 +273,16 @@
emit thumbnailReady(tnData, internal, error);
if(mStartedFetchList.contains(requestId))
+ {
delete mStartedFetchList.take(requestId);
+ }
}
// Continue the fetching process.
if(!mPaused && mStartedFetchList.isEmpty())
+ {
continueFetching();
+ }
}
// End of file.
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/inc/testvideocollectionclient.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/inc/testvideocollectionclient.h Mon May 03 12:32:50 2010 +0300
@@ -168,6 +168,11 @@
void testRemoveItemsFromAlbum();
/**
+ * verifies renameAlbum
+ */
+ void testRenameAlbum();
+
+ /**
* verifies back -call
*
*/
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/src/testvideocollectionclient.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/src/testvideocollectionclient.cpp Mon May 03 12:32:50 2010 +0300
@@ -593,8 +593,51 @@
mediaIds.append(TMPXItemId(2,2));
mediaIds.append(TMPXItemId(2,1));
- QVERIFY(mTestObject->removeItemsFromAlbum(albumId, mediaIds) < 0);
+ QVERIFY(mTestObject->removeItemsFromAlbum(albumId, mediaIds) < 0);
+}
+
+// -----------------------------------------------------------------------------
+// testRenameAlbum
+// -----------------------------------------------------------------------------
+//
+void TestVideoCollectionClient::testRenameAlbum()
+{
+ MMPXCollection::setCommandLLeave(false);
+
+ QString title = "test";
+ TMPXItemId albumId = TMPXItemId(1, 2);
+
+ // no collectionutility
+ QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+
+ mTestObject->initialize(mSignalReceiver);
+
+ // invalid album id
+ albumId = TMPXItemId::InvalidId();
+ QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ // empty title
+ title = "";
+ QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+
+ // video id
+ title = "test";
+ albumId = TMPXItemId(0, 0);
+ QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+
+ // category id
+ albumId = TMPXItemId(0, 1);
+ QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+
+ // good case
+ albumId = TMPXItemId(0, 2);
+ QVERIFY(mTestObject->renameAlbum(albumId, title) == 0);
+
+ // command leaves
+ albumId = TMPXItemId(1, 2);
+ MMPXCollection::setCommandLLeave(true);
+ QVERIFY(mTestObject->renameAlbum(albumId, title) < 0);
+ MMPXCollection::setCommandLLeave(false);
}
// -----------------------------------------------------------------------------
@@ -603,7 +646,8 @@
//
void TestVideoCollectionClient::testBack()
{
-
+ MMPXCollection::setCommandLLeave(false);
+
CMPXCollectionPath::setLevel(3);
// not initialized
QVERIFY(mTestObject->back() == -1);
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionclient/stub/inc/stubcollectionsignalreceiver.h Mon May 03 12:32:50 2010 +0300
@@ -106,9 +106,9 @@
/**
* No implementation needed for these tests
*/
- void videoDetailsCompletedSlot(TMPXItemId id)
+ void videoDetailsCompletedSlot(CMPXMedia* media)
{
- Q_UNUSED(id);
+ Q_UNUSED(media);
}
/**
@@ -119,7 +119,14 @@
Q_UNUSED(albumId);
Q_UNUSED(albumItems);
}
-
+
+ /**
+ * No implementation needed for these tests
+ */
+ virtual void itemModifiedSlot(const TMPXItemId &itemId)
+ {
+ Q_UNUSED(itemId);
+ }
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/testvideocollectionlistener.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/inc/testvideocollectionlistener.h Mon May 03 12:32:50 2010 +0300
@@ -83,9 +83,22 @@
void testHandleOpenLPlaylistFunc();
/**
- * verifies HandleCommandComplete
+ * verifies HandleCommandComplete with invalid
+ * params
*/
- void testHandleCommandComplete();
+ void testHandleCommandCompleteInvalid();
+
+ /**
+ * verifies HandleCommandComplete (and handleGetVideoDetailsResp) for
+ * KVcxCommandMyVideosGetMediaFullDetailsByMpxId command
+ */
+ void testHandleCommandCompleteGetDetails();
+
+ /**
+ * verifies HandleCommandComplete for
+ * KVcxCommandMyVideosRemoveAlbums command
+ */
+ void testHandleCommandCompleteRemoveAlbums();
/**
* verifies HandleCollectionMessage
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/mediaobjectfactory.cpp Mon May 03 12:32:50 2010 +0300
@@ -73,7 +73,7 @@
TMPXItemId itemId;
itemId.iId1 = id1;
- id2 != 0 ? itemId.iId2 = id2 : itemId.iId2 = id1 + 1;
+ itemId.iId2 = id2;
TRAPD(error, media->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, itemId));
if(error != KErrNone)
{
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/src/testvideocollectionlistener.cpp Mon May 03 12:32:50 2010 +0300
@@ -1,4 +1,3 @@
-
/**
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
@@ -178,21 +177,32 @@
CMPXMediaArray *array = mMediaFactory->newMediaArray();
CMPXMediaArray *arrayToTest = 0;
-
- QWARN("test for other paths than all videos are missing");
+
+ // empty array, no path
+ mMediaFactory->putValuePtr<CMPXMediaArray>(media, KMPXMediaArrayContents, array);
+ mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 );
+ arrayToTest = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
+ QVERIFY(arrayToTest == 0);
+
CMPXCollectionPath* collectionPath = 0;
TRAP_IGNORE(
- collectionPath = CMPXCollectionPath::NewL();
- collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
- collectionPath->AppendL( KVcxMvcCategoryIdAll););
-
- // empty array
- mMediaFactory->putValuePtr<CMPXMediaArray>(media, KMPXMediaArrayContents, array);
+ collectionPath = CMPXCollectionPath::NewL();
+ collectionPath->AppendL( KVcxUidMyVideosMpxCollection ););
+
+ // empty array, path exists level incorrect (new video list, not category neither album level)
mMediaFactory->putValuePtr<CMPXCollectionPath>(media, KMPXMediaGeneralContainerPath, collectionPath);
mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 );
arrayToTest = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
QVERIFY(arrayToTest != 0);
QVERIFY(arrayToTest->Count() == array->Count());
+
+ delete collectionPath;
+ // empty array, path exists level correct
+ collectionPath = 0;
+ TRAP_IGNORE(
+ collectionPath = CMPXCollectionPath::NewL();
+ collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
+ collectionPath->AppendL( KVcxMvcCategoryIdAll););
// array of items from different levels, everything is reported
mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelCategory);
@@ -220,6 +230,14 @@
QVERIFY(arrayToTest != 0);
QVERIFY(arrayToTest->Count() == array->Count());
+ delete collectionPath;
+ collectionPath = 0;
+ TRAP_IGNORE(
+ collectionPath = CMPXCollectionPath::NewL();
+ collectionPath->AppendL( KVcxUidMyVideosMpxCollection );
+ collectionPath->AppendL( KVcxMvcMediaTypeCategory););
+ mMediaFactory->putValuePtr<CMPXCollectionPath>(media, KMPXMediaGeneralContainerPath, collectionPath);
+
mStubCollection->callHandleOpenLFunc(*media, 0, true, 0 );
arrayToTest = static_cast<CMPXMediaArray*>(mSignalReceiver->getLatestPointerAddr());
@@ -302,10 +320,10 @@
}
// -----------------------------------------------------------------------------
-// testHandleCommandComplete
+// testHandleCommandCompleteInvalid
// -----------------------------------------------------------------------------
//
-void TestVideoCollectionListener::testHandleCommandComplete()
+void TestVideoCollectionListener::testHandleCommandCompleteInvalid()
{
User::Heap().__DbgMarkStart();
@@ -315,53 +333,180 @@
// error != KErrNone
mStubCollection->callHandleCommandComplete(pCommand, -2);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// command == NULL
mStubCollection->callHandleCommandComplete(0, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// null command + error != KErrNone
mStubCollection->callHandleCommandComplete(0, -2);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// command without id
delete pCommand;
pCommand = mMediaFactory->newMedia();
mStubCollection->callHandleCommandComplete(pCommand, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// no command attribute
delete pCommand;
pCommand = mMediaFactory->newMedia(0);
mStubCollection->callHandleCommandComplete(pCommand, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// invalid KVcxMediaMyVideosCommandId
int value = (KVcxCommandMyVideosGetMediaFullDetailsByMpxId + 10);
mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
mStubCollection->callHandleCommandComplete(pCommand, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+ delete pCommand;
+
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+
+ int remHeap = User::Heap().__DbgMarkEnd(0);
+ QVERIFY(remHeap == 0);
+}
+
+// -----------------------------------------------------------------------------
+// testHandleCommandCompleteGetDetails
+// -----------------------------------------------------------------------------
+//
+void TestVideoCollectionListener::testHandleCommandCompleteGetDetails()
+{
+ mSignalReceiver->resetLatestItems();
+ User::Heap().__DbgMarkStart();
+ CMPXCommand *pCommand = mMediaFactory->newMedia(0);
+ // cmd KVcxCommandMyVideosGetMediaFullDetailsByMpxId
// no media object in command
+ int value;
value = KVcxCommandMyVideosGetMediaFullDetailsByMpxId;
mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
mStubCollection->callHandleCommandComplete(pCommand, 0);
- QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
- // NOTE! we cannot test with item without KMPXMediaGeneralId, because after creation CMPXMedia
- // always contain default value
-
- // correct item
+ // correct item
+ delete pCommand;
+ pCommand = mMediaFactory->newMedia();
CMPXMedia *subMedia = mMediaFactory->newMedia(10);
+ mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
mMediaFactory->putValuePtr<CMPXMedia>(pCommand, KMPXCommandColAddMedia, subMedia);
mStubCollection->callHandleCommandComplete(pCommand, 0);
- QVERIFY(mSignalReceiver->getLatestItemId().iId1 == 10);
-
+ TMPXItemId itemId = TMPXItemId::InvalidId();
+ TMPXItemId expectedId = TMPXItemId::InvalidId();
+ TRAP_IGNORE(itemId = static_cast<CMPXMedia*>(mSignalReceiver->getLatestPointerAddr())->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+ TRAP_IGNORE(expectedId = subMedia->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId));
+ QVERIFY(itemId == expectedId);
+
delete subMedia;
delete pCommand;
+ int remHeap = User::Heap().__DbgMarkEnd(0);
+ QVERIFY(remHeap == 0);
+}
+
+// -----------------------------------------------------------------------------
+// testHandleCommandCompleteRemoveAlbums
+// -----------------------------------------------------------------------------
+//
+void TestVideoCollectionListener::testHandleCommandCompleteRemoveAlbums()
+{
+ mSignalReceiver->resetLatestItems();
+
+ User::Heap().__DbgMarkStart();
+ CMPXCommand *pCommand = mMediaFactory->newMedia(0);
+
+ int value = KVcxCommandMyVideosRemoveAlbums;
+
+ // no messageArray object in command
+ mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
+ mStubCollection->callHandleCommandComplete(pCommand, 0);
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+ delete pCommand;
+ pCommand = mMediaFactory->newMedia();
+
+ // empty message array
+ mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
+ CMPXMediaArray *array = mMediaFactory->newMediaArray();
+ mMediaFactory->putValuePtr<CMPXMediaArray>(pCommand, KMPXMediaArrayContents, array);
+ mStubCollection->callHandleCommandComplete(pCommand, 0);
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+
+ delete array;
+ delete pCommand;
+ pCommand = mMediaFactory->newMedia();
+
+ // some items, no failed
+ mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
+ CMPXMedia *media1 = mMediaFactory->newMedia(1,0);
+ CMPXMedia *media2 = mMediaFactory->newMedia(2,0);
+ CMPXMedia *media3 = mMediaFactory->newMedia(3,0);
+ array = mMediaFactory->newMediaArray();
+ TRAP_IGNORE(
+ array->AppendL(media1);
+ array->AppendL(media2);
+ array->AppendL(media3););
+
+ mMediaFactory->putValuePtr<CMPXMediaArray>(pCommand, KMPXMediaArrayContents, array);
+ mStubCollection->callHandleCommandComplete(pCommand, 0);
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+ delete array;
+ delete pCommand;
+
+ // some items, one invalid item, no failed
+ array = mMediaFactory->newMediaArray();
+ pCommand = mMediaFactory->newMedia();
+ mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
+ media1 = mMediaFactory->newMedia(1,0);
+ media2 = mMediaFactory->newMedia(2,0);
+ media3 = mMediaFactory->newMedia(3,0);
+ CMPXMedia *media4;
+ TRAP_IGNORE(media4 = CMPXMedia::NewL());
+ TRAP_IGNORE(
+ array->AppendL(media1);
+ array->AppendL(media2);
+ array->AppendL(media3);
+ array->AppendL(media4););
+
+ mMediaFactory->putValuePtr<CMPXMediaArray>(pCommand, KMPXMediaArrayContents, array);
+ mStubCollection->callHandleCommandComplete(pCommand, 0);
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+
+ delete array;
+ delete pCommand;
+
+ // some items, one failed
+ array = mMediaFactory->newMediaArray();
+ pCommand = mMediaFactory->newMedia();
+ mMediaFactory->putTValue<int>(pCommand, KVcxMediaMyVideosCommandId, value );
+ media1 = mMediaFactory->newMedia(1,0);
+ value = 0;
+ mMediaFactory->putTValue<int>(media1, KVcxMediaMyVideosInt32Value, value);
+ media2 = mMediaFactory->newMedia(2,0);
+ value = 1;
+ mMediaFactory->putTValue<int>(media2, KVcxMediaMyVideosInt32Value, value);
+ media3 = mMediaFactory->newMedia(3,0);
+ TRAP_IGNORE(
+ array->AppendL(media1);
+ array->AppendL(media2);
+ array->AppendL(media3););
+
+ mMediaFactory->putValuePtr<CMPXMediaArray>(pCommand, KMPXMediaArrayContents, array);
+ mStubCollection->callHandleCommandComplete(pCommand, 0);
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() != 0);
+ QVERIFY(mSignalReceiver->getLatestListData().count() == 1);
+ QVERIFY(mSignalReceiver->getLatestListData().at(0) == TMPXItemId(2,0));
+ mSignalReceiver->resetLatestItems();
+ delete array;
+ delete pCommand;
+
int remHeap = User::Heap().__DbgMarkEnd(0);
QVERIFY(remHeap == 0);
}
@@ -805,9 +950,30 @@
delete array;
array = mMediaFactory->newMediaArray();
mMediaFactory->putValuePtr<CMPXMediaArray>( message, KMPXMediaArrayContents, array);
+
+ // item(s) does contain KVcxMediaMyVideosInt32Value + one invalid item (== no id) before of that
+ mSignalReceiver->resetLatestItems();
+ CMPXMedia *media = 0;
+ TRAP_IGNORE(media = CMPXMedia::NewL());
+ mMediaFactory->putArrayContent( array, mMediaFactory->newMedia(1));
+ mMediaFactory->putArrayContent( array, media);
+ media = mMediaFactory->newMedia(3);
+ value = 1;
+ mMediaFactory->putTValue<int>( media, KVcxMediaMyVideosInt32Value, value);
+ mMediaFactory->putArrayContent( array, media);
+ mMediaFactory->putValuePtr<CMPXMediaArray>( message, KMPXMessageArrayContents, array);
+ mStubCollection->callHandleCollectionMessage(message, 0);
+ QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+ QVERIFY(mSignalReceiver->getLatestIntegerData() == -1);
+ QVERIFY(mSignalReceiver->getLatestListData().count() == 0);
+
+ delete array;
+ array = mMediaFactory->newMediaArray();
+ mMediaFactory->putValuePtr<CMPXMediaArray>( message, KMPXMediaArrayContents, array);
// item(s) containing KVcxMediaMyVideosInt32Value -values, both incorrect (1) and correct (3)
- CMPXMedia *media = 0;
+
mMediaFactory->putArrayContent( array, mMediaFactory->newMedia(1));
media = mMediaFactory->newMedia(2);
@@ -869,12 +1035,14 @@
// - we're testing only for KMPXMessageGeneral only once, because handleGeneralMPXMessage is already verified
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// invalid
msgId = KMPXMessageIdItemChanged + 1;
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// KMPXMessageIdItemChanged with no content
@@ -883,12 +1051,14 @@
mMediaFactory->putTValue<TMPXMessageId>(message, KMPXMessageGeneralId, msgId);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// KMPXMessageIdItemChanged with level != CVideoCollectionClient::ELevelVideos
mStubCollectionClient->setCollectionLevel(VideoCollectionCommon::ELevelVideos - 1);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// KMPXMessageIdItemChanged with EMPXItemModified event type, no id
@@ -897,6 +1067,7 @@
mMediaFactory->putTValue<TMPXChangeEventType>(message, KMPXMessageChangeEventType, eventType);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// KMPXMessageIdItemChanged with existing with EMPXItemModified event type, iId2 != album
@@ -906,24 +1077,36 @@
mMediaFactory->putTValue<TMPXItemId>(message, KMPXMessageMediaGeneralId, eventId);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == eventId);
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
-
+
// KMPXMessageIdItemChanged with existing with EMPXItemModified event type iId2 == album, not same as opened
eventId.iId1 = 1;
eventId.iId2 = 2;
mMediaFactory->putTValue<TMPXItemId>(message, KMPXMessageMediaGeneralId, eventId);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == eventId);
+ QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
+
+ // KMPXMessageIdItemChanged with existing with EMPXItemModified event type iId2 == category, not same as opened
+ eventId.iId1 = 1;
+ eventId.iId2 = 1;
+ mMediaFactory->putTValue<TMPXItemId>(message, KMPXMessageMediaGeneralId, eventId);
+ mStubCollection->callHandleCollectionMessage(message, 0);
+ QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == eventId);
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// KMPXMessageIdItemChanged with existing with EMPXItemModified event type iId2 == album, same as opened
- eventId.iId1 = 1;
+ eventId.iId1 = 2;
eventId.iId2 = 2;
int callCount = mStubCollectionClient->mOpenItemCallCount;
mStubCollectionClient->openItem(eventId);
QVERIFY(mStubCollectionClient->mOpenItemCallCount == callCount + 1);
mMediaFactory->putTValue<TMPXItemId>(message, KMPXMessageMediaGeneralId, eventId);
mStubCollection->callHandleCollectionMessage(message, 0);
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == eventId);
QVERIFY(mStubCollectionClient->mOpenItemCallCount == callCount + 2);
mSignalReceiver->resetLatestItems();
@@ -935,6 +1118,7 @@
mMediaFactory->putTValue<TMPXItemId>(message, KMPXMessageMediaGeneralId, eventId);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId().iId1 == 10);
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
mSignalReceiver->resetLatestItems();
@@ -946,6 +1130,7 @@
mMediaFactory->putTValue<TMPXChangeEventType>(message, KMPXMessageChangeEventType, eventType);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
// mpx id should have not changed into 10
QVERIFY(mStubCollectionClient->getLatestMPXId() == eventId);
@@ -955,6 +1140,7 @@
mMediaFactory->putTValue<TMPXItemId>(message, KMPXMessageMediaGeneralId, eventId);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() == 0);
QVERIFY(mStubCollectionClient->getLatestMPXId() == eventId);
@@ -964,6 +1150,7 @@
mMediaFactory->putValuePtr<CMPXMedia>(message, KMPXCommandColAddMedia, media);
mStubCollection->callHandleCollectionMessage(message, 0);
QVERIFY(mSignalReceiver->getLatestItemId() == TMPXItemId::InvalidId());
+ QVERIFY(mSignalReceiver->getLatestModifiedItemId() == TMPXItemId::InvalidId());
QVERIFY(mSignalReceiver->getLatestPointerAddr() != 0);
CMPXMedia *gotten = static_cast<CMPXMedia*>(mSignalReceiver->getLatestPointerAddr());
int fetchedId = -1;
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/stubsignalreceiver.h Mon May 03 12:32:50 2010 +0300
@@ -60,6 +60,11 @@
TMPXItemId getLatestItemId();
/**
+ * return mLatestModifiedItemId
+ */
+ TMPXItemId getLatestModifiedItemId();
+
+ /**
* return mLatesListData
*/
QList<TMPXItemId>& getLatestListData();
@@ -102,9 +107,9 @@
void videoDeleteCompletedSlot(int count, QList<TMPXItemId> *failedMediaIds);
/**
- * Saves provided integer to mLatestItemId
+ * Saves provided media to mLatestPtr
*/
- void videoDetailsCompletedSlot(TMPXItemId videoId);
+ void videoDetailsCompletedSlot(CMPXMedia* media);
/**
* Saves provided integer to mLatestItemId and provided pointer to
@@ -123,6 +128,11 @@
*/
void itemDeletedSlot(TMPXItemId id);
+ /**
+ * saves provided item id into mLatestModifiedItemId
+ */
+ virtual void itemModifiedSlot(const TMPXItemId &itemId);
+
private:
/**
* Contains address of latest pointer passed to object
@@ -140,6 +150,11 @@
TMPXItemId mLatestItemId;
/**
+ * contains value if the latest integer passed to object at EMPXItemModified event
+ */
+ TMPXItemId mLatestModifiedItemId;
+
+ /**
* contains contents of list received from signal
*/
QList<TMPXItemId> mLatesListData;
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/videocollectionclient.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/inc/videocollectionclient.h Mon May 03 12:32:50 2010 +0300
@@ -69,7 +69,7 @@
/**
* sets mOpenStatus
*/
- void setOpenStatus(int status);
+ void setOpenStatus(int status, bool startOpening = true);
/**
* sets mLatestItemId
@@ -116,6 +116,8 @@
public:
static int mStartOpenCurrentStateCallCount;
+
+ static bool mSetOpenStatusStartOpening;
};
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/stubsignalreceiver.cpp Mon May 03 12:32:50 2010 +0300
@@ -24,6 +24,7 @@
StubSignalReceiver::StubSignalReceiver() :
mLatestPtr(0),
mLatestItemId(TMPXItemId::InvalidId()),
+mLatestModifiedItemId(TMPXItemId::InvalidId()),
mLatestInteger(-1)
{
@@ -46,6 +47,7 @@
{
mLatestPtr = 0;
mLatestItemId = TMPXItemId::InvalidId();
+ mLatestModifiedItemId = TMPXItemId::InvalidId();
mLatesListData.clear();
mLatestInteger = -1;
}
@@ -60,7 +62,7 @@
}
// -----------------------------------------------------------------------------
-// getLatestInt
+// getLatestItemId
// -----------------------------------------------------------------------------
//
TMPXItemId StubSignalReceiver::getLatestItemId()
@@ -68,6 +70,16 @@
return mLatestItemId;
}
+
+// -----------------------------------------------------------------------------
+// getLatestModifiedItemId
+// -----------------------------------------------------------------------------
+//
+TMPXItemId StubSignalReceiver::getLatestModifiedItemId()
+{
+ return mLatestModifiedItemId;
+}
+
// -----------------------------------------------------------------------------
// getLatestListData
// -----------------------------------------------------------------------------
@@ -157,9 +169,9 @@
// videoDetailsCompletedSlot
// -----------------------------------------------------------------------------
//
-void StubSignalReceiver::videoDetailsCompletedSlot(TMPXItemId videoId)
+void StubSignalReceiver::videoDetailsCompletedSlot(CMPXMedia* media)
{
- mLatestItemId = videoId;
+ mLatestPtr = media;
}
// -----------------------------------------------------------------------------
@@ -183,6 +195,15 @@
}
// -----------------------------------------------------------------------------
+// itemDeletedSlot
+// -----------------------------------------------------------------------------
+//
+void StubSignalReceiver::itemModifiedSlot(const TMPXItemId &itemId)
+{
+ mLatestModifiedItemId = itemId;
+}
+
+// -----------------------------------------------------------------------------
// albumRemoveFailureSlot
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/videocollectionclient.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionlistener/stub/src/videocollectionclient.cpp Mon May 03 12:32:50 2010 +0300
@@ -17,6 +17,7 @@
#include "stub/inc/videocollectionclient.h"
+bool VideoCollectionClient::mSetOpenStatusStartOpening = false;
int VideoCollectionClient::mStartOpenCurrentStateCallCount = 0;
// -----------------------------------------------------------------------------
@@ -81,8 +82,9 @@
// setOpenStatus
// -----------------------------------------------------------------------------
//
-void VideoCollectionClient::setOpenStatus(int status)
+void VideoCollectionClient::setOpenStatus(int status, bool startOpening)
{
+ mSetOpenStatusStartOpening = startOpening;
mOpenStatus = status;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideocollectionwrapper_p/src/testvideocollectionwrapper_p.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideocollectionwrapper_p/src/testvideocollectionwrapper_p.cpp Mon May 03 12:32:50 2010 +0300
@@ -87,11 +87,10 @@
QVERIFY(mTestObject);
VideoSortFilterProxyModel *proxyGotten = 0;
- int type = -1;
// source model init fails
VideoListDataModel::mInitFails = true;
- type = VideoCollectionWrapper::EAllVideos;
+ VideoCollectionCommon::TModelType type = VideoCollectionCommon::EModelTypeAllVideos;
proxyGotten = mTestObject->getModel(type);
QVERIFY(!proxyGotten);
@@ -99,30 +98,23 @@
VideoSortFilterProxyModel::setInitFailure(true);
// VideoCollectionWrapper::EAllvideos -> init fails
- type = VideoCollectionWrapper::EAllVideos;
+ type = VideoCollectionCommon::EModelTypeAllVideos;
proxyGotten = mTestObject->getModel(type);
QVERIFY(!proxyGotten);
// VideoCollectionWrapper::ECollections -> init fails
- type = VideoCollectionWrapper::ECollections;
+ type = VideoCollectionCommon::EModelTypeAllVideos;
proxyGotten = mTestObject->getModel(type);
QVERIFY(!proxyGotten);
// VideoCollectionWrapper::EGeneric -> init fails
- type = VideoCollectionWrapper::EGeneric;
+ type = VideoCollectionCommon::EModelTypeGeneric;
proxyGotten = mTestObject->getModel(type);
QVERIFY(!proxyGotten);
- type = VideoCollectionWrapper::ECollectionContent;
+ type = VideoCollectionCommon::EModelTypeCollectionContent;
proxyGotten = mTestObject->getModel(type);
QVERIFY(!proxyGotten);
-
- // called with invalid type param
- type = -1;
- VideoListDataModel::mInitFails = false;
- proxyGotten = mTestObject->getModel(type);
- QVERIFY(!proxyGotten);
-
}
@@ -135,10 +127,11 @@
QVERIFY(mTestObject);
VideoSortFilterProxyModel *proxyGotten = 0;
- int type = -1;
VideoSortFilterProxyModel::setInitFailure(false);
+ VideoCollectionCommon::TModelType type = VideoCollectionCommon::EModelTypeAllVideos;
+
// VideoCollectionWrapper::EAllvideos
- type = VideoCollectionWrapper::EAllVideos;
+ type = VideoCollectionCommon::EModelTypeAllVideos;
proxyGotten = mTestObject->getModel(type);
QVERIFY(proxyGotten);
QVERIFY(proxyGotten->mType == type);
@@ -149,7 +142,7 @@
proxyGotten = 0;
// VideoCollectionWrapper::ECollections
- type = VideoCollectionWrapper::ECollections;
+ type = VideoCollectionCommon::EModelTypeCollections;
proxyGotten = mTestObject->getModel(type);
QVERIFY(proxyGotten);
QVERIFY(proxyGotten->mType == type);
@@ -160,7 +153,7 @@
proxyGotten = 0;
// VideoCollectionWrapper::EGeneric
- type = VideoCollectionWrapper::EGeneric;
+ type = VideoCollectionCommon::EModelTypeGeneric;
proxyGotten = mTestObject->getModel(type);
QVERIFY(proxyGotten);
QVERIFY(proxyGotten->mType == type);
@@ -171,7 +164,7 @@
proxyGotten = 0;
// VideoCollectionWrapper::ECollectionContent
- type = VideoCollectionWrapper::ECollectionContent;
+ type = VideoCollectionCommon::EModelTypeCollectionContent;
proxyGotten = mTestObject->getModel(type);
QVERIFY(proxyGotten);
QVERIFY(proxyGotten->mType == type);
@@ -180,13 +173,6 @@
QVERIFY(proxyGotten->mType == type);
delete proxyGotten;
proxyGotten = 0;
-
- // called with invalid type param
- type = -1;
- VideoListDataModel::mInitFails = false;
- proxyGotten = mTestObject->getModel(type);
- QVERIFY(!proxyGotten);
-
}
// -----------------------------------------------------------------------------
@@ -199,10 +185,8 @@
connect(this, SIGNAL(testSignal()), mTestObject, SLOT(aboutToQuitSlot()));
VideoSortFilterProxyModel *proxyGotten = 0;
- int type = -1;
-
VideoSortFilterProxyModel::setInitFailure(false);
- type = VideoCollectionWrapper::EAllVideos;
+ VideoCollectionCommon::TModelType type = VideoCollectionCommon::EModelTypeAllVideos;
proxyGotten = mTestObject->getModel(type);
QVERIFY(proxyGotten);
QVERIFY(!mTestObject->mSourceModel.isNull());
@@ -212,7 +196,6 @@
emit testSignal();
QVERIFY(mTestObject->mSourceModel.isNull());
-
disconnect(this, SIGNAL(testSignal()), mTestObject, SLOT(aboutToQuitSlot()));
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/mediaobjectfactory.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/mediaobjectfactory.cpp Mon May 03 12:32:50 2010 +0300
@@ -176,7 +176,7 @@
return false;
}
}
-
+
// set file path
if(detailSelectionFlag & MediaDetailFilePathFlag)
{
@@ -191,7 +191,7 @@
// set video count
if(detailSelectionFlag & MediaDetailCategoryVideoCount)
{
- int count = (index%5);
+ int count = 10 + index;
TRAPD(error, media->SetTObjectValueL<quint32>(KVcxMediaMyVideosCategoryItemCount, count));
if(error != KErrNone)
{
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/testvideolistdatamodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/src/testvideolistdatamodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -389,7 +389,6 @@
mMediaFactory->removeArray();
const int TEST_INDEX = 3;
-
mMediaFactory->createMediaItems(TEST_INDEX + 1);
mTestObjectInitialized->d_ptr->newVideoListSlot(mMediaFactory->mediaArray());
@@ -431,14 +430,12 @@
QVERIFY(data.toInt() == VideoCollectionCommon::StatusNone);
data.clear();
- data = mTestObjectInitialized->data(index, VideoCollectionCommon::KeyMetaData);
- QMap<QString, QVariant> map = data.toMap();
- QVERIFY(map.contains("metadata"));
- QCOMPARE(map["metadata"].toString(), QString("metadata"));
-
- data.clear();
data = mTestObjectInitialized->data(index, VideoCollectionCommon::KeyFilePath);
QCOMPARE(data.toString(), gQTMediaFilePathPrefix + QString::number(TEST_INDEX));
+
+ data.clear();
+ data = mTestObjectInitialized->data(index, VideoCollectionCommon::KeyNumberOfItems);
+ QCOMPARE(data.toUInt(), (uint)(10+TEST_INDEX));
// invalid role
data.clear();
@@ -570,7 +567,6 @@
modelIndex = mTestObjectInitialized->index(MEDIA_COUNT / 2, 0);
result = mTestObjectInitialized->data(modelIndex, Qt::DisplayRole);
QVERIFY (result.toStringList().count() == 2 );
-
// missing both
mMediaFactory->removeArray();
@@ -702,7 +698,7 @@
//
// cannot check the actual strin due localisation
//
- // cannot call prepareLengthStrings directly, need to call indirectly using
+ // cannot call prepareShortLengthString directly, need to call indirectly using
// public data -method. That means:
// - we cannot test without videolistdata -object -case because tested throught data -call and
// existence is tested there already
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videocollectionutils.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videocollectionutils.h Mon May 03 12:32:50 2010 +0300
@@ -127,7 +127,7 @@
/**
* prepares length string
*/
- const QStringList prepareLengthStrings(quint32 total);
+ const QString prepareShortLengthString(quint32 total);
/**
* Prepares size string from the given value.
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/inc/videolistdatamodel_p.h Mon May 03 12:32:50 2010 +0300
@@ -96,7 +96,7 @@
* Not emitted from here but had to be defined in order to
* get stub into use to testable object
*/
- void videoDetailsReady(TMPXItemId index);
+ void videoDetailsReady(QVariant&);
public: // services
@@ -181,15 +181,6 @@
QDateTime getVideoDateFromIndex( int index ) const;
/**
- * Returns the metadata for the video.
- *
- * @param index: item position where client wants the date from.
- * @return QMap map of the QVariants that hold the data. Keys defined
- * in VideoCollectionCommon
- */
- QMap<QString, QVariant> getMetaDataFromIndex(int index) const;
-
- /**
* Returns video status
*
* @param index: item position where client wants the date from.
@@ -303,7 +294,7 @@
* not used in stub
*
*/
- void videoDetailsCompletedSlot(TMPXItemId videoId);
+ void videoDetailsCompletedSlot(CMPXMedia* media);
/**
* not used in stub
@@ -313,6 +304,11 @@
/**
* not used in stub
*/
+ void itemModifiedSlot(const TMPXItemId &itemId);
+
+ /**
+ * not used in stub
+ */
void albumRemoveFailureSlot(QList<TMPXItemId> *items);
/**
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionutils.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionutils.cpp Mon May 03 12:32:50 2010 +0300
@@ -20,6 +20,8 @@
#include <qobject.h>
#include "videocollectionutils.h"
+#include <QTime>
+#include <hbextendedlocale.h>
QString VideoCollectionUtils::mPrepareLengthStringReturnValue = "test duration";
QString VideoCollectionUtils::mPrepareSizeStringReturnValue = "test size";
@@ -110,53 +112,28 @@
}
// -----------------------------------------------------------------------------
-// VideoCollectionUtils::prepareLengthStrings()
+// VideoCollectionUtils::prepareShortLengthString()
// -----------------------------------------------------------------------------
//
-const QStringList VideoCollectionUtils::prepareLengthStrings(quint32 total)
+const QString VideoCollectionUtils::prepareShortLengthString(quint32 total)
{
- const int secondsInMinute( 60 );
+ const int secondsInMinute( 60 );
+ const int secondsInHour( 3600 );
- quint32 minutes(0);
- quint32 seconds(0);
-
- if ( total > 0 )
- {
- minutes = (total / secondsInMinute);
- seconds = (total % secondsInMinute);
- }
-
- QString mins("");
- QString secs("");
-
- if (minutes < 10)
- {
- mins = "0" + QString::number(minutes);
-
- }
- else
- {
- mins = QString::number(minutes);
- }
-
- QString secondsStr("");
-
- if (seconds < 10)
- {
- secs = "0" + QString::number(seconds);
-
- }
- else
- {
- secs = QString::number(seconds);
- }
-
- QStringList retVal;
-
- retVal.append(mins);
- retVal.append(secs);
-
- return retVal;
+ int hour = total / secondsInHour;
+ total = total % secondsInHour;
+ int minutes = total / secondsInMinute;
+ total = total % secondsInMinute;
+ int second = total;
+
+ QTime time( hour ,minutes ,second );
+ QString str;
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ str = locale.format( time, r_qtn_time_durat_long_with_zero );
+
+ return str;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videolistdatamodel_p.cpp Mon May 03 12:32:50 2010 +0300
@@ -255,23 +255,6 @@
}
// -----------------------------------------------------------------------------
-// getMetaDataFromIndex
-// -----------------------------------------------------------------------------
-//
-QMap<QString, QVariant> VideoListDataModelPrivate::getMetaDataFromIndex(int /*index*/) const
-{
- QMap<QString, QVariant> map;
-
- // no need to actually populate the map with real like data, as the datamodel
- // is not responsible in anyway what data the actual map contains. So here we
- // only need to make sure that the map received in test has been gotten by
- // calling this function.
- map["metadata"] = QString("metadata");
-
- return map;
-}
-
-// -----------------------------------------------------------------------------
// getMediaIdFromIndex
// -----------------------------------------------------------------------------
//
@@ -489,9 +472,9 @@
// videoDetailsCompleted
// -----------------------------------------------------------------------------
//
-void VideoListDataModelPrivate::videoDetailsCompletedSlot(TMPXItemId videoId)
+void VideoListDataModelPrivate::videoDetailsCompletedSlot(CMPXMedia* media)
{
- Q_UNUSED(videoId);
+ Q_UNUSED(media);
}
// -----------------------------------------------------------------------------
@@ -506,6 +489,15 @@
}
// -----------------------------------------------------------------------------
+// itemModifiedSlot
+// -----------------------------------------------------------------------------
+//
+void VideoListDataModelPrivate::itemModifiedSlot(const TMPXItemId &itemId)
+{
+ Q_UNUSED(itemId);
+}
+
+// -----------------------------------------------------------------------------
// albumRemoveFailureSlot
// -----------------------------------------------------------------------------
//
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/mediaobjectfactory.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/mediaobjectfactory.h Mon May 03 12:32:50 2010 +0300
@@ -43,7 +43,9 @@
MediaDataLanguage = 0x1000,
MediaDataFormat = 0x2000,
MediaDetailCategoryVideoCount = 0x4000,
- MediaDataAll = 0xffff
+ MediaDataResolution = 0x8000,
+ MediaDataBitrate = 0x10000,
+ MediaDataAll = 0xffffffff
};
// const used for media creation
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/inc/testvideomodel_p.h Mon May 03 12:32:50 2010 +0300
@@ -59,6 +59,11 @@
void signalAlbumListAvailable(TMPXItemId, CMPXMediaArray*);
/**
+ * emitted to verify itemModifiedSlot
+ */
+ void signalItemModified(const TMPXItemId &);
+
+ /**
* emitted to test newVideoAvailableSlot
*/
void signalNewVideoAvailable(CMPXMedia*);
@@ -81,7 +86,7 @@
/**
* emitted to get videoDetailsCompletedSlot to be called.
*/
- void signalVideoDetailsCompleted(TMPXItemId);
+ void signalVideoDetailsCompleted(CMPXMedia*);
// test functions for the test framework
private slots:
@@ -150,21 +155,16 @@
void testGetVideoAgeProfileFromIndex();
/**
- * verifies getVideodurationFromIndex
+ * verifies getVideodurationFromIndex and getVideoDuration
*/
void testGetVideodurationFromIndex();
/**
- * verifies getVideoDateFromIndex
+ * verifies getVideoDateFromIndex and getVideoDate
*/
void testGetVideoDateFromIndex();
/**
- * verifies getMetaDataFromIndex
- */
- void testGetMetaDataFromIndex();
-
- /**
* verifies markVideoRemoved and restoreRemoved
*/
void testVideoMarkAndRestoreDeleted();
@@ -210,6 +210,11 @@
void testAlbumListAvailableSlot();
/**
+ * verifies testItemModifiedSlot
+ */
+ void testItemModifiedSlot();
+
+ /**
* verifies newVideoAvailableSlot
*/
void testNewVideoAvailableSlot();
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/mediaobjectfactory.cpp Mon May 03 12:32:50 2010 +0300
@@ -17,6 +17,7 @@
// INCLUDES
+#include <mpxmediavideodefs.h>
#include <mpxmediageneraldefs.h>
#include <mpxmediaarray.h>
#include <mpxmedia.h>
@@ -93,7 +94,6 @@
mArray = 0;
return;
}
-
TRAPD(error, mArray->AppendL(media));
if(error != KErrNone)
@@ -419,7 +419,39 @@
{
return false;
}
- }
+ }
+
+ // set resolution
+ if(dataSelectionFlags & MediaDataResolution)
+ {
+ int width = index + 1;
+ int height = index + 2;
+
+ TRAPD(error, media->SetTObjectValueL<quint16>(KMPXMediaVideoWidth, width));
+ if(error != KErrNone)
+ {
+ delete media;
+ return false;
+ }
+ TRAP(error, media->SetTObjectValueL<quint16>(KMPXMediaVideoHeight, height));
+ if(error != KErrNone)
+ {
+ delete media;
+ return false;
+ }
+ }
+
+ // set bitrate
+ if(dataSelectionFlags & MediaDataBitrate)
+ {
+ int bitrate = (index+1) * 800;
+ TRAPD(error, media->SetTObjectValueL<qint16>(KMPXMediaVideoBitRate, bitrate));
+ if(error != KErrNone)
+ {
+ delete media;
+ return false;
+ }
+ }
return true;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/src/testvideomodel_p.cpp Mon May 03 12:32:50 2010 +0300
@@ -16,6 +16,8 @@
*/
// INCLUDES
+#include <hbglobal.h>
+#include <hbextendedlocale.h>
#include <mpxmediageneraldefs.h>
#include <mpxmediaarray.h>
#include <mpxmedia.h>
@@ -30,6 +32,7 @@
#include "mediaobjectfactory.h"
#include "videocollectioncommon.h"
#include "videocollectionutils.h"
+#include "metadatasignalspy.h"
#define private public
#include "videolistdatamodel_p.h"
@@ -454,85 +457,6 @@
}
// -----------------------------------------------------------------------------
-// testGetMetaDataFromIndex
-// -----------------------------------------------------------------------------
-//
-void TestVideoModel_p::testGetMetaDataFromIndex()
-{
- using namespace VideoCollectionCommon;
- QMap<QString, QVariant> map = mTestObject->getMetaDataFromIndex(0);
- QVERIFY(map.isEmpty());
- map = mTestObject->getMetaDataFromIndex(-1);
- QVERIFY(map.isEmpty());
-
- mMediaFactory->removeArray();
- QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
- mMediaFactory->createMediaItems(MEDIA_COUNT);
- emit signalNewVideoList(mMediaFactory->copyOfMediaArray());
-
- map = mTestObject->getMetaDataFromIndex(-1);
- QVERIFY(map.isEmpty());
-
- map = mTestObject->getMetaDataFromIndex(-1);
- QVERIFY(map.isEmpty());
-
- map = mTestObject->getMetaDataFromIndex(0);
-
- QVERIFY(map.contains(MetaKeyDate));
- QVERIFY(map.contains(MetaKeyDurationString));
- QVERIFY(map.contains(MetaKeySizeString));
- QVERIFY(map.contains(MetaKeyStarRating));
- QVERIFY(map.contains(MetaKeyDescription));
- QVERIFY(map.contains(MetaKeyModifiedDate));
- QVERIFY(map.contains(MetaKeyAuthor));
- QVERIFY(map.contains(MetaKeyCopyright));
- QVERIFY(map.contains(MetaKeyLanguageString));
- QVERIFY(map.contains(MetaKeyFormat));
-
- // one or several of these will fail, when rest of the metadata is implemented.
- QVERIFY(map.contains(MetaKeyDRMInfo) == false);
- QVERIFY(map.contains(MetaKeyServiceURL) == false);
- QVERIFY(map.contains(MetaKeyShotLocation) == false);
- QVERIFY(map.contains(MetaKeyAudioType) == false);
- QVERIFY(map.contains(MetaKeyKeywords) == false);
- QVERIFY(map.contains(MetaKeyVideoResolutionString) == false);
- QVERIFY(map.contains(MetaKeyBitRate) == false);
-
- QCOMPARE(map[MetaKeyDate].toDate(), QDate(2009, 1, 1));
- QVERIFY(map[MetaKeyDurationString].toString().isEmpty() == false);
- QVERIFY(map[MetaKeySizeString].toString().isEmpty() == false);
- QCOMPARE(map[MetaKeyStarRating].toUInt(), (uint)1);
- QCOMPARE(map[MetaKeyDescription].toString(), gQTMediaDescPrefix + "0");
- QCOMPARE(map[MetaKeyModifiedDate].toDate(), QDate::currentDate().addDays(2));
- QCOMPARE(map[MetaKeyAuthor].toString(), gQTMediaAuthorPrefix + "0");
- QCOMPARE(map[MetaKeyCopyright].toString(), gQTMediaCopyrightPrefix + "0");
- QCOMPARE(map[MetaKeyLanguageString].toString(), gQTMediaLanguagePrefix + "0");
- QCOMPARE(map[MetaKeyFormat].toString(), gQTMediaFormatPrefix + "0");
-
- // data does not exist
- mTestObject->mMediaData.clear();
- mMediaFactory->removeArray();
- mMediaFactory->createMediaItems(MEDIA_COUNT, MediaDataId);
- emit signalNewVideoList(mMediaFactory->copyOfMediaArray());
- VideoCollectionUtils::mPrepareLengthStringReturnValue = "";
- VideoCollectionUtils::mPrepareSizeStringReturnValue = "";
-
- map = mTestObject->getMetaDataFromIndex(-1);
- QVERIFY(map.isEmpty());
-
- map = mTestObject->getMetaDataFromIndex(MEDIA_COUNT);
- QVERIFY(map.isEmpty());
-
- map = mTestObject->getMetaDataFromIndex(0);
- QCOMPARE(map.count(), 0);
-
- map = mTestObject->getMetaDataFromIndex(MEDIA_COUNT - 1);
- QCOMPARE(map.count(), 0);
-
- disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
-}
-
-// -----------------------------------------------------------------------------
// testVideoMarkAndRestoreDeleted
// -----------------------------------------------------------------------------
//
@@ -657,7 +581,7 @@
// data does not exist
mTestObject->mMediaData.clear();
mMediaFactory->removeArray();
- mMediaFactory->createMediaItems(MEDIA_COUNT, MediaDataId);
+ mMediaFactory->createMediaItems(MEDIA_COUNT, MediaDataId);
emit signalNewVideoList(mMediaFactory->copyOfMediaArray());
path = mTestObject->getFilePathForId(TMPXItemId(0,0));
@@ -876,7 +800,7 @@
VideoListDataModel::mLastInserted = -1;
// append null
- emit signalAppendVideoList(0);
+ emit signalAppendVideoList(0);
QVERIFY(VideoListDataModel::mFirstInserted == -1);
QVERIFY(VideoListDataModel::mLastInserted == -1);
QVERIFY(mTestObject->getVideoCount() == 0);
@@ -1012,11 +936,54 @@
}
// -----------------------------------------------------------------------------
+// testItemModifiedSlot
+// -----------------------------------------------------------------------------
+//
+void TestVideoModel_p::testItemModifiedSlot()
+{
+ mMediaFactory->removeArray();
+
+ QVERIFY(connect(this, SIGNAL(signalItemModified(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &))));
+
+ QSignalSpy spysignal(mTestObject, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+
+ // invalid item id, no items
+ TMPXItemId id = TMPXItemId::InvalidId();
+ emit signalItemModified(id);
+ QVERIFY(spysignal.count() == 0);
+
+ // invalid item id, model has items
+ QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
+ mMediaFactory->createMediaItems(MEDIA_COUNT);
+ emit signalNewVideoList(mMediaFactory->copyOfMediaArray());
+
+ emit signalItemModified(id);
+ QVERIFY(spysignal.count() == 0);
+
+ // ok item id, model has items
+ id = TMPXItemId(0, 0);
+ emit signalItemModified(id);
+ QVERIFY(spysignal.count() == 1);
+ spysignal.clear();
+
+ // ok item id, model has items but returns invalid index
+ VideoListDataModel::mIndexReturnsInvalid = true;
+ id = TMPXItemId(0, 0);
+ emit signalItemModified(id);
+ QVERIFY(spysignal.count() == 0);
+ spysignal.clear();
+
+ disconnect(this, SIGNAL(signalItemModified(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
+ VideoListDataModel::mIndexReturnsInvalid = false;
+}
+
+// -----------------------------------------------------------------------------
// testNewVideoAvailableSlot
// -----------------------------------------------------------------------------
//
void TestVideoModel_p::testNewVideoAvailableSlot()
{
+ VideoListDataModel::mIndexReturnsInvalid = false;
QVERIFY(mTestObject->initialize() == 0);
connect(this, SIGNAL(signalNewVideoAvailable(CMPXMedia*)), mTestObject, SLOT(newVideoAvailableSlot(CMPXMedia*)));
@@ -1321,34 +1288,84 @@
// testVideoDetailsCompletedSlot
// -----------------------------------------------------------------------------
//
-
void TestVideoModel_p::testVideoDetailsCompletedSlot()
{
+ using namespace VideoCollectionCommon;
+
mMediaFactory->removeArray();
- QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
- QVERIFY(connect(this, SIGNAL(signalVideoDetailsCompleted(TMPXItemId)), mTestObject, SLOT(videoDetailsCompletedSlot(TMPXItemId))));
+// QVERIFY(connect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*))));
+ QVERIFY(connect(this, SIGNAL(signalVideoDetailsCompleted(CMPXMedia*)), mTestObject, SLOT(videoDetailsCompletedSlot(CMPXMedia*))));
+
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ MetaDataSignalSpy spysignal(mTestObject, SIGNAL(videoDetailsReady(QVariant&)));
+
+ // check with NULL media.
+ emit signalVideoDetailsCompleted(0);
+ QCOMPARE(spysignal.count, 0);
+
+ // setup medias.
+ mMediaFactory->createMediaItems(2);
+ CMPXMedia* media = mMediaFactory->mediaArray()->operator [](0);
- QSignalSpy spysignal(mTestObject, SIGNAL(videoDetailsReady(TMPXItemId)));
-
- // no videos, id ok
- emit signalVideoDetailsCompleted(TMPXItemId(0,0));
- QVERIFY(spysignal.count() == 1);
- spysignal.clear();
+ // ok case
+ emit signalVideoDetailsCompleted(media);
+ QCOMPARE(spysignal.count, 1);
+ QMap<QString, QVariant> map = spysignal.arg.toMap();
+
+ QVERIFY(map.contains(MetaKeyDate));
+ QVERIFY(map.contains(MetaKeyDurationString));
+ QVERIFY(map.contains(MetaKeySizeString));
+ QVERIFY(map.contains(MetaKeyStarRating));
+ QVERIFY(map.contains(MetaKeyDescription));
+ QVERIFY(map.contains(MetaKeyModifiedDate));
+ QVERIFY(map.contains(MetaKeyAuthor));
+ QVERIFY(map.contains(MetaKeyCopyright));
+ QVERIFY(map.contains(MetaKeyLanguageString));
+ QVERIFY(map.contains(MetaKeyFormat));
+ QVERIFY(map.contains(MetaKeyVideoResolutionString));
+ QVERIFY(map.contains(MetaKeyBitRate));
- mMediaFactory->createMediaItems(MEDIA_COUNT);
- emit signalNewVideoList(mMediaFactory->copyOfMediaArray());
+ // one or several of these will fail, when rest of the metadata is implemented.
+ QVERIFY(map.contains(MetaKeyDRMInfo) == false);
+ QVERIFY(map.contains(MetaKeyServiceURL) == false);
+ QVERIFY(map.contains(MetaKeyShotLocation) == false);
+ QVERIFY(map.contains(MetaKeyAudioType) == false);
+ QVERIFY(map.contains(MetaKeyKeywords) == false);
- // invalid id
- emit signalVideoDetailsCompleted(TMPXItemId::InvalidId());
- QVERIFY(spysignal.count() == 0);
+ QCOMPARE(map[MetaKeyDate].toString(), locale.format(QDate(2009, 1, 1), r_qtn_date_usual));
+ QVERIFY(map[MetaKeyDurationString].toString().isEmpty() == false);
+ QVERIFY(map[MetaKeySizeString].toString().isEmpty() == false);
+ QCOMPARE(map[MetaKeyStarRating].toUInt(), (uint)1);
+ QCOMPARE(map[MetaKeyDescription].toString(), gQTMediaDescPrefix + "0");
+ QCOMPARE(map[MetaKeyModifiedDate].toString(), locale.format(QDate::currentDate().addDays(2), r_qtn_date_usual));
+ QCOMPARE(map[MetaKeyAuthor].toString(), gQTMediaAuthorPrefix + "0");
+ QCOMPARE(map[MetaKeyCopyright].toString(), gQTMediaCopyrightPrefix + "0");
+ QCOMPARE(map[MetaKeyLanguageString].toString(), gQTMediaLanguagePrefix + "0");
+ QCOMPARE(map[MetaKeyFormat].toString(), gQTMediaFormatPrefix + "0");
+ QCOMPARE(map[MetaKeyVideoResolutionString].toString(), hbTrId("txt_videos_list_l1l2").arg(1).arg(2));
+ QCOMPARE(map[MetaKeyBitRate].toString(), hbTrId("txt_videos_list_l1_kbps", 800));
- // correct ids
- emit signalVideoDetailsCompleted(TMPXItemId(0,0));
- QVERIFY(spysignal.count() == 1);
- QVERIFY(spysignal.value(0).at(0).toInt() == 0);
+ // Mbps case
+ media = mMediaFactory->mediaArray()->operator [](1);
+ emit signalVideoDetailsCompleted(media);
+ QCOMPARE(spysignal.count, 2);
+ map = spysignal.arg.toMap();
+ QVERIFY(map.contains(MetaKeyBitRate));
+ QCOMPARE(map[MetaKeyBitRate].toString(), hbTrId("txt_videos_list_l1_mbps", 2));
+
+ // empty media case
spysignal.clear();
- emit signalVideoDetailsCompleted(TMPXItemId(MEDIA_COUNT - 1,0));
- QVERIFY(spysignal.count() == 1);
+ mMediaFactory->removeArray();
+ mMediaFactory->createMediaItems(1, MediaDataId);
+ CMPXMedia* emptyMedia = mMediaFactory->mediaArray()->operator [](0);
+
+ emit signalVideoDetailsCompleted(emptyMedia);
+ QCOMPARE(spysignal.count, 1);
+ map = spysignal.arg.toMap();
+ QCOMPARE(map.count(), 2);
+ QVERIFY(map.contains(MetaKeyDurationString));
+ QVERIFY(map.contains(MetaKeySizeString));
disconnect(this, SIGNAL(signalNewVideoList(CMPXMediaArray*)), mTestObject, SLOT(newVideoListSlot(CMPXMediaArray*)));
disconnect(this, SIGNAL(signalVideoDetailsCompleted(TMPXItemId)), mTestObject, SLOT(videoDetailsCompletedSlot(TMPXItemId)));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/metadatasignalspy.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: helper class to go around a bug in QSignalSpy.
+*/
+
+#ifndef __METADATASIGNALSPY_H
+#define __METADATASIGNALSPY_H
+
+#include <qobject.h>
+#include <qvariant.h>
+
+class MetaDataSignalSpy : QObject
+{
+ Q_OBJECT
+
+public:
+ MetaDataSignalSpy(QObject* testObject, const char *signal)
+ {
+ count = 0;
+ connect(testObject, signal, this, SLOT(detailsReady(QVariant&)));
+ }
+
+ virtual ~MetaDataSignalSpy() {}
+
+ void clear()
+ {
+ arg = QVariant();
+ count = 0;
+ }
+
+private slots:
+ void detailsReady(QVariant& arg)
+ {
+ count++;
+ this->arg = arg;
+ }
+
+public:
+ int count;
+ QVariant arg;
+};
+
+
+#endif // __METADATASIGNALSPY_H
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videolistdatamodel.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/inc/videolistdatamodel.h Mon May 03 12:32:50 2010 +0300
@@ -30,7 +30,7 @@
*/
Q_DISABLE_COPY(VideoListDataModel)
- friend class VideoListDataModelPrivate;
+ friend class VideoListDataModelPrivate;
public:
@@ -104,6 +104,10 @@
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const
{
Q_UNUSED(parent);
+ if(mIndexReturnsInvalid)
+ {
+ return QModelIndex();
+ }
return createIndex(row, column);
}
@@ -139,6 +143,12 @@
mStatus = status;
mStatusData = data;
}
+
+ void itemModified(const TMPXItemId itemId)
+ {
+ mModifiedItemId = itemId;
+ }
+
/**
* dummy collectionclient
*/
@@ -178,10 +188,17 @@
* setted in reportAsyncStatus
*/
static QVariant mStatusData;
+
+ /**
+ * setted in itemModified
+ */
+ static TMPXItemId mModifiedItemId;
+
+ /**
+ * Flag if index() should return invalid index.
+ */
+ static bool mIndexReturnsInvalid;
};
#endif // __STUBTESTMODEL_H__
// End of file
-
-
-
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videocollectionutils.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videocollectionutils.cpp Mon May 03 12:32:50 2010 +0300
@@ -58,6 +58,7 @@
//
QString VideoCollectionUtils::prepareLengthString(quint32 length)
{
+ Q_UNUSED(length);
return mPrepareLengthStringReturnValue;
}
@@ -67,6 +68,7 @@
//
QString VideoCollectionUtils::prepareSizeString(quint32 size)
{
+ Q_UNUSED(size);
return mPrepareSizeStringReturnValue;
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videodatacontainer.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videodatacontainer.cpp Mon May 03 12:32:50 2010 +0300
@@ -71,8 +71,8 @@
//
void VideoDataContainer::remove(const TMPXItemId &id)
{
- QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator removeIter = mMediaData.constFind(id);
- if(removeIter == mMediaData.constEnd())
+ QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::iterator removeIter = mMediaData.find(id);
+ if(removeIter == mMediaData.end())
{
return;
}
@@ -146,11 +146,10 @@
int VideoDataContainer::indexOfId(const TMPXItemId &id) const
{
QMultiHash<TMPXItemId, QPair<int, CMPXMedia*> >::const_iterator iter = mMediaData.find(id);
- if( iter != mMediaData.constEnd())
+ if(iter != mMediaData.constEnd())
{
return iter->first;
}
-
return -1;
}
@@ -263,12 +262,12 @@
ids = *itemIds;
}
- QList<TMPXItemId>::const_iterator idIter = ids.constBegin();
+ QList<TMPXItemId>::const_iterator idIter = ids.begin();
QHash<TMPXItemId, CMPXMedia*>::iterator iter;
- while(idIter != ids.constEnd())
+ while(idIter != ids.end())
{
iter = mRemovedMedia.find((*idIter));
- if(iter != mRemovedMedia.constEnd() && !mMediaData.contains(iter.key()))
+ if(iter != mRemovedMedia.end() && !mMediaData.contains(iter.key()))
{
mMediaIds.append(iter.key());
mMediaData.insert(iter.key(), qMakePair(mMediaIds.count() - 1, iter.value()));
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videolistdatamodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videolistdatamodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -33,4 +33,8 @@
int VideoListDataModel::mLastRemoved = -1;
+TMPXItemId VideoListDataModel::mModifiedItemId = TMPXItemId::InvalidId();
+
+bool VideoListDataModel::mIndexReturnsInvalid = false;
+
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videothumbnaildata.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/stub/src/videothumbnaildata.cpp Mon May 03 12:32:50 2010 +0300
@@ -133,6 +133,8 @@
//
int VideoThumbnailData::startFetchingThumbnail( int mediaId, int priority )
{
+ Q_UNUSED(mediaId);
+ Q_UNUSED(priority);
gStartFetchingCounter++;
if(gFailFetchTn)
{
@@ -158,6 +160,7 @@
//
int VideoThumbnailData::removeThumbnail( TMPXItemId mediaId )
{
+ Q_UNUSED(mediaId);
gRemoveCounter++;
if(gFailRemoveTn)
{
--- a/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/testvideomodel_p.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel_p/testvideomodel_p.pro Mon May 03 12:32:50 2010 +0300
@@ -25,7 +25,8 @@
-lfbscli.dll -lbitgdi.dll -lgdi.dll
# Input
-HEADERS += stub/inc/videolistdatamodel.h \
+HEADERS += stub/inc/metadatasignalspy.h \
+ stub/inc/videolistdatamodel.h \
stub/inc/videocollectionwrapper.h \
stub/inc/videocollectionutils.h \
stub/inc/videodatacontainer.h \
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/inc/testvideosortfilterproxymodel.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/inc/testvideosortfilterproxymodel.h Mon May 03 12:32:50 2010 +0300
@@ -21,6 +21,7 @@
// INCLUDES
#include <QtTest/QtTest>
+#include <mpxitemid.h>
class VideoListDataModel;
class FilterProxyTester;
@@ -34,11 +35,17 @@
// test functions for the test framework
signals:
+
/**
* test signal
*/
void testSignal();
+ /**
+ * test signal
+ */
+ void testSignalMpxId(const TMPXItemId &id);
+
private slots:
/**
@@ -112,11 +119,6 @@
* Test back with valid data.
*/
void testBack();
-
- /**
- * Test back when videocollectionclient is null.
- */
- void testBackClientNull();
/**
* Test fetchItemDetails with valid data.
@@ -157,6 +159,12 @@
void testLessThanDateTime();
/**
+ * Calls less than with media objects of combined default / user created
+ * collections
+ */
+ void testLessThanDefaults();
+
+ /**
* Calls sure lessThan with invalid role,
* same indexes and for invalid data
* tests that return values are correct for presetted items
@@ -170,11 +178,18 @@
void testDoSorting();
/**
- * Calls filterAcceptsRow.
- * Tests that return values are correct with items with varying statuses.
+ * Calls filterAcceptsRow. using type EAllVideos for model
+ * Tests that return values are correct with items with varying statuses.
*
*/
- void testFilterAcceptsRow();
+ void testFilterAcceptsRowVideos();
+
+ /**
+ * Calls filterAcceptsRow. using type differ than EAllVideos for model
+ * Tests that return values are correct with items with varying statuses.
+ *
+ */
+ void testFilterAcceptsNoVideoTypes();
/**
* Test getMediaFilePathForId.
@@ -231,6 +246,21 @@
*/
void testSetGenericIdFilter();
+ /**
+ * tests setAlbumInUse
+ */
+ void testSetAlbumInUse();
+
+ /**
+ * tests renameAlbum
+ */
+ void testRenameAlbum();
+
+ /**
+ * tests itemModifiedSlot
+ */
+ void testItemModifiedSlot();
+
private:
/**
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/src/testvideosortfilterproxymodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -19,14 +19,18 @@
#include <QModelIndexList>
#include <hbapplication.h>
+#define private public
+#include "videosortfilterproxymodel.h"
+#undef private
+
#include "videocollectionwrapper.h"
#include "videocollectioncommon.h"
#include "testvideosortfilterproxymodel.h"
-#include "filterproxytester.h"
#include "videolistdatamodel.h"
#include "videocollectionclient.h"
#include "videocollectioncommon.h"
#include "videothumbnaildata.h"
+#include "filterproxytester.h"
// ---------------------------------------------------------------------------
// main
@@ -55,7 +59,6 @@
return res;
}
-
// ---------------------------------------------------------------------------
// init
// ---------------------------------------------------------------------------
@@ -77,7 +80,7 @@
VideoCollectionClient::mAddNewCollectionIds = QList<TMPXItemId>();
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject = new FilterProxyTester(VideoCollectionWrapper::EGeneric);
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeGeneric);
QVERIFY(mTestObject);
mStubModel = new VideoListDataModel();
@@ -86,7 +89,7 @@
mCollectionClient = new VideoCollectionClient();
QVERIFY(mCollectionClient);
- mCollectionModel = new VideoSortFilterProxyModel(VideoCollectionWrapper::ECollections);
+ mCollectionModel = new VideoSortFilterProxyModel(VideoCollectionCommon::EModelTypeAllVideos);
}
// ---------------------------------------------------------------------------
@@ -143,17 +146,17 @@
void TestVideoSortFilterProxyModel::testOpen()
{
// no mCollectionClient
- QVERIFY(mTestObject->open(1) == -1);
+ QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelInvalid) == -1);
mTestObject->initialize(mStubModel);
// First open.
- QVERIFY(mTestObject->open(1) == 0);
+ QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelVideos) == 0);
// Open again with same level.
- QVERIFY(mTestObject->open(1) == 0);
+ QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelVideos) == 0);
// Fail open.
VideoCollectionClient::mFailStartOpen = true;
- QVERIFY(mTestObject->open(20) == -1);
+ QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelVideos) == -1);
}
// ---------------------------------------------------------------------------
@@ -178,11 +181,11 @@
mStubModel->appendData(name5); // to source model index 4, proxy index after sort 1
// sort to make sure that list order is different compared to source model
- mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder);
// need to wait for awhile to make sure zero-counter gets
// processing time.
QTest::qWait(500);
- QVERIFY(mTestObject->sortRole() == Qt::DisplayRole);
+ QVERIFY(mTestObject->sortRole() == VideoCollectionCommon::KeyTitle);
int count = mTestObject->rowCount();
QModelIndexList list;
@@ -214,7 +217,6 @@
list.append(index);
QVERIFY(mTestObject->deleteItems(list) == -1);
-
}
// ---------------------------------------------------------------------------
@@ -305,7 +307,6 @@
// open category or album
itemId = TMPXItemId(1,2);
QVERIFY(mTestObject->openItem(itemId) == 0);
-
}
// ---------------------------------------------------------------------------
@@ -314,30 +315,20 @@
//
void TestVideoSortFilterProxyModel::testBack()
{
-
- QVERIFY(mTestObject->initialize(mStubModel) == 0);
+ QVERIFY(mTestObject->back() == -1);
+
+ QVERIFY(mTestObject->initialize(mStubModel) == 0);
QVERIFY(mTestObject->back() == 0);
mTestObject->open(VideoCollectionCommon::ELevelAlbum);
QVERIFY(mTestObject->back() == 0);
-}
-
-// ---------------------------------------------------------------------------
-// testBack
-// ---------------------------------------------------------------------------
-//
-void TestVideoSortFilterProxyModel::testBackClientNull()
-{
-
- QVERIFY(mTestObject->initialize(mStubModel) == 0);
- VideoCollectionClient *tmpCollectionClient = mTestObject->getClient();
- mTestObject->setClient(0);
-
+ // back fails
+ VideoCollectionClient::mBackReturnValue = -1;
QVERIFY(mTestObject->back() == -1);
-
- mTestObject->setClient(tmpCollectionClient);
+
+ VideoCollectionClient::mBackReturnValue = 0;
}
// ---------------------------------------------------------------------------
@@ -349,7 +340,7 @@
VideoCollectionClient::mFailStartOpen = false;
mStubModel->appendData("Test");
QVERIFY(mTestObject->initialize(mStubModel) == 0);
- mTestObject->open(3);
+ mTestObject->open(VideoCollectionCommon::ELevelVideos);
QSignalSpy fetchSpy(mTestObject, SIGNAL(shortDetailsReady(TMPXItemId)));
QModelIndex index = mTestObject->index(0, 0);
@@ -362,6 +353,12 @@
QVERIFY(arguments.at(0).toInt() == 0);
arguments.clear();
fetchSpy.clear();
+
+ // no collection client
+ VideoCollectionClient *tmp = mTestObject->mCollectionClient;
+ mTestObject->mCollectionClient = 0;
+ QVERIFY(mTestObject->fetchItemDetails(index) == -1);
+ mTestObject->mCollectionClient = tmp;
}
// ---------------------------------------------------------------------------
@@ -371,15 +368,15 @@
void TestVideoSortFilterProxyModel::testFetchItemDetailsGetMediaIdFail()
{
VideoListDataModel::mGetMediaIdAtIndexFails = true;
-
+ QSignalSpy fetchSpy(mTestObject, SIGNAL(shortDetailsReady(TMPXItemId)));
mStubModel->appendData("Test");
+ QModelIndex index = mTestObject->index(0, 0);
+ // no model
+ QVERIFY(mTestObject->fetchItemDetails(index) == -1);
+
QVERIFY(mTestObject->initialize(mStubModel) == 0);
- QSignalSpy fetchSpy(mTestObject, SIGNAL(shortDetailsReady(TMPXItemId)));
-
- QModelIndex index = mTestObject->index(0, 0);
-
QVERIFY(mTestObject->fetchItemDetails(index) == -1);
QVERIFY(fetchSpy.count() == 0);
@@ -394,7 +391,7 @@
VideoCollectionClient::mFailMediaDetails = true;
QVERIFY(mTestObject->initialize(mStubModel) == 0);
- mTestObject->open(3);
+ mTestObject->open(VideoCollectionCommon::ELevelVideos);
mStubModel->appendData("Test");
QSignalSpy fetchSpy(mTestObject, SIGNAL(shortDetailsReady(TMPXItemId)));
@@ -424,7 +421,7 @@
mStubModel->appendData(name4); // to index 3, position 0 or 1
mStubModel->appendData(name5); // to index 4, position 0 or 1
- mTestObject->setSortRole(Qt::DisplayRole);
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
QModelIndex left = mStubModel->index(0,0);
QModelIndex right = mStubModel->index(1,0);
@@ -454,7 +451,7 @@
mStubModel->appendData(name4); // to index 3, position 0 or 1
mStubModel->appendData(name5); // to index 4, position 0 or 1
- mTestObject->setSortRole(Qt::DisplayRole);
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
QModelIndex left = mStubModel->index(0,0);
QModelIndex right = mStubModel->index(1,0);
@@ -502,9 +499,7 @@
mStubModel->appendData(name7); // to index 6, position is 0
mStubModel->appendData(name8); // to index 7, position is 1
-
- mTestObject->setSortRole(Qt::DisplayRole);
-
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
left = mStubModel->index(0,0); // "cc"
right = mStubModel->index(1,0); // "CC"
@@ -653,6 +648,81 @@
}
// ---------------------------------------------------------------------------
+// testLessThanDefaults
+// ---------------------------------------------------------------------------
+//
+void TestVideoSortFilterProxyModel::testLessThanDefaults()
+{
+ VideoCollectionClient::mFailStartOpen = false;
+ QVERIFY(mTestObject->initialize(mStubModel) == 0);
+ QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelCategory) == 0);
+
+ // Default categories (KVcxMvcMediaTypeCategory)
+ // are always first in the following order:
+ // Recently played (missing currently
+ // Captured (KVcxMvcCategoryIdCaptured)
+ // Downloaded (KVcxMvcCategoryIdDownloads)
+ // Podcasts (missing currently)
+ mStubModel->appendData(TMPXItemId(20, KVcxMvcMediaTypeAlbum)); // to source index 0
+ mStubModel->appendData(TMPXItemId(KVcxMvcCategoryIdDownloads, KVcxMvcMediaTypeCategory)); // to source index 1
+ mStubModel->appendData(TMPXItemId(KVcxMvcCategoryIdCaptured, KVcxMvcMediaTypeCategory)); // to source index 2
+ mStubModel->appendData(TMPXItemId(100, KVcxMvcMediaTypeCategory)); // to source index 3
+ mStubModel->appendData(TMPXItemId(101, KVcxMvcMediaTypeCategory)); // to source index 4
+
+ // left & right are KVcxMvcMediaTypeCategory
+ // -> left == KVcxMvcCategoryIdCaptured
+ QModelIndex left = mStubModel->index(2,0);
+ QModelIndex right = mStubModel->index(1,0);
+ // call doSorting to setup sorting order
+ mTestObject->mWantedSortOrder = Qt::AscendingOrder;
+ QVERIFY(mTestObject->callLessThan(left, right));
+ // call doSorting to setup sorting order
+ mTestObject->mWantedSortOrder = Qt::DescendingOrder;
+ QVERIFY(!mTestObject->callLessThan(left, right));
+
+ // -> left == KVcxMvcCategoryIdDownloads
+ left = mStubModel->index(1,0);
+ // -> right == KVcxMvcCategoryIdCaptured
+ right = mStubModel->index(2,0);
+ mTestObject->mWantedSortOrder = Qt::AscendingOrder;
+ QVERIFY(!mTestObject->callLessThan(left, right));
+ mTestObject->mWantedSortOrder = Qt::DescendingOrder;
+ QVERIFY(mTestObject->callLessThan(left, right));
+
+ // -> right != KVcxMvcCategoryIdCaptured
+ right = mStubModel->index(3,0);
+ mTestObject->mWantedSortOrder = Qt::AscendingOrder;
+ QVERIFY(mTestObject->callLessThan(left, right));
+ mTestObject->mWantedSortOrder = Qt::DescendingOrder;
+ QVERIFY(!mTestObject->callLessThan(left, right));
+
+ // both are KVcxMvcMediaTypeCategory but netiher KVcxMvcCategoryIdCaptured
+ // nor KVcxMvcCategoryIdDownloads
+ left = mStubModel->index(3,0);
+ right = mStubModel->index(4,0);
+ mTestObject->mWantedSortOrder = Qt::AscendingOrder;
+ QVERIFY(!mTestObject->callLessThan(left, right));
+ mTestObject->mWantedSortOrder = Qt::DescendingOrder;
+ QVERIFY(mTestObject->callLessThan(left, right));
+
+ // Left is KVcxMvcMediaTypeCategory and right is not
+ left = mStubModel->index(1,0);
+ right = mStubModel->index(0,0);
+ mTestObject->mWantedSortOrder = Qt::AscendingOrder;
+ QVERIFY(mTestObject->callLessThan(left, right));
+ mTestObject->mWantedSortOrder = Qt::DescendingOrder;
+ QVERIFY(!mTestObject->callLessThan(left, right));
+
+ // right is KVcxMvcMediaTypeCategory and left is not
+ left = mStubModel->index(0,0);
+ right = mStubModel->index(1,0);
+ mTestObject->mWantedSortOrder = Qt::AscendingOrder;
+ QVERIFY(!mTestObject->callLessThan(left, right));
+ mTestObject->mWantedSortOrder = Qt::DescendingOrder;
+ QVERIFY(mTestObject->callLessThan(left, right));
+}
+
+// ---------------------------------------------------------------------------
// testLessThanInvalid
// ---------------------------------------------------------------------------
//
@@ -676,7 +746,6 @@
QString name2 = "bb";
QString name3 = "aa";
-
mStubModel->appendData(name1); // to index 0, position 4
mStubModel->appendData(name2); // to index 1, position 3
mStubModel->appendData(name3); // to index 2, position 2
@@ -686,14 +755,10 @@
left = mStubModel->index(0,0);
right = mStubModel->index(1,0);
-
QVERIFY(!mTestObject->callLessThan(left, right));
-
- // reset model
- mStubModel->removeAll();
-
+
// invalid left index
- mTestObject->setSortRole(Qt::DisplayRole);
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
left = QModelIndex();
right = mStubModel->index(0,0);
@@ -701,7 +766,7 @@
QVERIFY(!mTestObject->callLessThan(left, right));
// invalid right index
- mTestObject->setSortRole(Qt::DisplayRole);
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
User::Heap().__DbgMarkStart();
left = mStubModel->index(0,0);
right = QModelIndex();
@@ -709,7 +774,7 @@
QVERIFY(!mTestObject->callLessThan(left, right));
// both invalid
- mTestObject->setSortRole(Qt::DisplayRole);
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
User::Heap().__DbgMarkStart();
left = QModelIndex();
right = QModelIndex();
@@ -722,13 +787,11 @@
mStubModel->appendData(size1); // to index 0
mTestObject->setSortRole(VideoCollectionCommon::KeySizeValue);
- mTestObject->setSortRole(Qt::DisplayRole);
-
+ mTestObject->setSortRole(VideoCollectionCommon::KeyTitle);
left = mStubModel->index(0,0);
right = mStubModel->index(0,0);
QVERIFY(!mTestObject->callLessThan(left, right));
-
}
// ---------------------------------------------------------------------------
@@ -780,38 +843,38 @@
mStubModel->appendData(size5); // to index 4
int sortingRole;
- Qt::SortOrder sortingOrder;
+ Qt::SortOrder sortingOrder;
// first sort call, includes timer creation and setup
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder);
// need to wait for awhile to make sure zero-counter gets
// processing time.
QTest::qWait(500);
- QCOMPARE(spyAboutToChange.count(), 1);
- QCOMPARE(spyChanged.count(), 1);
- QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole);
+ QCOMPARE(spyAboutToChange.count(), 2); // 2 times because also the setSortRole causes this signal.
+ QCOMPARE(spyChanged.count(), 2); // 2 times because also the setSortRole causes this signal.
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
mTestObject->getSorting(sortingRole, sortingOrder);
- QCOMPARE(sortingRole, (int)Qt::DisplayRole);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(sortingOrder, Qt::AscendingOrder);
// reset spys
spyAboutToChange.clear();
spyChanged.clear();
-
+
// second sort call, should use same timer appropriately
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole, Qt::DescendingOrder);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::DescendingOrder);
QTest::qWait(500);
QCOMPARE(spyAboutToChange.count(), 1);
QCOMPARE(spyChanged.count(), 1);
- QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::DescendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
mTestObject->getSorting(sortingRole, sortingOrder);
- QCOMPARE(sortingRole, (int)Qt::DisplayRole);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(sortingOrder, Qt::DescendingOrder);
// reset spys
@@ -820,16 +883,16 @@
// double call without first letting timer to timeout
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole, Qt::DescendingOrder);
- mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::DescendingOrder);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder);
QTest::qWait(500);
QCOMPARE(spyAboutToChange.count(), 1);
QCOMPARE(spyChanged.count(), 1);
- QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
mTestObject->getSorting(sortingRole, sortingOrder);
- QCOMPARE(sortingRole, (int)Qt::DisplayRole);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(sortingOrder, Qt::AscendingOrder);
spyAboutToChange.clear();
@@ -837,28 +900,28 @@
// syncronous call checks
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole, Qt::DescendingOrder, false);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::DescendingOrder, false);
QCOMPARE(spyAboutToChange.count(), 1);
QCOMPARE(spyChanged.count(), 1);
- QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::DescendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
mTestObject->getSorting(sortingRole, sortingOrder);
- QCOMPARE(sortingRole, (int)Qt::DisplayRole);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(sortingOrder, Qt::DescendingOrder);
spyAboutToChange.clear();
spyChanged.clear();
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder, false);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder, false);
QCOMPARE(spyAboutToChange.count(), 1);
QCOMPARE(spyChanged.count(), 1);
- QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
mTestObject->getSorting(sortingRole, sortingOrder);
- QCOMPARE(sortingRole, (int)Qt::DisplayRole);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(sortingOrder, Qt::AscendingOrder);
spyAboutToChange.clear();
@@ -866,14 +929,14 @@
// check that layout signals are not send if the sorting values don't change.
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole, Qt::AscendingOrder);
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle, Qt::AscendingOrder);
QCOMPARE(spyAboutToChange.count(), 0);
QCOMPARE(spyChanged.count(), 0);
- QCOMPARE(mTestObject->sortRole(), (int)Qt::DisplayRole);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(mTestObject->sortOrder(), Qt::AscendingOrder);
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 0);
mTestObject->getSorting(sortingRole, sortingOrder);
- QCOMPARE(sortingRole, (int)Qt::DisplayRole);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyTitle);
QCOMPARE(sortingOrder, Qt::AscendingOrder);
spyAboutToChange.clear();
@@ -906,14 +969,29 @@
mTestObject->getSorting(sortingRole, sortingOrder);
QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeySizeValue);
QCOMPARE(sortingOrder, Qt::AscendingOrder);
-
-
+
spyAboutToChange.clear();
spyChanged.clear();
+
+ // number of items role check
+ VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
+ mTestObject->doSorting(VideoCollectionCommon::KeyNumberOfItems, Qt::AscendingOrder);
+ QTest::qWait(500);
+ QCOMPARE(spyAboutToChange.count(), 1);
+ QCOMPARE(spyChanged.count(), 1);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyNumberOfItems);
+ QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
+ mTestObject->getSorting(sortingRole, sortingOrder);
+ QCOMPARE(sortingRole, (int)VideoCollectionCommon::KeyNumberOfItems);
+ QCOMPARE(sortingOrder, Qt::AscendingOrder);
+
+ spyAboutToChange.clear();
+ spyChanged.clear();
// invalid role call, sorting should be set to date
VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
- mTestObject->doSorting(Qt::DisplayRole - 100, Qt::AscendingOrder);
+ mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos;
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder);
QTest::qWait(500);
QCOMPARE(spyAboutToChange.count(), 1);
QCOMPARE(spyChanged.count(), 1);
@@ -921,37 +999,144 @@
spyAboutToChange.clear();
spyChanged.clear();
QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
+
+ // invalid role call, model type is categories, sorting should be set to VideoCollectionCommon::KeyTitle
+ VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
+ mTestObject->mType = VideoCollectionCommon::EModelTypeCollections;
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder);
+ QTest::qWait(500);
+ QCOMPARE(spyAboutToChange.count(), 1);
+ QCOMPARE(spyChanged.count(), 1);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyTitle);
+ spyAboutToChange.clear();
+ spyChanged.clear();
+ QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 1);
+
+ // sync sorting call for non -changing sort order (for coverity)
+ VideoThumbnailData::mStartBackgroundFetchingCallCount = 0;
+ mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos;
+ mTestObject->mIdleSortTimer = 0;
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder, false);
+ spyAboutToChange.clear();
+ spyChanged.clear();
+ mTestObject->doSorting(VideoCollectionCommon::KeyTitle - 100, Qt::AscendingOrder, false);
+ QCOMPARE(spyAboutToChange.count(), 0);
+ QCOMPARE(spyChanged.count(), 0);
+ QCOMPARE(mTestObject->sortRole(), (int)VideoCollectionCommon::KeyDateTime);
+ spyAboutToChange.clear();
+ spyChanged.clear();
+ QVERIFY(VideoThumbnailData::mStartBackgroundFetchingCallCount == 2);
}
// ---------------------------------------------------------------------------
// testFilterAcceptsRow
// ---------------------------------------------------------------------------
//
-void TestVideoSortFilterProxyModel::testFilterAcceptsRow()
-{
- QWARN("tests for different model types are still missing");
-
- QModelIndex index = QModelIndex(); // index can be anything, test model doesn't use it.
+void TestVideoSortFilterProxyModel::testFilterAcceptsRowVideos()
+{
+ // source_parent can be anything, test model doesn't use it.
+ QModelIndex source_parent = QModelIndex();
// Not initialized: no rouce model
- QVERIFY(mTestObject->callFilterAcceptsRow(0, index) == false);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
QVERIFY(mTestObject->initialize(mStubModel) == 0);
- mTestObject->open(3);
+ mTestObject->open(VideoCollectionCommon::ELevelVideos);
+ mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos;
// Test invalid row: below 0
- QVERIFY(mTestObject->callFilterAcceptsRow(-1, index) == false);
+ QVERIFY(mTestObject->callFilterAcceptsRow(-1, source_parent) == false);
// invalid row: larger than count
mStubModel->appendData("test");
- QVERIFY(mTestObject->callFilterAcceptsRow(2, index) == false);
+ QVERIFY(mTestObject->callFilterAcceptsRow(2, source_parent) == false);
// correct row
- QVERIFY(mTestObject->callFilterAcceptsRow(0, index) == true);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true);
+
+ // correct row, but id not corresponds video
+ mStubModel->removeAll();
+ mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeCategory));
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
}
// ---------------------------------------------------------------------------
+// testFilterAcceptsNoVideoTypes
+// ---------------------------------------------------------------------------
+//
+void TestVideoSortFilterProxyModel::testFilterAcceptsNoVideoTypes()
+{
+ // source_parent can be anything, test model doesn't use it.
+ QModelIndex source_parent = QModelIndex();
+ QVERIFY(mTestObject->initialize(mStubModel) == 0);
+
+ // only one item at ondex 0
+ mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeVideo));
+
+ // model type == VideoCollectionWrapper::ECollections
+ mTestObject->mType = VideoCollectionCommon::EModelTypeCollections;
+ // mLevel == VideoCollectionCommon::ELevelCategory, id.iId1 == KVcxMvcMediaTypeVideo
+ mTestObject->mLevel = VideoCollectionCommon::ELevelCategory;
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+ // mLevel != VideoCollectionCommon::ELevelCategory
+ mTestObject->mLevel = VideoCollectionCommon::ELevelAlbum;
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+
+ // model type == VideoCollectionWrapper::ECollectionContent
+ mTestObject->mType = VideoCollectionCommon::EModelTypeCollectionContent;
+ // item belongs to album
+ VideoListDataModel::mBelongsToAlbum = true;
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true);
+ // item does not belong to album
+ VideoListDataModel::mBelongsToAlbum = false;
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+
+ // model type == VideoCollectionWrapper::EGeneric
+ mTestObject->mType = VideoCollectionCommon::EModelTypeGeneric;
+ mTestObject->mGenericFilterValue = true;
+
+ // mLevel != VideoCollectionCommon::ELevelVideos && id.iId2 == KVcxMvcMediaTypeVideo
+ mTestObject->mLevel = VideoCollectionCommon::ELevelAlbum;
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+
+ // mLevel == VideoCollectionCommon::ELevelVideos && id.iId2 != KVcxMvcMediaTypeVideo
+ mTestObject->mLevel = VideoCollectionCommon::ELevelVideos;
+ mStubModel->removeAll();
+ mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeCategory));
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+
+ // mLevel == VideoCollectionCommon::ELevelVideos && id.iId2 == KVcxMvcMediaTypeVideo
+ mStubModel->removeAll();
+ mStubModel->appendData(TMPXItemId(1, KVcxMvcMediaTypeVideo));
+ // generic filter id == TMPXItemId::InvalidId()
+ mTestObject->mGenericFilterId = TMPXItemId::InvalidId();
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true);
+
+ // generic filter id == (KVcxMvcCategoryIdAll, KVcxMvcMediaTypeCategory)
+ mTestObject->mGenericFilterId = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeCategory);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true);
+
+ // generic filter id == (100, KVcxMvcMediaTypeCategory)
+ mTestObject->mGenericFilterId = TMPXItemId(100, KVcxMvcMediaTypeCategory);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+
+ // generic filter id == (KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo)
+ mTestObject->mGenericFilterId = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == false);
+
+ // generic filter id == (100, KVcxMvcMediaTypeCategory)
+ VideoListDataModel::mBelongsToAlbum = true;
+ mTestObject->mGenericFilterId = TMPXItemId(100, KVcxMvcMediaTypeCategory);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true);
+
+ // generic filter id == (KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo)
+ VideoListDataModel::mBelongsToAlbum = true;
+ mTestObject->mGenericFilterId = TMPXItemId(KVcxMvcCategoryIdAll, KVcxMvcMediaTypeVideo);
+ QVERIFY(mTestObject->callFilterAcceptsRow(0, source_parent) == true);
+}
+
+// ---------------------------------------------------------------------------
// testGetMediaFilePathForId
// ---------------------------------------------------------------------------
//
@@ -999,12 +1184,14 @@
//
void TestVideoSortFilterProxyModel::testResolveAlbumName()
{
+ mCollectionModel->mType = VideoCollectionCommon::EModelTypeCollections;
+
QString name("test");
QString resolved("");
// no model, same name can be used
resolved = mTestObject->resolveAlbumName(name);
QVERIFY(resolved.length());
- QVERIFY(resolved == name);
+ QVERIFY(resolved == name);
mTestObject->initialize(mStubModel);
@@ -1012,12 +1199,20 @@
resolved = mTestObject->resolveAlbumName(name);
QVERIFY(resolved.length());
QVERIFY(resolved == name);
-
mCollectionModel->initialize(mStubModel);
- mCollectionModel->open(2);
+ mCollectionModel->open(VideoCollectionCommon::ELevelCategory);
VideoCollectionWrapper::instance().mProxyModel = mCollectionModel;
+ // collections proxy model exists, no source model
+ VideoListDataModel *temp = mTestObject->mModel;
+ mTestObject->mModel = 0;
+
+ resolved = mTestObject->resolveAlbumName(name);
+ QVERIFY(resolved.length());
+ QVERIFY(resolved == name);
+ mTestObject->mModel = temp;
+
mStubModel->appendData(TMPXItemId(1,2));
mStubModel->appendData(name);
@@ -1047,8 +1242,9 @@
// different name, no changes
name = "Another";
resolved = mTestObject->resolveAlbumName(name);
- QVERIFY(resolved == name);
+ QVERIFY(resolved == name);
+ mCollectionModel->mType = VideoCollectionCommon::EModelTypeAllVideos;
}
// ---------------------------------------------------------------------------
@@ -1098,18 +1294,30 @@
//
void TestVideoSortFilterProxyModel::testGetOpenItem()
{
- // no collection client
+ // no model nor collection client
QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId());
mTestObject->initialize(mStubModel);
+ // model exist, no collection client
+ VideoCollectionClient *tmpClient = mTestObject->mCollectionClient;
+ mTestObject->mCollectionClient = 0;
+ QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId());
+ mTestObject->mCollectionClient = tmpClient;
+
+ // no model, collection client exists
+ VideoListDataModel *tmpModel = mTestObject->mModel;
+ mTestObject->mModel = 0;
+ QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId());
+ mTestObject->mModel = tmpModel;
+
// type neither EAllVideos or ECollectionContent
QVERIFY(mTestObject->getOpenItem() == TMPXItemId::InvalidId());
TMPXItemId id;
// type EAllVideos
delete mTestObject;
- mTestObject = new FilterProxyTester(VideoCollectionWrapper::EAllVideos);
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos);
mTestObject->initialize(mStubModel);
id = mTestObject->getOpenItem();
QVERIFY(id != TMPXItemId::InvalidId());
@@ -1118,7 +1326,7 @@
// type ECollectionContent
delete mTestObject;
- mTestObject = new FilterProxyTester(VideoCollectionWrapper::ECollectionContent);
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeCollectionContent);
mTestObject->initialize(mStubModel);
id.iId1 = 1;
id.iId2 = KVcxMvcMediaTypeAlbum;
@@ -1128,7 +1336,6 @@
QVERIFY(id != TMPXItemId::InvalidId());
QVERIFY(id.iId1 == 1);
QVERIFY(id.iId2 == KVcxMvcMediaTypeAlbum);
-
}
// ---------------------------------------------------------------------------
@@ -1160,7 +1367,7 @@
mStubModel->removeAll();
delete mTestObject;
- mTestObject = new FilterProxyTester(VideoCollectionWrapper::ECollections);
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeCollections);
QVERIFY(mTestObject);
QVERIFY(mTestObject->initialize(mStubModel) == 0);
QVERIFY(mTestObject->open(VideoCollectionCommon::ELevelCategory) == 0);
@@ -1188,7 +1395,7 @@
emit testSignal();
delete mTestObject;
mTestObject = 0;
- mTestObject = new FilterProxyTester(VideoCollectionWrapper::ECollectionContent);
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeCollectionContent);
connect(this, SIGNAL(testSignal()), mTestObject, SLOT(albumChangedSlot()));
QVERIFY(mTestObject);
mTestObject->initialize(mStubModel);
@@ -1248,7 +1455,7 @@
// other type
delete mTestObject;
- mTestObject = new FilterProxyTester(VideoCollectionWrapper::EAllVideos);
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos);
mTestObject->initialize(mStubModel);
mTestObject->open(VideoCollectionCommon::ELevelVideos);
@@ -1256,9 +1463,75 @@
mTestObject->invalidate();
index = mTestObject->indexOfId(TMPXItemId(1,0));
QVERIFY(index.isValid());
- QVERIFY(index.row() == 0);
+ QVERIFY(index.row() == 0);
+}
+
+// ---------------------------------------------------------------------------
+// testRenameAlbum
+// ---------------------------------------------------------------------------
+//
+void TestVideoSortFilterProxyModel::testSetAlbumInUse()
+{
+ mStubModel->mAlbumInUse = TMPXItemId::InvalidId();
+ // no model
+ mTestObject->setAlbumInUse(TMPXItemId(1,2));
+ QVERIFY(mStubModel->mAlbumInUse == TMPXItemId::InvalidId());
+
+ // model exists
+ mTestObject->initialize(mStubModel);
+ mTestObject->setAlbumInUse(TMPXItemId(1,2));
+ QVERIFY(mStubModel->mAlbumInUse == TMPXItemId(1,2));
}
+// ---------------------------------------------------------------------------
+// testRenameAlbum
+// ---------------------------------------------------------------------------
+//
+void TestVideoSortFilterProxyModel::testRenameAlbum()
+{
+ delete mTestObject;
+ mTestObject = new FilterProxyTester(VideoCollectionCommon::EModelTypeAllVideos);
+
+ // Not initialized.
+ TMPXItemId id = TMPXItemId::InvalidId();
+ QString name = "";
+ QVERIFY(mTestObject->renameAlbum(id, name) == -1);
+
+ // Initialized.
+ mTestObject->initialize(mStubModel);
+ QVERIFY(mTestObject->renameAlbum(id, name) == 0);
+}
+
+// ---------------------------------------------------------------------------
+// testItemModifiedSlot
+// ---------------------------------------------------------------------------
+//
+void TestVideoSortFilterProxyModel::testItemModifiedSlot()
+{
+ connect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
+
+ TMPXItemId id = TMPXItemId::InvalidId();
+ mTestObject->initialize(mStubModel);
+
+ // mType wrong
+ mTestObject->mType = VideoCollectionCommon::EModelTypeAllVideos;
+ emit testSignalMpxId(id);
+
+ // invalid id
+ mTestObject->mType = VideoCollectionCommon::EModelTypeCollections;
+
+ emit testSignalMpxId(id);
+
+ // item is album
+ id = TMPXItemId(0, KVcxMvcMediaTypeAlbum);
+ emit testSignalMpxId(id);
+
+ // item is category
+ id = TMPXItemId(0, KVcxMvcMediaTypeCategory);
+ emit testSignalMpxId(id);
+
+ disconnect(this, SIGNAL(testSignalMpxId(const TMPXItemId &)), mTestObject, SLOT(itemModifiedSlot(const TMPXItemId &)));
+}
// End of file
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/filterproxytester.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/filterproxytester.h Mon May 03 12:32:50 2010 +0300
@@ -21,6 +21,7 @@
#include <QObject>
+#include "videocollectioncommon.h"
#include "videosortfilterproxymodel.h"
class VideoListDataModel;
@@ -36,7 +37,7 @@
* Constructor
*
*/
- FilterProxyTester(int type, QObject *parent=0);
+ FilterProxyTester(VideoCollectionCommon::TModelType type, QObject *parent=0);
/**
* destructor
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videocollectionclient.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videocollectionclient.h Mon May 03 12:32:50 2010 +0300
@@ -108,6 +108,11 @@
*
*/
int back();
+
+ /**
+ * returns mRenameAlbumReturnValue
+ */
+ int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
public:
static bool mFailInit;
@@ -122,6 +127,8 @@
static QString mAddNewCollectionName;
static QString mAddNewCollectionThumb;
static QList<TMPXItemId> mAddNewCollectionIds;
+ static int mRenameAlbumReturnValue;
+ static int mBackReturnValue;
private:
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videolistdatamodel.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/inc/videolistdatamodel.h Mon May 03 12:32:50 2010 +0300
@@ -255,6 +255,11 @@
* signals when album data has changed
*/
void albumChanged();
+
+ /**
+ * signals when item has been modified
+ */
+ void itemModified(const TMPXItemId &itemId);
public:
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/filterproxytester.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/filterproxytester.cpp Mon May 03 12:32:50 2010 +0300
@@ -18,8 +18,6 @@
// INCLUDES
-
-
#define private public
#include "videosortfilterproxymodel.h"
#undef private
@@ -31,8 +29,8 @@
// FilterProxyTester
// ---------------------------------------------------------------------------
//
-FilterProxyTester::FilterProxyTester(int type, QObject *parent) :
-VideoSortFilterProxyModel(type, parent)
+FilterProxyTester::FilterProxyTester(VideoCollectionCommon::TModelType type, QObject *parent) :
+VideoSortFilterProxyModel(type, parent)
{
// NOP
}
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videocollectionclient.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videocollectionclient.cpp Mon May 03 12:32:50 2010 +0300
@@ -34,6 +34,8 @@
QString VideoCollectionClient::mAddNewCollectionName = QString();
QString VideoCollectionClient::mAddNewCollectionThumb = QString();
QList<TMPXItemId> VideoCollectionClient::mAddNewCollectionIds = QList<TMPXItemId>();
+int VideoCollectionClient::mRenameAlbumReturnValue = 0;
+int VideoCollectionClient::mBackReturnValue = 0;
// -----------------------------------------------------------------------------
// VideoCollectionClient
@@ -145,12 +147,23 @@
id.iId1 = 1;
id.iId2 = 2;
}
+
// -----------------------------------------------------------------------------
// back
// -----------------------------------------------------------------------------
//
int VideoCollectionClient::back()
{
- return 0;
+ return mBackReturnValue;
}
+// -----------------------------------------------------------------------------
+// renameAlbum
+// -----------------------------------------------------------------------------
+//
+int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
+{
+ Q_UNUSED(albumId);
+ Q_UNUSED(newTitle);
+ return mRenameAlbumReturnValue;
+}
--- a/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videolistdatamodel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideosortfilterproxymodel/stub/src/videolistdatamodel.cpp Mon May 03 12:32:50 2010 +0300
@@ -180,14 +180,15 @@
return returnValue;
}
int row = index.row();
- if(role == Qt::DisplayRole)
+ if(role == VideoCollectionCommon::KeyTitle)
{
if(row >= 0 && row < mData.count())
{
returnValue = mData.at(row)->mName;
}
}
- else if(role == VideoCollectionCommon::KeySizeValue)
+ else if(role == VideoCollectionCommon::KeySizeValue ||
+ role == VideoCollectionCommon::KeyNumberOfItems)
{
if(row >= 0 && row < mData.count())
{
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/stub/inc/videocollectionwrapper.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/stub/inc/videocollectionwrapper.h Mon May 03 12:32:50 2010 +0300
@@ -22,6 +22,7 @@
// INCLUDES
#include <QObject>
+#include <videocollectioncommon.h>
// FORWARD DECLARATIONS
class VideoSortFilterProxyModel;
@@ -58,7 +59,7 @@
*
* @return address to model or NULL if fails.
*/
- VideoSortFilterProxyModel* getModel(TModelType type);
+ VideoSortFilterProxyModel* getModel(VideoCollectionCommon::TModelType type);
/* Additional functions needed for testing purposes */
--- a/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/stub/src/videocollectionwrapper.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/tsrc/testvideothumbnaildata_p/stub/src/videocollectionwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -55,8 +55,9 @@
// VideoCollectionWrapper::open()
// -----------------------------------------------------------------------------
//
-VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(TModelType type)
+VideoSortFilterProxyModel* VideoCollectionWrapper::getModel(VideoCollectionCommon::TModelType type)
{
+ Q_UNUSED(type);
return mModel;
}
@@ -75,6 +76,7 @@
//
void VideoCollectionWrapper::setModel(VideoSortFilterProxyModel* model)
{
+ Q_UNUSED(model);
mModel = model;
}
--- a/videocollection/videocollectionwrapper/videocollectionwrapper.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videocollectionwrapper/videocollectionwrapper.pro Mon May 03 12:32:50 2010 +0300
@@ -73,6 +73,7 @@
-lmpxcollectionutility.dll \
-lthumbnailmanagerqt.dll \
-lestor.dll \
- -lcentralrepository.dll
-
+ -lcentralrepository.dll \
+ -lflogger.dll
+
RESOURCES += data/videocollectionwrapper.qrc
--- a/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/inc/videofiledetailsviewplugin.h Mon May 03 12:32:50 2010 +0300
@@ -137,9 +137,9 @@
/**
* Signaled when full details are ready.
*
- * @param id Mpx id of the clip, needed when getting the data from model.
+ * @param metadata The metadata for the clip.
*/
- void fullDetailsReadySlot(TMPXItemId id);
+ void fullDetailsReadySlot(QVariant& variant);
/**
* Slot that receives signal from play button to start playback.
--- a/videocollection/videofiledetailsview/src/videodetailslabel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/src/videodetailslabel.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,9 @@
*
*/
+// Version : %version: %
+
+#include "videocollectiontrace.h"
#include "videodetailslabel.h"
// SYSTEM INCLUDES
@@ -25,9 +28,10 @@
// VideoDetailsLabel::VideoDetailsLabel
// @see header
//---------------------------------------------------------------
-VideoDetailsLabel::VideoDetailsLabel(QGraphicsItem *parent) :
- HbLabel(parent)
+VideoDetailsLabel::VideoDetailsLabel(QGraphicsItem *parent)
+ : HbLabel( parent )
{
+ FUNC_LOG;
}
//---------------------------------------------------------------
@@ -36,6 +40,7 @@
//---------------------------------------------------------------
VideoDetailsLabel::~VideoDetailsLabel()
{
+ FUNC_LOG;
}
//---------------------------------------------------------------
@@ -44,6 +49,7 @@
//---------------------------------------------------------------
void VideoDetailsLabel::click()
{
+ FUNC_LOG;
emit clicked(true);
}
@@ -53,6 +59,7 @@
//---------------------------------------------------------------
void VideoDetailsLabel::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
+ FUNC_LOG;
Q_UNUSED(event);
emit clicked(true);
}
--- a/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/src/videofiledetailsviewplugin.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: 69 %
+
// INCLUDE FILES
#include <qcoreapplication.h>
#include <xqserviceutil.h>
@@ -26,13 +28,14 @@
#include <hbpushbutton.h>
#include <hbaction.h>
#include <qabstractitemmodel.h>
-#include <qdebug.h>
#include <hbmessagebox.h>
#include <hblistwidget.h>
#include <hblistwidgetitem.h>
#include <hblistviewitem.h>
#include <cmath>
#include <thumbnailmanager_qt.h>
+#include <shareui.h>
+
#include "videocollectionclient.h"
#include "videofiledetailsviewplugin.h"
#include "videocollectioncommon.h"
@@ -41,43 +44,38 @@
#include "videosortfilterproxymodel.h"
#include "videoservices.h"
#include "videodetailslabel.h"
+#include "videocollectiontrace.h"
-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";
-const char* const VIDEO_DETAILS_BUTTON = "mButton";
+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";
+const char* const VIDEO_DETAILS_BUTTON = "mButton";
const char* const VIDEO_DETAILS_MENUACTION_DELETE = "mOptionsDelete";
-const char* const VIDEO_DETAILS_LISTWIDGET ="mDetailsList";
-
-// Just for testing, remove this
-void _DebugNotImplementedYet()
-{
- HbMessageBox::information(QObject::tr("Not implemented yet"));
-}
+const char* const VIDEO_DETAILS_LISTWIDGET = "mDetailsList";
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
VideoFileDetailsViewPlugin::VideoFileDetailsViewPlugin()
- : mModel(0),
- mVideoServices(0),
- mActivated(false),
- mIsService(false),
- mVideoId(TMPXItemId::InvalidId()),
- mDeletedIndex(-1),
- mPreviousOrietation(Qt::Vertical),
- mNavKeyBackAction(0),
- mTitleAnim(0),
- mThumbLabel(0),
- mThumbnailManager(0),
- mCollectionWrapper(VideoCollectionWrapper::instance())
+ : mModel( 0 )
+ , mVideoServices( 0 )
+ , mActivated( false )
+ , mIsService( false )
+ , mVideoId( TMPXItemId::InvalidId() )
+ , mDeletedIndex( -1 )
+ , mPreviousOrietation( Qt::Vertical )
+ , mNavKeyBackAction( 0 )
+ , mTitleAnim( 0 )
+ , mThumbLabel( 0 )
+ , mThumbnailManager( 0 )
+ , mCollectionWrapper( VideoCollectionWrapper::instance() )
{
-
+ FUNC_LOG;
}
// ---------------------------------------------------------------------------
@@ -86,6 +84,7 @@
//
VideoFileDetailsViewPlugin::~VideoFileDetailsViewPlugin()
{
+ FUNC_LOG;
destroyView();
}
@@ -95,6 +94,7 @@
//
void VideoFileDetailsViewPlugin::createView()
{
+ FUNC_LOG;
mLoader.reset();
mActivated = false;
@@ -106,6 +106,7 @@
if(!ok)
{
+ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load docml.");
return;
}
@@ -114,14 +115,15 @@
if(!ok)
{
+ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load portrait view.");
return;
}
- mModel = mCollectionWrapper.getModel(VideoCollectionWrapper::EAllVideos);
+ mModel = mCollectionWrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
if (!mModel)
{
- qDebug() << "VideoFileDetailsViewPlugin::createView(): Unable to open collection wrapper. Cannot connect slots, aborting...";
+ ERROR(-1, "VideoFileDetailsViewPlugin::createView() get model failed.");
// TODO need to throw exception instead?
return;
}
@@ -141,14 +143,20 @@
this, SLOT(shortDetailsReadySlot(TMPXItemId)));
connect(mModel->sourceModel(),
- SIGNAL(fullVideoDetailsReady(TMPXItemId)),
- this, SLOT(fullDetailsReadySlot(TMPXItemId)));
+ SIGNAL(fullVideoDetailsReady(QVariant&)),
+ this, SLOT(fullDetailsReadySlot(QVariant&)));
connect(mModel,
SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
this, SLOT(rowsRemovedSlot(const QModelIndex&, int, int)));
+ // Setup thumbnail widget.
HbStackedWidget* thumbWidget = findWidget<HbStackedWidget>(VIDEO_DETAILS_THUMBNAIL);
+ if(!thumbWidget)
+ {
+ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load thumbnail widget.");
+ return;
+ }
// no deallocation needed for this since
// stackedwidget takes ownership
@@ -160,10 +168,22 @@
thumbWidget->addWidget(mThumbLabel);
+ // Load details title.
HbStackedWidget* title = findObject<HbStackedWidget>(VIDEO_DETAILS_TITLE);
+ if(!title)
+ {
+ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to load title.");
+ return;
+ }
title->addWidget(mTitleAnim);
+ // Load delete action.
HbAction* deleteAction = findObject<HbAction>(VIDEO_DETAILS_MENUACTION_DELETE);
+ if(!deleteAction)
+ {
+ ERROR(-1, "VideoFileDetailsViewPlugin::createView() failed to delete action.");
+ return;
+ }
if (mIsService)
{
@@ -192,6 +212,7 @@
//
void VideoFileDetailsViewPlugin::destroyView()
{
+ FUNC_LOG;
if (mActivated)
{
deactivateView();
@@ -203,8 +224,12 @@
mVideoServices = 0;
}
- delete mNavKeyBackAction; mNavKeyBackAction = 0;
- delete mThumbnailManager; mThumbnailManager = 0;
+ delete mNavKeyBackAction;
+ mNavKeyBackAction = 0;
+
+ delete mThumbnailManager;
+ mThumbnailManager = 0;
+
disconnect();
mLoader.reset();
}
@@ -215,6 +240,7 @@
//
void VideoFileDetailsViewPlugin::activateView()
{
+ FUNC_LOG;
if (!mActivated)
{
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
@@ -228,6 +254,7 @@
}
else
{
+ ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to connect navkey signal.");
return;
}
}
@@ -254,25 +281,36 @@
if (!mVideoServices)
{
+ ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to get video services instance.");
return;
}
}
- HbPushButton* button = findWidget<HbPushButton>(VIDEO_DETAILS_BUTTON);
-
+ VideoServices::TVideoService service = VideoServices::ENoService;
if (mIsService && mVideoServices)
{
- button->setText(tr("Attach")); //localisation
-
- connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri()));
- connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
-
+ service = mVideoServices->currentService();
+
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
-
mainWnd->currentView()->setTitle(mVideoServices->contextTitle());
}
- else if(!mIsService)
- {
+
+ HbPushButton* button = findWidget<HbPushButton>(VIDEO_DETAILS_BUTTON);
+ if(!button)
+ {
+ ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details button.");
+ return;
+ }
+
+ if (service == VideoServices::EUriFetcher)
+ {
+ button->setText(hbTrId("txt_videos_button_attach"));
+
+ connect(button, SIGNAL(clicked(bool)), this, SLOT(getFileUri()));
+ connect(this, SIGNAL(fileUri(const QString&)), mVideoServices, SLOT(itemSelected(const QString&)));
+ }
+ else
+ {
connect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
button->setText(hbTrId("txt_videos_opt_share"));
}
@@ -299,6 +337,7 @@
//
void VideoFileDetailsViewPlugin::deactivateView()
{
+ FUNC_LOG;
if ( mActivated )
{
mVideoId = TMPXItemId::InvalidId();
@@ -342,7 +381,6 @@
{
disconnect(button, SIGNAL(clicked(bool)), this, SLOT(sendVideoSlot()));
}
-
}
}
@@ -352,6 +390,7 @@
//
QGraphicsWidget* VideoFileDetailsViewPlugin::getView()
{
+ FUNC_LOG;
return mLoader.findWidget(VIDEO_DETAILS_VIEW);
}
@@ -361,12 +400,13 @@
//
void VideoFileDetailsViewPlugin::orientationChange( Qt::Orientation orientation )
{
- if ( orientation == Qt::Vertical )
+ FUNC_LOG;
+ if (orientation == Qt::Vertical)
{
mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_PORTRAIT);
}
- else if ( orientation == Qt::Horizontal )
+ else if (orientation == Qt::Horizontal)
{
mLoader.load(VIDEO_DETAILS_DOCML, VIDEO_DETAILS_LANDSCAPE);
}
@@ -380,7 +420,8 @@
//
void VideoFileDetailsViewPlugin::back()
{
- if ( mActivated )
+ FUNC_LOG;
+ if (mActivated)
{
emit command( MpxHbVideoCommon::ActivateCollectionView );
}
@@ -392,6 +433,7 @@
//
void VideoFileDetailsViewPlugin::shortDetailsReadySlot(TMPXItemId id)
{
+ FUNC_LOG;
// first clear all details, so that the view doesn't display the old data.
findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET)->clear();
@@ -399,11 +441,11 @@
mVideoId = id;
- QVariant variant = mModel->data(modelIndex, Qt::DisplayRole);
+ QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyTitle);
if (variant.isValid() && mTitleAnim)
{
- mTitleAnim->setText(variant.toStringList().first());
+ mTitleAnim->setText(variant.toString());
}
startFetchingThumbnail();
}
@@ -412,20 +454,22 @@
// Slot: fullDetailsReadySlot
// ---------------------------------------------------------------------------
//
-void VideoFileDetailsViewPlugin::fullDetailsReadySlot(TMPXItemId id)
+void VideoFileDetailsViewPlugin::fullDetailsReadySlot(QVariant& variant)
{
+ FUNC_LOG;
using namespace VideoCollectionCommon;
int detailCount = sizeof(VideoDetailLabelKeys) / sizeof(int);
- QModelIndex modelIndex = mModel->indexOfId(id);
-
- QVariant variant = mModel->data(modelIndex, KeyMetaData);
-
QMap<QString, QVariant> metadata = variant.toMap();
-
+
HbListWidget* list = findWidget<HbListWidget>(VIDEO_DETAILS_LISTWIDGET);
-
+ if(!list)
+ {
+ ERROR(-1, "VideoFileDetailsViewPlugin::activateView() failed to load details list widget.");
+ return;
+ }
+
if(list->count())
{
list->clear();
@@ -457,11 +501,12 @@
//
void VideoFileDetailsViewPlugin::getFileUri()
{
+ FUNC_LOG;
if (mVideoId != TMPXItemId::InvalidId())
{
QModelIndex modelIndex = mModel->indexOfId(mVideoId);
QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath);
- if ( variant.isValid() )
+ if (variant.isValid())
{
QString itemPath = variant.value<QString>();
emit(fileUri(itemPath));
@@ -475,6 +520,7 @@
//
void VideoFileDetailsViewPlugin::startPlaybackSlot()
{
+ FUNC_LOG;
if (mVideoId != TMPXItemId::InvalidId())
{
mModel->openItem(mVideoId);
@@ -487,7 +533,21 @@
//
void VideoFileDetailsViewPlugin::sendVideoSlot()
{
- _DebugNotImplementedYet();
+ FUNC_LOG;
+ HbMessageBox::information(tr("Not implemented yet"));
+
+/* if(mVideoId != TMPXItemId::InvalidId())
+ {
+ ShareUi dialog;
+ QModelIndex modelIndex = mModel->indexOfId(mVideoId);
+ QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyFilePath);
+ if(variant.isValid())
+ {
+ QStringList fileList;
+ fileList.append(variant.toString());
+ dialog.send(fileList, true);
+ }
+ }*/
}
// ---------------------------------------------------------------------------
@@ -496,15 +556,16 @@
//
void VideoFileDetailsViewPlugin::deleteVideoSlot()
{
+ FUNC_LOG;
if (mVideoId != TMPXItemId::InvalidId())
{
QModelIndex modelIndex = mModel->indexOfId(mVideoId);
- QVariant variant = mModel->data(modelIndex, Qt::DisplayRole);
+ QVariant variant = mModel->data(modelIndex, VideoCollectionCommon::KeyTitle);
if (variant.isValid())
{
QString text = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
- variant.toStringList().first());
+ variant.toString());
if (HbMessageBox::question(text))
{
@@ -520,6 +581,7 @@
//
void VideoFileDetailsViewPlugin::deleteItem(QModelIndex index)
{
+ FUNC_LOG;
mDeletedIndex = index.row();
QModelIndexList list;
@@ -535,6 +597,7 @@
void VideoFileDetailsViewPlugin::rowsRemovedSlot(const QModelIndex& parent,
int first, int last)
{
+ FUNC_LOG;
Q_UNUSED(parent);
if(mActivated && mDeletedIndex > -1 &&
@@ -552,6 +615,7 @@
//
void VideoFileDetailsViewPlugin::handleErrorSlot(int errorCode, QVariant &additional)
{
+ FUNC_LOG;
QString msg("");
if(errorCode == VideoCollectionCommon::statusSingleDeleteFail)
{
@@ -575,6 +639,7 @@
void VideoFileDetailsViewPlugin::thumbnailReadySlot(QPixmap pixmap,
void * clientData, int id, int errorCode)
{
+ FUNC_LOG;
Q_UNUSED(clientData);
Q_UNUSED(id);
@@ -631,6 +696,7 @@
}
else
{
+ ERROR(errorCode, "VideoFileDetailsViewPlugin::thumbnailReadySlot() tbn fetch failed.");
mThumbLabel->setIcon(HbIcon(VIDEO_DETAILS_GFX_DEFAULT));
}
}
@@ -641,6 +707,7 @@
//
void VideoFileDetailsViewPlugin::startFetchingThumbnail()
{
+ FUNC_LOG;
int tnId = -1;
if(mModel && mThumbnailManager)
@@ -653,13 +720,10 @@
tnId = mThumbnailManager->getThumbnail(variant.toString(), 0, 5000);
}
}
- else
- {
- qWarning() << "Tried to start fetching thumbnail when either mModel or mThumbnailManager is NULL!";
- }
if(tnId == -1)
{
+ ERROR(-1, "VideoFileDetailsViewPlugin::startFetchingThumbnail() starting the fetch failed.");
mThumbLabel->setIcon(HbIcon(VIDEO_DETAILS_GFX_DEFAULT));
}
}
@@ -670,6 +734,7 @@
//
const QPixmap &VideoFileDetailsViewPlugin::playIcon()
{
+ FUNC_LOG;
// Check if we have already the icon.
if(!mPlayIcon.isNull())
{
@@ -748,6 +813,7 @@
template<class T>
T* VideoFileDetailsViewPlugin::findWidget(QString name)
{
+ FUNC_LOG;
return qobject_cast<T *>(mLoader.findWidget(name));
}
@@ -758,6 +824,7 @@
template<class T>
T* VideoFileDetailsViewPlugin::findObject(QString name)
{
+ FUNC_LOG;
return qobject_cast<T *>(mLoader.findObject(name));
}
--- a/videocollection/videofiledetailsview/tsrc/testplugin/inc/testvideofiledetails.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/inc/testvideofiledetails.h Mon May 03 12:32:50 2010 +0300
@@ -70,7 +70,7 @@
/**
* full details test signal
*/
- void fullDetailsReady(TMPXItemId index);
+ void fullDetailsReady(QVariant& variant);
/**
* data changed test signal
--- a/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/src/testvideofiledetails.cpp Mon May 03 12:32:50 2010 +0300
@@ -20,6 +20,7 @@
#include <QtTest/QtTest>
#include <qdebug.h>
+#include <hbglobal.h>
#include <hbinstance.h>
#include <hbwidget.h>
#include <hblistwidget.h>
@@ -33,6 +34,7 @@
#include "videodetailslabel.h"
#include "hbmessagebox.h"
+#include "shareui.h"
#include "thumbnailmanager_qt.h"
#include "videocollectioncommon.h"
#include "mpxhbvideocommondefs.h"
@@ -63,7 +65,7 @@
mDummyModel = new VideoSortFilterProxyModel();
connect(this, SIGNAL(shortDetailsReady(TMPXItemId)), mDummyModel, SIGNAL(shortDetailsReady(TMPXItemId)));
- connect(this, SIGNAL(fullDetailsReady(TMPXItemId)), mDummyModel, SIGNAL(fullVideoDetailsReady(TMPXItemId)));
+ connect(this, SIGNAL(fullDetailsReady(QVariant&)), mDummyModel, SIGNAL(fullVideoDetailsReady(QVariant&)));
connect(this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
mDummyModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
@@ -81,7 +83,7 @@
void TestVideoFileDetails::cleanupTestCase()
{
disconnect(this, SIGNAL(shortDetailsReady(int)), mDummyModel, SIGNAL(shortDetailsReady(int)));
- disconnect(this, SIGNAL(fullDetailsReady(int)),mDummyModel, SIGNAL(fullVideoDetailsReady(int)));
+ disconnect(this, SIGNAL(fullDetailsReady(QVariant&)),mDummyModel, SIGNAL(fullVideoDetailsReady(QVariant&)));
disconnect(this, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
mDummyModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
disconnect(this, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
@@ -382,9 +384,7 @@
void TestVideoFileDetails::testShortDetailsReadySlot()
{
TMPXItemId testIndex(5,0);
- QStringList display;
- display.append("first row");
- display.append("second row");
+ QString title("title");
QString filepath("filepath");
// TODO need to add the default thumbnail checking.
@@ -399,7 +399,7 @@
QVERIFY( mPlugin->mTitleAnim->text().isEmpty() );
QCOMPARE( mPlugin->mThumbnailManager->mRequests.count(), 0 );
- mDummyModel->setData(Qt::DisplayRole, display);
+ mDummyModel->setData(VideoCollectionCommon::KeyTitle, title);
mDummyModel->setData(VideoCollectionCommon::KeyFilePath, filepath);
// no tn manager
@@ -407,7 +407,7 @@
mPlugin->mThumbnailManager = 0;
emit shortDetailsReady(testIndex);
QCOMPARE( mPlugin->mVideoId, testIndex );
- QCOMPARE( mPlugin->mTitleAnim->text(), display.at(0) );
+ QCOMPARE( mPlugin->mTitleAnim->text(), title );
mPlugin->mThumbnailManager = tmpTnManager;
// data exists
@@ -415,7 +415,7 @@
QCOMPARE( mPlugin->mVideoId, testIndex );
QCOMPARE( mDummyModel->lastId(), testIndex );
- QCOMPARE( mPlugin->mTitleAnim->text(), display.at(0) );
+ QCOMPARE( mPlugin->mTitleAnim->text(), title );
QVERIFY( ThumbnailManager::mRequests.contains(0) );
ThumbnailManager::TnRequest request = ThumbnailManager::mRequests[0];
QCOMPARE( request.name, filepath );
@@ -423,19 +423,19 @@
QCOMPARE( request.priority, 5000 );
- mDummyModel->setData(VideoCollectionCommon::KeyMetaData, createDummyMetadata() );
- emit fullDetailsReady(testIndex);
+ QVariant variant = QVariant(createDummyMetadata());
+ emit fullDetailsReady(variant);
emit shortDetailsReady(testIndex);
- int detailCount = sizeof(VideoCollectionCommon::VideoDetailLabelKeys) / sizeof(int);
+ int detailCount = sizeof(VideoCollectionCommon::VideoDetailLabelKeys) / sizeof(int);
- HbListWidget* list = findWidget<HbListWidget>(TEST_VIDEO_DETAILS_LISTWIDGET);
+ HbListWidget* list = findWidget<HbListWidget>(TEST_VIDEO_DETAILS_LISTWIDGET);
- QVERIFY(list);
- QVERIFY(list->count() == 0);
+ QVERIFY(list);
+ QVERIFY(list->count() == 0);
- cleanup();
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -454,9 +454,9 @@
QVERIFY(list);
QVERIFY(list->count() == 0);
- mDummyModel->setData(VideoCollectionCommon::KeyMetaData, createDummyMetadata() );
+ QVariant variant = QVariant(createDummyMetadata());
- emit fullDetailsReady(testIndex);
+ emit fullDetailsReady(variant);
// verify that actions are currently enabled.
HbStackedWidget* thumbWidget = findWidget<HbStackedWidget>(VIDEO_DETAILS_THUMBNAIL);
@@ -479,9 +479,8 @@
}
// for coverity sake, retest without star-rating
- mDummyModel->reset();
- mDummyModel->setData(VideoCollectionCommon::KeyMetaData, createDummyMetadata() );
- emit fullDetailsReady(testIndex);
+ variant = QVariant(createDummyMetadata());
+ emit fullDetailsReady(variant);
int ii = 0;
for(int i = 0; i<detailCount; i++)
@@ -521,7 +520,8 @@
QCOMPARE( mDummyModel->startPlaybackIndex(), TMPXItemId::InvalidId() );
- emit fullDetailsReady(testIndex);
+ QVariant variant = QVariant(createDummyMetadata());
+ emit fullDetailsReady(variant);
mPlugin->mVideoId = testIndex;
thumbLabel->click();
@@ -543,7 +543,38 @@
//
void TestVideoFileDetails::testSendVideoSlot()
{
- // TODO add test after send video has been implemented.
+ QFAIL("Feature not yet implemented!");
+
+ mDummyModel->reset();
+ init();
+ mPlugin->activateView();
+
+ HbPushButton* shareAction = findWidget<HbPushButton>(VIDEO_DETAILS_BUTTON);
+
+ QVERIFY( shareAction != 0 );
+ shareAction->click();
+ QCOMPARE( mDummyModel->dataAccessCount(), 0 );
+ mPlugin->mVideoId = (0,0);
+
+ mDummyModel->setDataReturnInvalid(true);
+ QModelIndex expected = mDummyModel->index(0, 0);
+ shareAction->click();
+ QCOMPARE( mDummyModel->dataAccessCount(), 1 );
+ QVERIFY( mDummyModel->lastIndex() == expected );
+ QCOMPARE( ShareUi::mFileList.count(), 0 );
+ QVERIFY( ShareUi::mEmbedded == false );
+
+ mDummyModel->setDataReturnInvalid(false);
+ QString filePath("dummyfilepath");
+ mDummyModel->setData(VideoCollectionCommon::KeyFilePath, filePath);
+ shareAction->click();
+ QCOMPARE( mDummyModel->dataAccessCount(), 2 );
+ QVERIFY( mDummyModel->lastIndex() == expected );
+ QVERIFY( ShareUi::mEmbedded );
+ QCOMPARE( ShareUi::mFileList.count(), 1 );
+ QCOMPARE( ShareUi::mFileList.at(0), filePath );
+
+ cleanup();
}
// ---------------------------------------------------------------------------
@@ -580,10 +611,10 @@
QStringList display;
display.append("first row");
display.append("second row");
- mDummyModel->setData(Qt::DisplayRole, display);
+ mDummyModel->setData(VideoCollectionCommon::KeyTitle, display);
- QString expectedText = tr("Do you want to delete \"%1\"?").arg(
- display.at(0));
+ QString expectedText = hbTrId("txt_videos_info_do_you_want_to_delete_1").arg(
+ display.first());
HbMessageBox::mQuestionReturnValue = true;
deleteAction->trigger();
@@ -632,7 +663,8 @@
QCOMPARE( mCommandReceived, false );
QCOMPARE( mReceivedCommand, -1 );
- emit fullDetailsReady(testID);
+ QVariant variant = QVariant(createDummyMetadata());
+ emit fullDetailsReady(variant);
mPlugin->mVideoId = testID;
mPlugin->mDeletedIndex = testIndex;
@@ -681,7 +713,7 @@
QString txt = "testdata";
additional = txt;
emit testErrorSignal( VideoCollectionCommon::statusSingleDeleteFail , additional);
- QCOMPARE(HbMessageBox::mLatestTxt, QString("Unable to delete item %1. It is currently open.").arg(txt));
+ QCOMPARE(HbMessageBox::mLatestTxt, hbTrId("txt_videos_info_unable_to_delete_1_it_is_current").arg(txt));
HbMessageBox::mLatestTxt = "";
// VideoCollectionCommon::statusMultipleDeleteFail
@@ -709,7 +741,7 @@
init();
activateView();
- mDummyModel->setData(Qt::DisplayRole, display);
+ mDummyModel->setData(VideoCollectionCommon::KeyTitle, display);
mDummyModel->setData(VideoCollectionCommon::KeyFilePath, filepath);
emit shortDetailsReady(testIndex);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/shareui.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: shareui dialog stub.
+ *
+*/
+
+#ifndef SHAREUI_H_
+#define SHAREUI_H_
+
+// SYSTEM INCLUDES
+#include <QStringList>
+
+/**
+ * This class offers message creation and sending services.
+ */
+class ShareUi
+ {
+
+public:
+ /**
+ * Constructor
+ */
+ ShareUi() {}
+
+ /**
+ * Destructor
+ */
+ ~ShareUi() {}
+
+
+ bool send(QStringList& fileList, bool embedded)
+ {
+ mFileList = fileList;
+ mEmbedded = embedded;
+ return true;
+ }
+
+public:
+
+ static QStringList mFileList;
+ static bool mEmbedded;
+ };
+
+#endif
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/videosortfilterproxymodel.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/inc/videosortfilterproxymodel.h Mon May 03 12:32:50 2010 +0300
@@ -74,7 +74,7 @@
void shortDetailsReady(TMPXItemId index);
- void fullVideoDetailsReady(TMPXItemId index);
+ void fullVideoDetailsReady(QVariant& variant);
public: // from QAbstractItemModel
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/shareui.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 shareui
+*
+*/
+
+#include "shareui.h"
+
+QStringList ShareUi::mFileList = QStringList();
+bool ShareUi::mEmbedded = false;
+
+
+
+
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/videoservices.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/videoservices.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,8 +15,10 @@
*
*/
-#include <videoservices.h>
-#include <videoserviceurifetch.h>
+// Version : %version: %
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
VideoServices *VideoServices::mInstance = 0;
--- a/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/videoserviceurifetch.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/videoserviceurifetch.cpp Mon May 03 12:32:50 2010 +0300
@@ -11,12 +11,14 @@
*
* Contributors:
*
-* Description: ?Description
+* Description: Implementation of VideoServiceUriFetch Stub
*
*/
-#include <videoservices.h>
-#include <videoserviceurifetch.h>
+// Version : %version: %
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
// ----------------------------------------------------------------------------
--- a/videocollection/videofiledetailsview/tsrc/testplugin/testvideofiledetailsviewplugin.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/testvideofiledetailsviewplugin.pro Mon May 03 12:32:50 2010 +0300
@@ -56,6 +56,7 @@
stub/inc/videocollectionwrapper.h \
stub/inc/videosortfilterproxymodel.h \
stub/inc/hbmessagebox.h \
+ stub/inc/shareui.h \
stub/inc/thumbnailmanager_qt.h \
stub/inc/videoservices.h \
stub/inc/videoserviceurifetch.h \
@@ -66,6 +67,7 @@
stub/src/videocollectionwrapper.cpp \
stub/src/videosortfilterproxymodel.cpp \
stub/src/hbmessagebox.cpp \
+ stub/src/shareui.cpp \
stub/src/thumbnailmanager_qt.cpp \
stub/src/videoservices.cpp \
stub/src/videoserviceurifetch.cpp \
--- a/videocollection/videofiledetailsview/videofiledetailsview.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videocollection/videofiledetailsview/videofiledetailsview.pro Mon May 03 12:32:50 2010 +0300
@@ -45,8 +45,6 @@
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE \
- ../../videoplayerapp/videoplayerengine/inc \
- ../../videoplayerapp/inc \
/epoc32/include/mw/hb/hbtools \
/epoc32/include/mw
@@ -66,6 +64,8 @@
-lthumbnailmanagerqt.dll \
-lmediaclientvideodisplay.dll \
-lxqserviceutil.dll \
- -lvideoplayerengine.dll
+ -lvideoplayerengine.dll \
+ -lshareui.dll \
+ -lflogger.dll
RESOURCES += data/videofiledetails.qrc
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackbuttonbar.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackbuttonbar.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#9 %
+// Version : %version: da1mmcf#12 %
@@ -43,9 +43,19 @@
EMPXButtonStretch,
EMPXButtonZoom,
EMPXButtonDetails,
+ EMPXButtonAttach,
EMPXButtonCount // Should always be the last value
};
+enum TMPXSeekingState
+{
+ EMPXNotSeeking,
+ EMPXFastForwarding,
+ EMPXRewinding
+};
+
+const int KMPXFastForward = 30;
+const int KMPXRewind = -10;
class QMPXVideoPlaybackButtonBar : public HbWidget
{
@@ -58,22 +68,28 @@
void aspectRatioChanged( int aspectRatio );
void initialize();
void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
+ void positionChanged( int position );
+ void durationChanged( int duration );
private slots:
void play();
void pause();
void changeAspectRatio();
void handleButtonPressed();
- void startFFSeeking();
- void startRWSeeking();
- void endSeeking();
+ void ffPressing();
+ void rwPressing();
+ void ffReleased();
+ void rwReleased();
void openDetailsView();
private:
QMPXVideoPlaybackControlsController *mController;
+ QList<HbPushButton*> mButtons;
+ TMPXSeekingState mSeekingState;
- QList<HbPushButton*> mButtons;
- bool mInitialized;
+ bool mInitialized;
+ int mPosition;
+ int mDuration;
};
#endif /*MPXVIDEOPLAYBACKBUTTONBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolconfiguration.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackcontrolconfiguration.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#6 %
+// Version : %version: da1mmcf#7 %
@@ -63,11 +63,12 @@
void updateControlsWithFileDetails();
- private:
/**
* Create control list
*/
void createControlList();
+
+ private:
/**
* Delete controls from list
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfiledetailswidget.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 10 %
@@ -42,12 +42,11 @@
public:
void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
- private:
- QString valueToReadableFormat( int value );
-
+ private:
void makeTitleItem( QMPXVideoPlaybackViewFileDetails* details );
void makeSizeItem( QMPXVideoPlaybackViewFileDetails* details );
void makeBitRateItem( QMPXVideoPlaybackViewFileDetails* details );
+ void makeDateTimeItem( QMPXVideoPlaybackViewFileDetails* details );
void addItemToListWidget( QString item, QString text );
private:
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfullscreencontrol.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackfullscreencontrol.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#7 %
+// Version : %version: da1mmcf#8 %
@@ -56,11 +56,6 @@
TMPXVideoPlaybackControls controlIndex();
/**
- * set changed volume
- */
- bool volumeChanged( int aVolume );
-
- /**
* set changed duration
*/
bool durationChanged( int duration );
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacknontouchvolumebar.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of QMPXVideoPlaybackNonTouchVolumeBar
-*
-*/
-
-// Version : %version: 4 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKNONTOUCHVOLUMEBAR_H_
-#define MPXVIDEOPLAYBACKNONTOUCHVOLUMEBAR_H_
-
-
-#include <hbvolumesliderpopup.h>
-
-class QTimer;
-class QGraphicsSceneMouseEvent;
-
-class QMPXVideoPlaybackNonTouchVolumeBar : public HbVolumeSliderPopup
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackNonTouchVolumeBar();
-
- virtual ~QMPXVideoPlaybackNonTouchVolumeBar();
-
- public:
- void setVisible( bool visible );
- virtual void mousePressEvent( QGraphicsSceneMouseEvent *event );
- virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
-
- private slots:
- void hideVolumeControl();
-
- private:
- QTimer *mVolumeTimer;
-};
-
-#endif /*MPXVIDEOPLAYBACKNONTOUCHVOLUMEBAR_H_*/
-
--- a/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybackprogressbar.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#9 %
+// Version : %version: da1mmcf#10 %
@@ -25,8 +25,8 @@
#include <hbwidget.h>
#include <mpxplaybackframeworkdefs.h>
-class HbLabel;
-class HbProgressBar;
+class QTimer;
+class HbProgressSlider;
class QMPXVideoPlaybackViewFileDetails;
class QMPXVideoPlaybackControlsController;
@@ -37,9 +37,6 @@
public:
QMPXVideoPlaybackProgressBar( QMPXVideoPlaybackControlsController* controller );
virtual ~QMPXVideoPlaybackProgressBar();
- void mousePressEvent( QGraphicsSceneMouseEvent *event );
- void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
- void mouseMoveEvent( QGraphicsSceneMouseEvent *event );
void initialize();
void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
void updateState( TMPXPlaybackState state );
@@ -48,20 +45,31 @@
void durationChanged( int duration );
void positionChanged( int position );
+ private slots:
+ void handleSliderPressed();
+ void handleSliderMoved( int value );
+ void handleSliderReleased();
+ void handleSeekingTimeout();
+
private:
QString valueToReadableFormat( int value );
void updatePostion( int position );
private:
QMPXVideoPlaybackControlsController *mController;
- HbProgressBar *mProgressSlider;
- HbLabel *mDurationLabel;
- HbLabel *mPositionLabel;
+ HbProgressSlider *mProgressSlider;
+
+ int mDuration;
+ int mDraggingPosition;
+ int mSetPosition;
- int mDuration;
- bool mNeedToResumeAfterSetPosition;
- bool mInitialized;
- bool mDragging;
+ bool mNeedToResumeAfterSetPosition;
+ bool mInitialized;
+ bool mSliderDragging;
+ bool mLongTimeFormat;
+ bool mLiveStreaming;
+
+ QTimer *mSeekingTimer;
};
#endif /*MPXVIDEOPLAYBACKPROGRESSBAR_H_*/
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackbuttonbar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackbuttonbar.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#21 %
+// Version : %version: da1mmcf#25 %
@@ -36,7 +36,10 @@
QMPXVideoPlaybackButtonBar::QMPXVideoPlaybackButtonBar(
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
+ , mSeekingState( EMPXNotSeeking )
, mInitialized( false )
+ , mPosition( 0 )
+ , mDuration( 0 )
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackButtonBar::QMPXVideoPlaybackButtonBar"));
}
@@ -72,8 +75,10 @@
//
QGraphicsWidget *widget = loader->findWidget( QString( "rwButton" ) );
HbPushButton *rwButton = qobject_cast<HbPushButton*>( widget );
- connect( rwButton, SIGNAL( pressed() ), this, SLOT( startRWSeeking() ) );
- connect( rwButton, SIGNAL( released() ), this, SLOT( endSeeking() ) );
+ connect( rwButton, SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
+ connect( rwButton, SIGNAL( longPress( QPointF ) ), this, SLOT( rwPressing() ) );
+ connect( rwButton, SIGNAL( released() ), this, SLOT( rwReleased() ) );
+
mButtons.append( rwButton );
//
@@ -101,8 +106,9 @@
//
widget = loader->findWidget( QString( "ffButton" ) );
HbPushButton *ffButton = qobject_cast<HbPushButton*>( widget );
- connect( ffButton, SIGNAL( pressed() ), this, SLOT( startFFSeeking() ) );
- connect( ffButton, SIGNAL( released() ), this, SLOT( endSeeking() ) );
+ connect( ffButton, SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
+ connect( ffButton, SIGNAL( longPress( QPointF ) ), this, SLOT( ffPressing() ) );
+ connect( ffButton, SIGNAL( released() ), this, SLOT( ffReleased() ) );
mButtons.append( ffButton );
//
@@ -135,10 +141,52 @@
connect( detailsButton, SIGNAL( released() ), this, SLOT( openDetailsView() ) );
mButtons.append( detailsButton );
+ //
+ // Attach button
+ //
+ widget = loader->findWidget( QString( "attachButton" ) );
+ HbPushButton *attachButton = qobject_cast<HbPushButton*>( widget );
+ connect( attachButton, SIGNAL( pressed() ), this, SLOT( handleButtonPressed() ) );
+ connect( attachButton, SIGNAL( released() ), mController, SLOT( attachVideo() ) );
+ mButtons.append( attachButton );
+
for ( int i = 0 ; i < EMPXButtonCount ; i++ )
{
mButtons[i]->setFlag( QGraphicsItem::ItemIsFocusable, false );
}
+
+ mDuration = (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier;
+
+ //
+ // obtain layout for aspect ratio which contains all 3 aspect ratio buttons:
+ // natural, stretch, zoom
+ //
+ widget = loader->findWidget( QString( "aspectRatioButtons" ) );
+
+ if ( mController->isAttachOperation() )
+ {
+ //
+ // disable 3 aspect ratio buttons
+ //
+ widget->setVisible( false );
+
+ //
+ // enable "attach" button
+ //
+ mButtons[EMPXButtonAttach]->setVisible( true );
+ }
+ else
+ {
+ //
+ // enable 3 aspect ratio buttons
+ //
+ widget->setVisible( true );
+
+ //
+ // disable "attach" button
+ //
+ mButtons[EMPXButtonAttach]->setVisible( false );
+ }
}
}
@@ -155,46 +203,106 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackButtonBar::startFFSeeking()
+// QMPXVideoPlaybackButtonBar::ffPressing()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackButtonBar::startFFSeeking()
+void QMPXVideoPlaybackButtonBar::ffPressing()
{
- MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::startFFSeeking()"));
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackButtonBar::ffPressing()"),
+ _L("mSeekingState = %d"), mSeekingState );
+
+ if ( mSeekingState == EMPXNotSeeking )
+ {
+ mSeekingState = EMPXFastForwarding;
+ mButtons[EMPXButtonFF]->setSelected( true );
+
+ mController->handleCommand( EMPXPbvCmdSeekForward );
+ }
+}
- mButtons[EMPXButtonFF]->setSelected( true );
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackButtonBar::rwPressing()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackButtonBar::rwPressing()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackButtonBar::rwPressing()"),
+ _L("mSeekingState = %d"), mSeekingState );
- mController->resetDisappearingTimers( EMPXTimerCancel );
- mController->handleCommand( EMPXPbvCmdSeekForward );
+
+ if ( mSeekingState == EMPXNotSeeking )
+ {
+ mSeekingState = EMPXRewinding;
+ mButtons[EMPXButtonRW]->setSelected( true );
+
+ mController->handleCommand( EMPXPbvCmdSeekBackward );
+ }
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackButtonBar::startRWSeeking()
+// QMPXVideoPlaybackButtonBar::ffReleased()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackButtonBar::startRWSeeking()
+void QMPXVideoPlaybackButtonBar::ffReleased()
{
- MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::startRWSeeking()"));
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackButtonBar::ffReleased()"),
+ _L("mSeekingState = %d"), mSeekingState );
- mButtons[EMPXButtonRW]->setSelected( true );
+ if ( mSeekingState == EMPXFastForwarding )
+ {
+ mSeekingState = EMPXNotSeeking;
+ mController->handleCommand( EMPXPbvCmdEndSeek );
+ mButtons[EMPXButtonFF]->setSelected( false );
+ }
+ else
+ {
+ int temp = mPosition + KMPXFastForward;
+ MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::ffReleased() temp position = %d"), temp);
- mController->resetDisappearingTimers( EMPXTimerCancel );
- mController->handleCommand( EMPXPbvCmdSeekBackward );
+ //
+ // If it has the playing time which is less than KMPXFastForward, ignore
+ //
+ if ( temp < mDuration )
+ {
+ mController->handleCommand( EMPXPbvCmdSetPosition, temp );
+ }
+ }
+
+ mController->resetDisappearingTimers( EMPXTimerReset );
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackButtonBar::endSeeking()
+// QMPXVideoPlaybackButtonBar::rwReleased()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackButtonBar::endSeeking()
+void QMPXVideoPlaybackButtonBar::rwReleased()
{
- MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::endSeeking()"));
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackButtonBar::rwReleased()"),
+ _L("mSeekingState = %d"), mSeekingState );
- mButtons[EMPXButtonFF]->setSelected( false );
- mButtons[EMPXButtonRW]->setSelected( false );
+ if ( mSeekingState == EMPXRewinding )
+ {
+ mSeekingState = EMPXNotSeeking;
+ mController->handleCommand( EMPXPbvCmdEndSeek );
+ mButtons[EMPXButtonRW]->setSelected( false );
+ }
+ else
+ {
+ int temp = mPosition + KMPXRewind;
+ MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::rwReleased() temp position = %d"), temp);
+
+ //
+ // If it played less than KMPXRewind, jump to 0
+ //
+ if ( temp < 0 )
+ {
+ temp = 0;
+ }
+
+ mController->handleCommand( EMPXPbvCmdSetPosition, temp );
+ }
mController->resetDisappearingTimers( EMPXTimerReset );
- mController->handleCommand( EMPXPbvCmdEndSeek );
}
// -------------------------------------------------------------------------------------------------
@@ -217,20 +325,23 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::changeAspectRatio()"));
- mController->resetDisappearingTimers( EMPXTimerReset );
-
- TMPXVideoPlaybackViewCommandIds cmd = EMPXPbvCmdNaturalAspectRatio;
-
- if ( mButtons[EMPXButtonStretch]->isVisible() )
- {
- cmd = EMPXPbvCmdStretchAspectRatio;
+ if ( ! mController->isAttachOperation() )
+ {
+ mController->resetDisappearingTimers( EMPXTimerReset );
+
+ TMPXVideoPlaybackViewCommandIds cmd = EMPXPbvCmdNaturalAspectRatio;
+
+ if ( mButtons[EMPXButtonStretch]->isVisible() )
+ {
+ cmd = EMPXPbvCmdStretchAspectRatio;
+ }
+ else if ( mButtons[EMPXButtonZoom]->isVisible() )
+ {
+ cmd = EMPXPbvCmdZoomAspectRatio;
+ }
+
+ mController->handleCommand( cmd );
}
- else if ( mButtons[EMPXButtonZoom]->isVisible() )
- {
- cmd = EMPXPbvCmdZoomAspectRatio;
- }
-
- mController->handleCommand( cmd );
}
// -------------------------------------------------------------------------------------------------
@@ -245,7 +356,10 @@
{
case EPbStatePlaying:
{
- setEnabled( true );
+ if ( ! isEnabled() )
+ {
+ setEnabled( true );
+ }
mButtons[EMPXButtonPlay]->setVisible( false );
mButtons[EMPXButtonPause]->setVisible( true );
@@ -253,7 +367,10 @@
}
case EPbStatePaused:
{
- setEnabled( true );
+ if ( ! isEnabled() )
+ {
+ setEnabled( true );
+ }
mButtons[EMPXButtonPause]->setVisible( false );
mButtons[EMPXButtonPlay]->setVisible( true );
@@ -263,7 +380,10 @@
case EPbStateInitialising:
case EPbStateBuffering:
{
- setEnabled( false );
+ if ( isEnabled() )
+ {
+ setEnabled( false );
+ }
break;
}
@@ -278,29 +398,32 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
- switch( aspectRatio )
+ if ( ! mController->isAttachOperation() )
{
- case EMMFNatural:
- {
- mButtons[EMPXButtonNatural]->setVisible( false );
- mButtons[EMPXButtonStretch]->setVisible( true );
- mButtons[EMPXButtonZoom]->setVisible( false );
- break;
- }
- case EMMFStretch:
+ switch( aspectRatio )
{
- mButtons[EMPXButtonNatural]->setVisible( false );
- mButtons[EMPXButtonStretch]->setVisible( false );
- mButtons[EMPXButtonZoom]->setVisible( true );
- break;
- }
- default:
- {
- mButtons[EMPXButtonNatural]->setVisible( true );
- mButtons[EMPXButtonStretch]->setVisible( false );
- mButtons[EMPXButtonZoom]->setVisible( false );
- break;
- }
+ case EMMFNatural:
+ {
+ mButtons[EMPXButtonNatural]->setVisible( false );
+ mButtons[EMPXButtonStretch]->setVisible( true );
+ mButtons[EMPXButtonZoom]->setVisible( false );
+ break;
+ }
+ case EMMFStretch:
+ {
+ mButtons[EMPXButtonNatural]->setVisible( false );
+ mButtons[EMPXButtonStretch]->setVisible( false );
+ mButtons[EMPXButtonZoom]->setVisible( true );
+ break;
+ }
+ default:
+ {
+ mButtons[EMPXButtonNatural]->setVisible( true );
+ mButtons[EMPXButtonStretch]->setVisible( false );
+ mButtons[EMPXButtonZoom]->setVisible( false );
+ break;
+ }
+ }
}
}
@@ -324,20 +447,23 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::updateWithFileDetails()"));
- if ( ! details->mVideoEnabled ||
- details->mVideoHeight <= 0 ||
- details->mVideoWidth <= 0 ||
- details->mTvOutConnected )
- {
- mButtons[EMPXButtonNatural]->setEnabled( false );
- mButtons[EMPXButtonStretch]->setEnabled( false );
- mButtons[EMPXButtonZoom]->setEnabled( false );
- }
- else
- {
- mButtons[EMPXButtonNatural]->setEnabled( true );
- mButtons[EMPXButtonStretch]->setEnabled( true );
- mButtons[EMPXButtonZoom]->setEnabled( true );
+ if ( ! mController->isAttachOperation() )
+ {
+ if ( ! details->mVideoEnabled ||
+ details->mVideoHeight <= 0 ||
+ details->mVideoWidth <= 0 ||
+ details->mTvOutConnected )
+ {
+ mButtons[EMPXButtonNatural]->setEnabled( false );
+ mButtons[EMPXButtonStretch]->setEnabled( false );
+ mButtons[EMPXButtonZoom]->setEnabled( false );
+ }
+ else
+ {
+ mButtons[EMPXButtonNatural]->setEnabled( true );
+ mButtons[EMPXButtonStretch]->setEnabled( true );
+ mButtons[EMPXButtonZoom]->setEnabled( true );
+ }
}
//
@@ -395,7 +521,7 @@
for ( int i = 0 ; i < EMPXButtonCount ; i++ )
{
QGraphicsItem* widget = mButtons[i]->primitive( HbStyle::P_PushButton_background );
- widget->setVisible( backgrondVisible );
+ widget->setVisible( backgrondVisible );
}
}
@@ -415,4 +541,26 @@
}
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackProgressBar::positionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackButtonBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::positionChanged position = %d"), position );
+
+ mPosition = position;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackButtonBar::durationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackButtonBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::durationChanged duration = %d"), duration );
+
+ mDuration = duration;
+}
+
//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolbar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolbar.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 5 %
@@ -102,9 +102,9 @@
//
mFrameItem = new HbFrameItem ( this );
mFrameItem->setGeometry( boundingRect() );
- mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::OnePiece );
+ mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
+ mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
mFrameItem->frameDrawer().setFillWholeRect( true );
- mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_status_trans_normal_c" );
mFrameItem->setVisible( false );
}
}
@@ -170,15 +170,51 @@
//
void QMPXVideoPlaybackControlBar::setVisibleToControlBar( bool visible )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::setVisibleToControlBar() %d"), visible);
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlBar::setVisibleToControlBar()"),
+ _L("visible = %d, current visibility = %d"), visible, isVisible() );
- if ( visible && isVisible() == false )
+ //
+ // Change the visibility if the following condition meet:
+ // - visible is true
+ // - appear effect is not going on
+ // - disappear effect is going on (assume current visiblity is false)
+ //
+ if ( visible &&
+ ! HbEffect::effectRunning( this, "appear" ) &&
+ ( ! isVisible() || HbEffect::effectRunning( this, "disappear" ) ) )
{
+ //
+ // If disappear effect is running on this, cancel
+ //
+ if ( HbEffect::effectRunning( this, "disappear" ) )
+ {
+ HbEffect::cancel( this );
+ }
+
+ if ( ! isEnabled() )
+ {
+ setEnabled( true );
+ }
+
setVisible( true );
+
HbEffect::start( this, "appear", this, "appeared" );
}
- else if ( ! visible && isVisible() == true )
+ else if ( ! visible && isVisible()&& ! HbEffect::effectRunning( this, "disappear" ) )
{
+ //
+ // If appear effect is running on this, cancel
+ //
+ if( HbEffect::effectRunning( this, "appear" ) )
+ {
+ HbEffect::cancel( this );
+ }
+
+ if ( isEnabled() )
+ {
+ setEnabled( false );
+ }
+
HbEffect::start( this, "disappear", this, "disappeared" );
}
}
@@ -209,10 +245,10 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::disappeared()"));
- setVisible( false );
-
if ( status.reason == Hb::EffectFinished )
{
+ setVisible( false );
+
MPX_DEBUG(_L("QMPXVideoPlaybackControlBar::disappeared() successful"));
}
else
@@ -233,6 +269,11 @@
{
mProgressBar->durationChanged( duration );
}
+
+ if ( mButtonBar )
+ {
+ mButtonBar->durationChanged( duration );
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -247,6 +288,11 @@
{
mProgressBar->positionChanged( position );
}
+
+ if ( mButtonBar )
+ {
+ mButtonBar->positionChanged( position );
+ }
}
//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolconfiguration.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#17 %
+// Version : %version: da1mmcf#19 %
@@ -40,7 +40,6 @@
QMPXVideoPlaybackControlsController* controller)
: mControlsController( controller )
{
- createControlList();
}
// -------------------------------------------------------------------------------------------------
@@ -65,10 +64,11 @@
QMPXVideoPlaybackViewFileDetails* fileDetails = mControlsController->fileDetails();
- if ( fileDetails->mPlaybackMode != EMPXVideoLocal )
+ if ( fileDetails->mPlaybackMode == EMPXVideoStreaming ||
+ fileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
{
//
- // if it's not local mode, add branding animation control to show while initializing
+ // streaming, add branding animation control to show while initializing
//
addControlToList( EMPXBufferingAnimation );
}
@@ -132,7 +132,7 @@
case EMPXControlCmdTvOutConnected:
case EMPXControlCmdAudionOnlyViewOpened:
{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() audion only view"));
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlConfiguration::updateControlList() audio only view"));
widget->setVisible( false );
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolpolicy.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#10 %
+// Version : %version: da1mmcf#12 %
@@ -71,17 +71,20 @@
}
case EMPXStatusPane:
{
- if ( details->mPlaybackMode != EMPXVideoLocal ||
- viewMode == EAudioOnlyView ||
- viewMode == EDetailsView )
- {
- properties = EMPXAllProperties;
- }
- else
+ //
+ // If it is local playback & full screen view, show the controls while buffering
+ // If not, won't show
+ //
+ if ( details->mPlaybackMode == EMPXVideoLocal && viewMode == EFullScreenView )
{
properties = EMPXShownWhenPlaying |
EMPXShownWhenPaused |
- EMPXShownWhenSeeking;
+ EMPXShownWhenSeeking |
+ EMPXShownWhenBuffering;
+ }
+ else
+ {
+ properties = EMPXAllProperties;
}
break;
}
@@ -102,9 +105,23 @@
}
else
{
- properties = EMPXShownWhenPlaying |
- EMPXShownWhenPaused |
- EMPXShownWhenSeeking;
+ //
+ // If it is local playback, show the controls while buffering
+ // If not, won't show
+ //
+ if ( details->mPlaybackMode == EMPXVideoLocal )
+ {
+ properties = EMPXShownWhenPlaying |
+ EMPXShownWhenPaused |
+ EMPXShownWhenSeeking |
+ EMPXShownWhenBuffering;
+ }
+ else
+ {
+ properties = EMPXShownWhenPlaying |
+ EMPXShownWhenPaused |
+ EMPXShownWhenSeeking;
+ }
}
break;
}
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#29 %
+// Version : %version: da1mmcf#34 %
@@ -28,12 +28,13 @@
#include <QTimer>
#include <QFileInfo>
#include <thumbnailmanager_qt.h>
+#include <xqserviceutil.h>
#include <hblabel.h>
-#include <hbaction.h>
#include <hbiconitem.h>
#include <hbratingslider.h>
#include <hbiconanimator.h>
+#include <hbvolumesliderpopup.h>
#include <hbtransparentwindow.h>
#include <hbiconanimationmanager.h>
@@ -45,11 +46,11 @@
#include "mpxvideoplaybackviewfiledetails.h"
#include "mpxvideoplaybackstatuspanecontrol.h"
#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybacknontouchvolumebar.h"
#include "mpxvideoplaybackfullscreencontrol.h"
#include "mpxvideoplaybackcontrolscontroller.h"
#include "mpxvideoplaybackcontrolconfiguration.h"
#include "mpxvideoplaybackdetailsplaybackwindow.h"
+#include "videoservices.h"
// ================= MEMBER FUNCTIONS ==============================================================
@@ -71,7 +72,9 @@
, mLoader( NULL )
, mVolumeControl( NULL )
, mThumbnailManager( NULL )
+ , mVideoServices( 0 )
, mViewTransitionIsGoingOn( false )
+ , mIsAttachOperation( false )
, mThumbNailState( EThumbNailEmpty )
, mState( EPbStateNotInitialised )
, mViewMode( EFullScreenView )
@@ -102,13 +105,11 @@
{
QGraphicsWidget *widget = mLoader->findWidget( QString( "content" ) );
mView->setWidget( widget );
-
- widget = mLoader->findWidget( QString( "volumeSlider" ) );
- mVolumeControl = qobject_cast<QMPXVideoPlaybackNonTouchVolumeBar*>( widget );
}
else
{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml"));
+ MPX_DEBUG(
+ _L("QMPXVideoPlaybackControlsController::initializeController()- can't find xml"));
//
// Can't find xml for layout. Delete mLoader
@@ -117,17 +118,56 @@
mLoader = NULL;
}
- mControlsPolicy = new QMPXVideoPlaybackControlPolicy();
- mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this );
-
- connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
-
mControlsTimer = new QTimer( this );
mControlsTimer->setInterval( KMPXControlsTimeOut );
mControlsTimer->setSingleShot( false );
connect( mControlsTimer, SIGNAL( timeout() ), this, SLOT( hideAllControls() ) );
connect( mView, SIGNAL( tappedOnScreen() ), this, SLOT( handleTappedOnScreen() ) );
+
+ mControlsPolicy = new QMPXVideoPlaybackControlPolicy();
+
+ mControlsConfig = new QMPXVideoPlaybackControlConfiguration( this );
+ connect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
+ mControlsConfig->createControlList();
+
+ mVolumeControl = new HbVolumeSliderPopup();
+ mVolumeControl->setVisible( false );
+ mVolumeControl->setTimeout( KMPXControlsTimeOut );
+ mVolumeControl->setTickPosition( Hb::NoSliderTicks );
+ mVolumeControl->setRange( KPbPlaybackVolumeLevelMin, KPbPlaybackVolumeLevelMax );
+
+ //
+ // if videoplayback is in service mode, create a videoservices instance
+ //
+ if ( XQServiceUtil::isService() && ! mVideoServices )
+ {
+ //
+ // obtain VideoServices instance
+ //
+ mVideoServices = VideoServices::instance();
+
+ //
+ // allow 'attach' operation only for non-streaming media clips
+ //
+ if ( mVideoServices && mFileDetails->mPlaybackMode == EMPXVideoLocal )
+ {
+ //
+ // determine if this is 'attach' operation
+ //
+ mIsAttachOperation = ( mVideoServices->currentService() == VideoServices::EUriFetcher );
+
+ if ( mIsAttachOperation )
+ {
+ //
+ // connect signal filePath() to videoservices slot itemSelected()
+ //
+ connect( this, SIGNAL( attachVideoPath( const QString& ) ),
+ mVideoServices, SLOT( itemSelected( const QString& ) ) );
+ }
+ }
+ }
+
}
// -------------------------------------------------------------------------------------------------
@@ -136,7 +176,7 @@
//
QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()"));
disconnect( mControlsConfig, SIGNAL( controlListUpdated() ), this, SLOT( controlsListUpdated() ) );
@@ -174,8 +214,33 @@
if ( mThumbnailManager )
{
delete mThumbnailManager;
- mThumbnailManager = 0;
+ mThumbnailManager = NULL;
+ }
+
+ if ( mVolumeControl )
+ {
+ delete mVolumeControl;
+ mVolumeControl = NULL;
}
+
+ if ( mIsAttachOperation )
+ {
+ //
+ // disable connection for 'attach' operation
+ //
+ disconnect( this, SIGNAL( attachVideoPath( const QString& ) ),
+ mVideoServices, SLOT( itemSelected( const QString& ) ) );
+ }
+
+ if ( mVideoServices )
+ {
+ //
+ // decrease videoservices instance count
+ //
+ mVideoServices->decreaseReferenceCount();
+ mVideoServices = 0;
+ }
+
}
// -------------------------------------------------------------------------------------------------
@@ -187,17 +252,6 @@
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::addFileDetails"));
- //
- // If it is not local, hide the star rating
- //
- if ( details->mPlaybackMode != EMPXVideoLocal )
- {
- QString sectionName = "nonLocalPlayback";
-
- bool ok = false;
- mLoader->load( KMPXPLAYBACKVIEW_XML, sectionName, &ok );
- }
-
mFileDetails = details;
mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
@@ -363,34 +417,25 @@
switch ( newState )
{
- case EPbStateInitialised:
- {
- //
- // remove branding control when the state is transitioned to Initialized
- //
- if ( mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
- mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming )
- {
- mControlsConfig->updateControlList( EMPXControlCmdPluginInitialized );
- }
-
- break;
- }
case EPbStatePlaying:
case EPbStateInitialising:
case EPbStateBuffering:
case EPbStatePaused:
case EPbStateNotInitialised:
{
- updateState();
-
//
// Show all the controls
//
showControls();
+ updateState();
+
break;
}
+ default:
+ {
+ break;
+ }
}
}
}
@@ -1069,7 +1114,8 @@
void QMPXVideoPlaybackControlsController::changeViewMode(
TPlaybackViewMode viewMode, bool transitionEffect )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode( %d, %d )"),
+ viewMode, transitionEffect );
if ( viewMode != mViewMode )
{
@@ -1159,7 +1205,8 @@
//
void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect()"));
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect( %d )"),
+ transitionEffect );
if ( mFileDetails->mVideoEnabled && ! mFileDetails->mTvOutConnected )
{
@@ -1167,6 +1214,9 @@
QRectF rect;
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updateVideoRect() : mViewMode = %d )"),
+ mViewMode );
+
if ( mViewMode == EDetailsView )
{
QGraphicsWidget *parent = mLoader->findWidget( QString( "detailsPlaybackWindow" ) );
@@ -1285,16 +1335,6 @@
hbIcon->setSize( tvOutBitmap->size() );
tvOutLabel->setIcon( *hbIcon );
- if ( qicon )
- {
- delete qicon;
- }
-
- if ( hbIcon )
- {
- delete hbIcon;
- }
-
mThumbNailState = EThumbNailSet;
}
else
@@ -1308,4 +1348,36 @@
this, SLOT( handleThumbnailReady( QPixmap , void * , int , int ) ) );
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::isAttachOperation
+// -------------------------------------------------------------------------------------------------
+//
+bool QMPXVideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation );
+
+ return mIsAttachOperation;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::attachVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::attachVideo()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"));
+
+ //
+ // close and release resources
+ //
+ handleCommand( EMPXPbvCmdClose );
+
+ //
+ // emit signal to launch videoservices itemSelected() slot
+ //
+ emit( attachVideoPath( mFileDetails->mClipName ) );
+
+}
+
// End of File
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 11 %
+// Version : %version: 13 %
@@ -81,7 +81,7 @@
mPlayButton->setFlag( QGraphicsItem::ItemIsFocusable, false );
connect( mPlayButton, SIGNAL( released() ), this, SLOT( playPause() ) );
-
+
QGraphicsItem *widget1 = mPlayButton->primitive( HbStyle::P_PushButton_background );
widget1->setVisible( false );
@@ -90,9 +90,34 @@
//
HbFrameItem *frameItem = new HbFrameItem ( mPlayButton );
frameItem->setGeometry( mPlayButton->boundingRect() );
- frameItem->frameDrawer().setFrameType( HbFrameDrawer::OnePiece );
+ frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
+ frameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
frameItem->frameDrawer().setFillWholeRect( true );
- frameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_status_trans_normal_c" );
+
+ //
+ // create 'attach' button and connect corresponding signal/slot
+ //
+ QGraphicsWidget *detailsAttachWidget = loader->findWidget( QString( "detailsAttachButton" ) );
+ HbPushButton *attachButton = qobject_cast<HbPushButton*>( detailsAttachWidget );
+ connect( attachButton, SIGNAL( released() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // create 'share' button
+ // signal and slot to be created when requirement for 'share' operation is confirmed
+ //
+ QGraphicsWidget *detailsShareWidget = loader->findWidget( QString( "detailsShareButton" ) );
+ HbPushButton *shareButton = qobject_cast<HbPushButton*>( detailsShareWidget );
+
+ //
+ // by default in xml layout, attachButton is not visible while shareButton is visible.
+ // if it's an 'attach' operation, reverse the visibility order
+ //
+ if ( mController->isAttachOperation() )
+ {
+ attachButton->setVisible( true );
+ shareButton->setVisible( false );
+ }
+
}
updateState( mController->state() );
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
@@ -25,7 +25,6 @@
#include "mpxvideoplaybackprogressbar.h"
#include "mpxvideoplaybackdocumentloader.h"
#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybacknontouchvolumebar.h"
#include "mpxvideoplaybackcontrolscontroller.h"
#include "mpxvideoplaybackcontrolconfiguration.h"
#include "mpxvideoplaybackdetailsplaybackwindow.h"
@@ -79,11 +78,6 @@
object = new QMPXVideoPlaybackFileDetailsWidget( mController );
object->setObjectName( name );
}
- else if ( name == "volumeSlider" )
- {
- object = new QMPXVideoPlaybackNonTouchVolumeBar();
- object->setObjectName( name );
- }
else if ( name == "detailsPlaybackWindow" )
{
object = new QMPXVideoPlaybackDetailsPlaybackWindow( mController );
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfiledetailswidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 19 %
+// Version : %version: 22 %
#include <QDir>
@@ -27,6 +27,7 @@
#include <hbratingslider.h>
#include <hblistwidget.h>
#include <hblistviewitem.h>
+#include <hbextendedlocale.h>
#include "mpxvideo_debug.h"
#include "mpxvideoplaybackdocumentloader.h"
@@ -35,7 +36,6 @@
#include "mpxvideoplaybackcontrolscontroller.h"
const float KILOBYTE = 1024 ;
-const QString KDATETIMEFORMAT = "d/M/yyyy hh:mm:ss ap";
// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackFileDetailsWidget::QMPXVideoPlaybackFileDetailsWidget
@@ -100,14 +100,14 @@
// set the min/max number of lines in the second row
//
HbListViewItem *prototype = mListWidget->listItemPrototype();
- prototype->setSecondaryTextRowCount(1, 3);
+ prototype->setSecondaryTextRowCount( 1, 30 );
if ( ! mFileDetailsUpdated )
- {
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
mFileDetailsUpdated = true;
- QFileInfo fileInfo( details->mClipName );
-
//
// Title
//
@@ -125,29 +125,22 @@
//
if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 )
{
- QString duration = QString("%1").arg(
- valueToReadableFormat( (qreal)details->mDuration / (qreal)KPbMilliMultiplier ) );
- addItemToListWidget( hbTrId( "txt_videos_list_duration" ), duration );
+ int value = (qreal)details->mDuration / (qreal)KPbMilliMultiplier;
+ QString hour = locale.toString( value / 3600 );
+ value = value % 3600;
+ QString min = locale.toString( value / 60 );
+ value = value % 60;
+ QString sec = locale.toString( value );
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_duration" ),
+ hbTrId( "txt_videos_list_l1_l2_l3" ).arg( hour ).arg( min ).arg( sec ) );
}
//
- // Date
+ // Date/Time
//
- if ( details->mPlaybackMode == EMPXVideoLocal ||
- details->mPlaybackMode == EMPXVideoProgressiveDownload )
- {
- //
- // Date created
- //
- QString date = QString("%1").arg( fileInfo.created().toString( KDATETIMEFORMAT ) );
- addItemToListWidget( hbTrId( "txt_videos_list_date" ), date );
-
- //
- // Date modified
- //
- QString modified = QString("%1").arg( fileInfo.lastModified().toString( KDATETIMEFORMAT ) );
- addItemToListWidget( hbTrId( "txt_videos_list_modified" ), modified );
- }
+ makeDateTimeItem( details );
//
// Location
@@ -184,8 +177,9 @@
//
if ( details->mVideoEnabled )
{
- QString resolution = QString("%1 x %2")
- .arg( details->mVideoWidth ).arg( details->mVideoHeight );
+ QString resolution = hbTrId( "txt_videos_list_l1l2" )
+ .arg( locale.toString( details->mVideoWidth ) )
+ .arg( locale.toString( details->mVideoHeight ) );
addItemToListWidget( hbTrId( "txt_videos_list_resolution" ), resolution );
}
@@ -205,6 +199,7 @@
if ( details->mPlaybackMode == EMPXVideoLocal ||
details->mPlaybackMode == EMPXVideoProgressiveDownload)
{
+ QFileInfo fileInfo( details->mClipName );
QString folder = fileInfo.dir().dirName();
addItemToListWidget( hbTrId( "txt_videos_list_collection_name" ), folder );
}
@@ -243,41 +238,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFileDetailsWidget::valueToReadableFormat
-// -------------------------------------------------------------------------------------------------
-//
-QString QMPXVideoPlaybackFileDetailsWidget::valueToReadableFormat( int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::valueToReadableFormat value = %d"), value);
-
- int hour = value / 3600;
- value = value % 3600;
- int minutes = value / 60;
- value = value % 60;
- int second = value;
-
- QTime time( hour ,minutes ,second );
- QString str;
-
- if ( hour > 0 )
- {
- str = time.toString( QString::number( hour ) ).append(" hr ");
- }
-
- if ( minutes > 0 )
- {
- str.append( time.toString( QString::number( minutes ) ).append(" min "));
- }
-
- if ( second > 0 )
- {
- str.append( time.toString( QString::number( second ) ).append(" sec "));
- }
-
- return str;
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackFileDetailsWidget::makeTitleItem
// -------------------------------------------------------------------------------------------------
//
@@ -310,7 +270,7 @@
// populate Title and its associated text
//
HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
- listWidgetItem->setText( hbTrId( "txt_videos_title_videos" ) );
+ listWidgetItem->setText( hbTrId( "txt_videos_list_title" ) );
listWidgetItem->setSecondaryText( title );
mListWidget->insertItem( 0, listWidgetItem );
}
@@ -324,7 +284,6 @@
//
delete mListWidget->takeItem ( 0 );
}
-
}
// -------------------------------------------------------------------------------------------------
@@ -347,38 +306,39 @@
// convert file size to KB, MB, GB accordingly
//
if ( fileSize > 0 )
- {
- QString scale(" KB");
-
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ QString scale;
+
//
// cast for later conversion with floating point
//
float size = (float) fileSize;
-
+
if ( size > KILOBYTE )
{
size /= KILOBYTE;
+ scale = hbTrId( "txt_videos_list_l1_kb" );
}
-
+
if ( size > KILOBYTE )
{
size /= KILOBYTE;
- scale = QString(" MB");
+ scale = hbTrId( "txt_videos_list_l1_mb" );
}
-
+
if ( size > KILOBYTE )
{
size /= KILOBYTE;
- scale = QString(" GB");
+ scale = hbTrId( "txt_videos_list_l1_gb" );
}
-
+
int temp = size * 10;
size = (float)temp / 10;
-
- QString text = QString("%1").arg( size );
- text.append( scale );
-
- addItemToListWidget( hbTrId( "txt_videos_list_file_size" ), text );
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_file_size" ), scale.arg( locale.toString( size ) ) );
}
}
}
@@ -391,10 +351,12 @@
{
if ( details->mBitRate > 0 )
{
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
float bitrate = details->mBitRate;
-
- QString scale(" Kbps");
-
+
+ QString scale = hbTrId( "txt_videos_list_l1_kbps" );
+
if ( bitrate > KILOBYTE )
{
bitrate /= KILOBYTE;
@@ -403,16 +365,14 @@
if ( bitrate > KILOBYTE )
{
bitrate /= KILOBYTE;
- scale = QString(" Mbps");
+ scale = hbTrId( "txt_videos_list_l1_mbps" );
}
int temp = bitrate * 10;
bitrate = (float)temp / 10;
-
- QString text = QString("%1").arg( bitrate );
- text.append( scale );
-
- addItemToListWidget( hbTrId( "txt_videos_list_bitrate" ), text );
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_bitrate" ), scale.arg( locale.toString( bitrate ) ) );
}
}
@@ -422,9 +382,12 @@
//
void QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( QString item, QString text )
{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget"));
+
if ( text.count() > 0 )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( %s , %s )"), item.data(), text.data() );
+ MPX_DEBUG(_L("QMPXVideoPlaybackFileDetailsWidget::addItemToListWidget( %s %s )"),
+ item.data(), text.data() );
HbListWidgetItem* listWidgetItem = new HbListWidgetItem();
listWidgetItem->setText( item );
@@ -434,4 +397,66 @@
}
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackFileDetailsWidget::makeDateTimeItem
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackFileDetailsWidget::makeDateTimeItem( QMPXVideoPlaybackViewFileDetails* details )
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackFileDetailsWidget::makeDateTimeItem"));
+
+ //
+ // attempt to get 'created' and 'last modified' date/time from metadata first,
+ // if it's not available, then get it from the file system
+ //
+
+ if ( details->mPlaybackMode == EMPXVideoLocal ||
+ details->mPlaybackMode == EMPXVideoProgressiveDownload )
+ {
+ QDateTime dateTime;
+ QFileInfo fileInfo( details->mClipName );
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ //
+ // Date created
+ //
+ if ( details->mCreationTime > 0 )
+ {
+ dateTime.setTime_t( details->mCreationTime );
+ }
+ else
+ {
+ dateTime = fileInfo.created();
+ }
+
+ //
+ // convert 'created' date/time to proper string format
+ // according to its current locale
+ //
+ QString date = locale.format( dateTime.date(), r_qtn_date_usual );
+ QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
+ addItemToListWidget( hbTrId( "txt_videos_list_date" ), date + " " + time );
+
+ //
+ // Date modified
+ //
+ if ( details->mModificationTime > 0 )
+ {
+ dateTime.setTime_t( details->mModificationTime );
+ }
+ else
+ {
+ dateTime = fileInfo.lastModified();
+ }
+
+ //
+ // convert 'last modified' date/time to proper string format
+ // according to its current locale
+ //
+ date = locale.format( dateTime.date(), r_qtn_date_usual );
+ time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
+ addItemToListWidget( hbTrId( "txt_videos_list_modified" ), date + " " + time );
+ }
+}
+
//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfullscreencontrol.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackfullscreencontrol.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#8 %
+// Version : %version: da1mmcf#9 %
@@ -155,26 +155,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackFullScreenControl::volumeChanged()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackFullScreenControl::volumeChanged( int volume )
-{
- bool changed = EFalse;
-
- if ( mControlIndex == EMPXControlBar )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackFullScreenControl::volumeChanged() [%d]"), volume);
-
- //static_cast<QMPXVideoPlaybackButtonBar*>(mControl)->volumeChanged( volume );
-
- changed = ETrue;
- }
-
- return changed;
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackFullScreenControl::durationChanged()
// -------------------------------------------------------------------------------------------------
//
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybacknontouchvolumebar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of QMPXVideoPlaybackNonTouchVolumeBar
-*
-*/
-
-// Version : %version: 7 %
-
-
-
-#include <QTimer>
-#include <QGraphicsSceneMouseEvent>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybacknontouchvolumebar.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar()
- : HbVolumeSliderPopup()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar()"));
-
- mVolumeTimer = new QTimer( this );
- mVolumeTimer->setInterval( KMPXControlsTimeOut );
- mVolumeTimer->setSingleShot( false );
- connect( mVolumeTimer, SIGNAL( timeout() ), this, SLOT( hideVolumeControl() ) );
-
- setTickPosition( Hb::NoSliderTicks );
-
- setRange( KPbPlaybackVolumeLevelMin, KPbPlaybackVolumeLevelMax );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::~QMPXVideoPlaybackNonTouchVolumeBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackNonTouchVolumeBar::~QMPXVideoPlaybackNonTouchVolumeBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar"));
-
- disconnect( mVolumeTimer, SIGNAL( timeout() ), this, SLOT( hideVolumeControl() ) );
-
- if ( mVolumeTimer )
- {
- if ( mVolumeTimer->isActive() )
- {
- mVolumeTimer->stop();
- }
-
- delete mVolumeTimer;
- mVolumeTimer = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::setVisible()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackNonTouchVolumeBar::setVisible( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackNonTouchVolumeBar::setVisible"));
-
- if ( mVolumeTimer->isActive() )
- {
- mVolumeTimer->stop();
- }
-
- if ( visible )
- {
- mVolumeTimer->start();
- }
-
- HbVolumeSliderPopup::setVisible( visible );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::hideVolumeControl()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackNonTouchVolumeBar::hideVolumeControl()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackNonTouchVolumeBar::hideVolumeControl"));
-
- setVisible( false );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::mousePressEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackNonTouchVolumeBar::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
- event->ignore();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::mouseReleaseEvent()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackNonTouchVolumeBar::mouseReleaseEvent( QGraphicsSceneMouseEvent *event )
-{
- event->ignore();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,22 +15,26 @@
*
*/
-// Version : %version: da1mmcf#14 %
+// Version : %version: da1mmcf#18 %
#include <QTime>
+#include <QTimer>
#include <QGraphicsSceneMouseEvent>
#include <hblabel.h>
-#include <hbprogressbar.h>
+#include <hbprogressslider.h>
+#include <hbextendedlocale.h>
#include "mpxvideo_debug.h"
#include "mpxvideoplaybackprogressbar.h"
#include "mpxvideoplaybackdocumentloader.h"
#include "mpxvideoplaybackcontrolscontroller.h"
+const int KSeekingTimeOut = 250;
+
// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar
// -------------------------------------------------------------------------------------------------
@@ -39,9 +43,13 @@
QMPXVideoPlaybackControlsController* controller )
: mController( controller )
, mDuration( -1 )
+ , mDraggingPosition( 0 )
+ , mSetPosition( -1 )
, mNeedToResumeAfterSetPosition( false )
, mInitialized( false )
- , mDragging( false )
+ , mSliderDragging( false )
+ , mLongTimeFormat( false )
+ , mLiveStreaming( false )
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar()"));
}
@@ -53,6 +61,19 @@
QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()"));
+
+ disconnect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
+
+ if ( mSeekingTimer )
+ {
+ if ( mSeekingTimer->isActive() )
+ {
+ mSeekingTimer->stop();
+ }
+
+ delete mSeekingTimer;
+ mSeekingTimer = NULL;
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -71,30 +92,38 @@
if ( loader && ! mInitialized )
{
mInitialized = true;
+ mLiveStreaming =
+ ( mController->fileDetails()->mPlaybackMode == EMPXVideoLiveStreaming )? true:false;
+
+ //
+ // Create a timer for seeking.
+ // We will issue SetPosition every KSeekingTimeOut msec to show the current frame to user
+ //
+ mSeekingTimer = new QTimer();
+ mSeekingTimer->setSingleShot( false );
+ mSeekingTimer->setInterval( KSeekingTimeOut );
+ connect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
//
// progress slider
//
QGraphicsWidget *widget = loader->findWidget( QString( "progressSlider" ) );
- mProgressSlider = qobject_cast<HbProgressBar*>( widget );
+ mProgressSlider = qobject_cast<HbProgressSlider*>( widget );
- //
- // position label
- //
- widget = loader->findWidget( QString( "positionLabel" ) );
- mPositionLabel= qobject_cast<HbLabel*>( widget );
-
- //
- // duration label
- //
- widget = loader->findWidget( QString( "durationLabel" ) );
- mDurationLabel= qobject_cast<HbLabel*>( widget );
+ connect( mProgressSlider, SIGNAL( sliderPressed() ), this, SLOT( handleSliderPressed() ) );
+ connect( mProgressSlider, SIGNAL( sliderReleased() ), this, SLOT( handleSliderReleased() ) );
+ connect( mProgressSlider, SIGNAL( sliderMoved( int ) ), this, SLOT( handleSliderMoved( int ) ) );
//
// If we init the progress bar after pp sends the duration informatin
// we need to set the duration manually
//
durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier );
+
+ //
+ // Set the position to 0 until we get position information
+ //
+ positionChanged( 0 );
}
}
@@ -106,9 +135,26 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::durationChanged duration = %d"), duration );
- mDuration = duration;
+ if ( mLiveStreaming )
+ {
+ mProgressSlider->setMaxText( "Live" );
+ }
+ else
+ {
+ mDuration = duration;
- mDurationLabel->setPlainText( valueToReadableFormat( mDuration ) );
+ if ( ( mDuration / 3600 ) > 0 )
+ {
+ mLongTimeFormat = true;
+ }
+ else
+ {
+ mLongTimeFormat = false;
+ }
+
+ mProgressSlider->setMaxText( valueToReadableFormat( mDuration ) );
+ }
+
mProgressSlider->setRange( 0, mDuration );
}
@@ -123,7 +169,7 @@
//
// While dragging event, don't update old position information from mpx framework
//
- if ( ! mDragging )
+ if ( ! mSliderDragging )
{
updatePostion( position );
}
@@ -139,15 +185,23 @@
{
position = 0;
}
- else if ( position > mDuration )
+ else if ( position > mDuration && ! mLiveStreaming )
{
position = mDuration;
}
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::updatePostion position = %d"), position );
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updatePostion position = %d"), position );
+
+ mProgressSlider->setMinText( valueToReadableFormat( position ) );
- mPositionLabel->setPlainText( valueToReadableFormat( position ) );
- mProgressSlider->setProgressValue( position );
+ //
+ // Don't need to set the slider for live streaming
+ //
+ if ( ! mLiveStreaming )
+ {
+ mProgressSlider->setSliderValue( position );
+ mProgressSlider->setProgressValue( position );
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -167,27 +221,29 @@
QTime time( hour ,minutes ,second );
QString str;
- if ( hour == 0 )
+ HbExtendedLocale locale = HbExtendedLocale::system();
+
+ if ( mLongTimeFormat )
{
- str = time.toString("mm:ss");
+ str = locale.format( time, r_qtn_time_durat_long );
}
else
{
- str = time.toString("hh:mm:ss");
+ str = locale.format( time, r_qtn_time_durat_min_sec );
}
return str;
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::mousePressEvent
+// QMPXVideoPlaybackProgressBar::handleSliderPressed
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackProgressBar::mousePressEvent( QGraphicsSceneMouseEvent *event )
+void QMPXVideoPlaybackProgressBar::handleSliderPressed()
{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::mousePressEvent()"));
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::handleSliderPressed()"));
- mDragging = true;
+ mSliderDragging = true;
mController->resetDisappearingTimers( EMPXTimerCancel );
@@ -199,38 +255,81 @@
mNeedToResumeAfterSetPosition = true;
mController->handleCommand( EMPXPbvCmdCustomPause );
}
-
- event->accept();
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::mouseReleaseEvent
+// QMPXVideoPlaybackProgressBar::handleSliderMoved
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackProgressBar::mouseReleaseEvent( QGraphicsSceneMouseEvent *event )
+void QMPXVideoPlaybackProgressBar::handleSliderMoved( int value )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::mouseReleaseEvent()"));
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSliderMoved() position = %d"), value);
+
+ updatePostion( value );
+
+ //
+ // If the slider is dragging, start the timer and seek every KSeekingTimeOut msec
+ //
+ if ( mSliderDragging )
+ {
+ mDraggingPosition = value;
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSliderMoved() mDraggingPosition = %d"), mDraggingPosition);
+
+ if ( mSeekingTimer && ! mSeekingTimer->isActive() )
+ {
+ mSeekingTimer->start();
+ }
+ }
+ else
+ {
+ if ( value >= mDuration )
+ {
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() reached end of the clip"));
- mDragging = false;
+ mController->handleCommand( EMPXPbvCmdEndOfClip );
+ }
+ else
+ {
+ value = mProgressSlider->sliderValue();
+
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() position = %d"), value);
+ mController->handleCommand( EMPXPbvCmdSetPosition, value );
+ }
+ }
+}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackProgressBar::handleSliderReleased
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackProgressBar::handleSliderReleased()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::handleSliderReleased()"));
+
+ mSliderDragging = false;
+
+ if ( mSeekingTimer && mSeekingTimer->isActive() )
+ {
+ mSeekingTimer->stop();
+ }
+
mController->resetDisappearingTimers( EMPXTimerReset );
+ int value = mProgressSlider->sliderValue();
- int position =
- (int)( ( event->scenePos().x() - mProgressSlider->geometry().x() ) /
- mProgressSlider->geometry().width() * (qreal)mDuration );
-
- if ( position > mDuration )
+ if ( value >= mDuration )
{
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() reached end of the clip"));
mController->handleCommand( EMPXPbvCmdEndOfClip );
}
else
{
- if ( position < 0 )
+ if ( value < 0 )
{
- position = 0;
+ value = 0;
}
- mController->handleCommand( EMPXPbvCmdSetPosition, position );
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::setPosition() position = %d"), value);
+ mController->handleCommand( EMPXPbvCmdSetPosition, value );
//
// Resume if it was playing
@@ -241,23 +340,6 @@
mController->handleCommand( EMPXPbvCmdCustomPlay );
}
}
-
- event->accept();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackProgressBar::mouseMoveEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackProgressBar::mouseMoveEvent( QGraphicsSceneMouseEvent *event )
-{
- qreal result =
- ( event->scenePos().x() - mProgressSlider->geometry().x() ) /
- mProgressSlider->geometry().width() * (qreal)mDuration;
-
- updatePostion( result );
-
- event->accept();
}
// -------------------------------------------------------------------------------------------------
@@ -271,16 +353,15 @@
if ( details->mPlaybackMode == EMPXVideoLiveStreaming )
{
- setEnabled( false );
- mDurationLabel->setPlainText( "Live" );
+ mProgressSlider->setEnabled( false );
}
else if ( details->mTvOutConnected && ! details->mTvOutPlayAllowed )
{
- setEnabled( false );
+ mProgressSlider->setEnabled( false );
}
- else
+ else if ( ! mProgressSlider->isEnabled() )
{
- setEnabled( true );
+ mProgressSlider->setEnabled( true );
}
}
@@ -292,25 +373,52 @@
{
MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::updateState() state = %d"), state );
- if ( mController->viewMode() == EAudioOnlyView )
+ switch ( state )
{
- switch ( state )
+ case EPbStatePlaying:
+ case EPbStatePaused:
{
- case EPbStatePlaying:
- case EPbStatePaused:
+ if ( ! isEnabled() )
{
- updateWithFileDetails( mController->fileDetails() );
- break;
+ setEnabled( true );
}
- case EPbStateNotInitialised:
- case EPbStateInitialising:
- case EPbStateBuffering:
+
+ break;
+ }
+ default:
+ {
+ if ( isEnabled() )
{
setEnabled( false );
- break;
}
+ break;
}
}
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackProgressBar::handleSeekingTimeout()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackProgressBar::handleSeekingTimeout()
+{
+ if ( mDraggingPosition >= mDuration )
+ {
+ mDraggingPosition = mDuration;
+ }
+ else if( mDraggingPosition < 0 )
+ {
+ mDraggingPosition = 0;
+ }
+
+ MPX_DEBUG(_L("QMPXVideoPlaybackProgressBar::handleSeekingTimeout() Dragging pos = %d, Set pos = %d")
+ , mDraggingPosition, mSetPosition );
+
+ if ( mSetPosition != mDraggingPosition )
+ {
+ mSetPosition = mDraggingPosition;
+ mController->handleCommand( EMPXPbvCmdSetPosition, mSetPosition );
+ }
+}
+
//End of file
--- a/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackstatuspanecontrol.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#13 %
+// Version : %version: 14 %
#include <hbmenu.h>
@@ -55,10 +55,7 @@
// Press "back" key means going back to previous view if it's avaiable
//
connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
-
- HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
- HbView *currentView = mainWnd->currentView();
- currentView->setNavigationAction(mActionBack);
+ mController->view()->setNavigationAction( mActionBack );
connect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
connect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
@@ -77,10 +74,7 @@
disconnect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
-
- HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
- HbView *currentView = mainWnd->currentView();
- currentView->setNavigationAction(0);
+ mController->view()->setNavigationAction( 0 );
disconnect( mController->view()->menu(), SIGNAL( aboutToShow() ), this, SLOT( handleAboutToShow() ) );
disconnect( mController->view()->menu(), SIGNAL( aboutToHide() ), this, SLOT( handleAboutToHide() ) );
@@ -104,19 +98,20 @@
if ( mVisible )
{
- mController->view()->showItems(
- Hb::IndicatorItems | Hb::TitlePaneItem | Hb::SecondarySoftKeyItem | Hb::TitleBarItem );
+ mController->view()->setTitleBarVisible( true );
+ mController->view()->setStatusBarVisible( true );
if ( mController->viewMode() == EFullScreenView ||
mController->viewMode() == EDetailsView )
{
- mTitleLabel->setVisible( true );
+ mTitleLabel->setVisible( true );
}
}
else
{
mController->view()->menu()->close();
- mController->view()->hideItems( Hb::AllItems );
+ mController->view()->setTitleBarVisible( false );
+ mController->view()->setStatusBarVisible( false );
mTitleLabel->setVisible( false );
}
@@ -179,7 +174,8 @@
disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
- mController->view()->setTitleBarFlags( HbView::TitleBarTransparent );
+ mController->view()->setViewFlags(
+ HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ) );
break;
}
case EDetailsView:
@@ -190,7 +186,7 @@
disconnect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
connect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
- mController->view()->setTitleBarFlags( HbView::TitleBarFlagNone );
+ mController->view()->setViewFlags( HbView::ViewFlagNone );
break;
}
@@ -202,7 +198,7 @@
disconnect( mActionBack, SIGNAL( triggered() ), this, SLOT( openFullScreenView() ) );
connect( mActionBack, SIGNAL( triggered() ), mController->view(), SLOT( closePlaybackView() ) );
- mController->view()->setTitleBarFlags( HbView::TitleBarFlagNone );
+ mController->view()->setViewFlags( HbView::ViewFlagNone );
break;
}
}
@@ -215,9 +211,9 @@
if ( ! mFrameItem )
{
mFrameItem = new HbFrameItem ( mTitleLabel );
- mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::OnePiece );
+ mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
+ mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
mFrameItem->frameDrawer().setFillWholeRect( true );
- mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_status_trans_normal_c" );
}
mFrameItem->setGeometry( mTitleLabel->boundingRect() );
--- a/videoplayback/hbvideoplaybackview/hbvideoplaybackview.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/hbvideoplaybackview.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#17 %
+# Version : %version: da1mmcf#20 %
TEMPLATE = lib
@@ -24,7 +24,7 @@
symbian:
{
- TARGET.CAPABILITY = CAP_GENERAL_DLL
+ TARGET.CAPABILITY = ALL -TCB -DRM
TARGET.EPOCALLOWDLLDATA = 1
TARGET.UID3 = 0x20024334
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
@@ -37,7 +37,6 @@
LIBS += -lmpxplaybackutility.dll \
-lmpxcommon.dll \
- -lmpxviewplugin.dll \
-lestor.dll \
-lcommonengine.dll \
-lflogger.dll \
@@ -48,7 +47,14 @@
-lcentralrepository.dll \
-lthumbnailmanagerqt.dll \
-lmediaclientvideodisplay.dll \
- -lalfdecoderserverclient.dll
+ -lalfdecoderserverclient.dll \
+ -lxqserviceutil.dll \
+ -lvideoplayerengine.dll \
+ -lcone.dll \
+ -lefsrv.dll \
+ -lws32.dll \
+ -lhal.dll \
+ -lgdi.dll
DEPENDPATH += ../inc inc viewinc controlinc
VPATH += viewsrc controlsrc
@@ -70,7 +76,6 @@
mpxvideoplaybackdocumentloader.h \
mpxvideoplaybackfiledetailswidget.h \
mpxvideoplaybackuserinputhandler.h \
- mpxvideoplaybacknontouchvolumebar.h \
mpxvideoplaybackdetailsplaybackwindow.h \
mpxvideocontainer.h
@@ -90,7 +95,6 @@
mpxvideoplaybackdocumentloader.cpp \
mpxvideoplaybackfiledetailswidget.cpp \
mpxvideoplaybackuserinputhandler.cpp \
- mpxvideoplaybacknontouchvolumebar.cpp \
mpxvideoplaybackdetailsplaybackwindow.cpp \
mpxvideocontainer.cpp
--- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#13 %
+// Version : %version: da1mmcf#15 %
@@ -38,15 +38,15 @@
class QString;
class HbAction;
class ThumbnailManager;
-class QActionGroup;
+class HbVolumeSliderPopup ;
class CMPXVideoViewWrapper;
class HbVideoBasePlaybackView;
class QMPXVideoPlaybackControlPolicy;
class QMPXVideoPlaybackDocumentLoader;
class QMPXVideoPlaybackFullScreenControl;
-class QMPXVideoPlaybackNonTouchVolumeBar;
class QMPXVideoPlaybackControlsController;
class QMPXVideoPlaybackControlConfiguration;
+class VideoServices;
// DATA TYPES
@@ -151,6 +151,8 @@
void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+ bool isAttachOperation();
+
private:
/**
* Initialize controller
@@ -244,11 +246,6 @@
TMPXVideoPlaybackControlCommandIds event,
int value );
- HbAction* createAction( QActionGroup *actionsGroup,
- int index,
- const char *slot,
- const QString& toolTip );
-
void updateVideoRect( bool transitionEffect = true );
void showVolumeControls();
@@ -257,6 +254,15 @@
void generateThumbNail();
+ signals:
+
+ /**
+ * Signals the file path of the current video to VideoServices
+ *
+ * @param filePath of the video
+ */
+ void attachVideoPath( const QString& );
+
private slots:
void hideAllControls();
void skipToNextVideoItem();
@@ -264,6 +270,7 @@
void handleTappedOnScreen();
void handleThumbnailReady( QPixmap tnData, void *internal , int id, int error );
void controlsListUpdated();
+ void attachVideo();
private:
HbVideoBasePlaybackView *mView;
@@ -278,11 +285,14 @@
QTimer *mControlsTimer;
QMPXVideoPlaybackDocumentLoader *mLoader;
- QMPXVideoPlaybackNonTouchVolumeBar *mVolumeControl;
+ HbVolumeSliderPopup *mVolumeControl;
ThumbnailManager *mThumbnailManager;
+ VideoServices *mVideoServices;
bool mViewTransitionIsGoingOn;
+ bool mIsAttachOperation;
+
TThumbNailState mThumbNailState;
TMPXPlaybackState mState;
--- a/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackviewfiledetails.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/inc/mpxvideoplaybackviewfiledetails.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -78,6 +78,8 @@
int mVideoWidth;
int mBitRate;
int mDuration;
+ int mCreationTime;
+ int mModificationTime;
};
#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/src/testcontrolconfiguration.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,7 @@
*
*/
+// Version : %version: %
#include <hbapplication.h>
#include <hbinstance.h>
@@ -81,6 +82,7 @@
mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails );
mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController );
+ mControlConfig->createControlList();
}
// ---------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -28,41 +28,15 @@
#include <mpxplaybackframeworkdefs.h>
#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
#include "mpxcommonvideoplaybackview.hrh"
#include "mpxvideoplaybackviewfiledetails.h"
// FORWARD DECLARATIONS
-class QTimer;
-class QString;
-class HbAction;
-class QActionGroup;
-class QMPXVideoPlaybackControlPolicy;
-class QMPXVideoPlaybackControlsLayout;
class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackFullScreenControl;
-class QMPXVideoPlaybackNonTouchVolumeBar;
class QMPXVideoPlaybackControlsController;
class QMPXVideoPlaybackControlConfiguration;
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const int KMPXControlsTimeOut = 4000;
-
// CLASS DECLARATION
@@ -83,217 +57,27 @@
virtual ~QMPXVideoPlaybackControlsController();
public:
-
- /**
- * Handle event from container
- */
- void handleEvent( TMPXVideoPlaybackControlCommandIds event, int value = 0 );
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /*
- * Return ETrue if TV-out cable gets connected
- */
- inline bool isTvOutConnected();
-
- /*
- * Return ETrue if TV-out cable is connected and content can be played
- */
- inline bool isTvOutPlaybackAllowed();
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
/**
* Return file details
*/
inline QMPXVideoPlaybackViewFileDetails* fileDetails();
- //
- // Add the file details to the controls controller when available
- //
- void addFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
QMPXVideoPlaybackDocumentLoader* layoutLoader();
- inline bool isFlipView();
-
- void updateVideoRectDone();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- TPlaybackViewMode viewMode();
-
public:
/**
* Initialize controller
*/
void initializeController();
- /**
- * Create controls
- */
- void createControls();
-
- /**
- * Update controls
- */
- void handleStateChange( TMPXPlaybackState newState );
-
- /**
- * Update Control's visibility
- */
- void updateControlsVisibility();
-
- /**
- * Toggle visibility
- */
- void toggleVisibility();
-
- /**
- * Create/delete controls based on updated control list
- */
- void controlsListUpdated();
-
- /**
- * Show Controls and reset the timers
- */
- void showControls();
-
- /**
- * Return ETrue if any control is visible
- */
- bool isVisible();
-
- /**
- * Append a control based on control index
- */
- void appendControl( TMPXVideoPlaybackControls controlIndex );
-
- /**
- * Set changed volume
- */
- void volumeChanged( int volume );
-
- /**
- * Set changed duration
- */
- void durationChanged( int duration);
-
- /**
- * Set changed position
- */
- void positionChanged( int position );
-
- /**
- * Set changed position
- */
- void aspectRatioChanged( int aspectRatio );
-
- /*
- * Sets the download size on the progress bar
- */
- void setDownloadSize( int size );
-
- /*
- * Updates the download ratio on the progress bar
- */
- void updateDownloadPosition( int newSize );
-
- /**
- * Set changed state on button bar
- */
- void updateStateOnButtonBar();
-
- /**
- * Check whether this clip is real format or not
- */
- bool realFormat( QString filename );
-
- /**
- * Check whether this clip is real format or not for streaming/live streaming
- */
- bool realFormatForStreaming( const TDesC& des );
-
- /**
- * Check whether this clip is real format or not for local/progressive donwload
- */
- bool realFormatForLocal();
-
- /**
- * Handle errors
- */
- void handleErrors();
-
- /**
- * Return ETrue if control is visible
- */
- bool isSoftKeyVisible( int value );
-
- /**
- * Handle tvout connected/disconnected event
- */
- void handleTvOutEvent( bool connected,
- TMPXVideoPlaybackControlCommandIds event,
- int value );
-
- HbAction* createAction( QActionGroup *actionsGroup,
- int index,
- const char *slot,
- const QString& toolTip );
-
- void updateVideoRect( bool transitionEffect = true );
-
- void showVolumeControls();
-
- private slots:
- void hideAllControls();
- void skipToNextVideoItem();
- void skipToPreviousVideoItem();
- void handleTappedOnScreen();
-
public:
QMPXVideoPlaybackViewFileDetails *mFileDetails;
- QList<QMPXVideoPlaybackFullScreenControl*> mControls;
-
- QMPXVideoPlaybackControlPolicy *mControlsPolicy;
QMPXVideoPlaybackControlConfiguration *mControlsConfig;
- QTimer *mControlsTimer;
-
QMPXVideoPlaybackDocumentLoader *mLoader;
- QMPXVideoPlaybackNonTouchVolumeBar *mVolumeControl;
-
- bool mFlipViewOpened;
- bool mViewTransitionIsGoingOn;
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
-
};
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::fileDetails
// -------------------------------------------------------------------------------------------------
@@ -304,45 +88,6 @@
return mFileDetails;
}
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutConnected
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutConnected()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutConnected(%d)"),
- mFileDetails->mTvOutConnected);
-
- return mFileDetails->mTvOutConnected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed()
-{
- bool playable = ( ! mFileDetails->mTvOutConnected || mFileDetails->mTvOutPlayAllowed );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed() [%d]"),
- playable);
-
- return playable;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isFlipView
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isFlipView()
-{
- return mFlipViewOpened;
-}
-
-
#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/stub/src/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -51,16 +51,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::addFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::addFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- Q_UNUSED( details );
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
// -------------------------------------------------------------------------------------------------
//
@@ -76,306 +66,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleEvent(
- TMPXVideoPlaybackControlCommandIds event, int value )
-{
- switch ( event )
- {
- case EMPXControlCmdTvOutConnected:
- {
- handleTvOutEvent( true, event, value );
- break;
- }
- case EMPXControlCmdTvOutDisconnected:
- {
- handleTvOutEvent( false, event, value );
- break;
- }
- case EMPXControlCmdSetVolume:
- {
- mFileDetails->mAudioEnabled = false;
- break;
- }
- case EMPXControlCmdSetDuration:
- {
- mFileDetails->mDuration = value;
- break;
- }
- case EMPXControlCmdShowVolumeControls:
- {
- mFileDetails->mAudioEnabled = true;
- break;
- }
- case EMPXControlCmdSetPosition:
- {
- mFileDetails->mSeekable = true;
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleStateChange
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleStateChange( TMPXPlaybackState newState )
-{
- Q_UNUSED( newState );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::controlsListUpdated()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::controlsListUpdated()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::appendControl()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::appendControl( TMPXVideoPlaybackControls controlIndex )
-{
- Q_UNUSED( controlIndex );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- Q_UNUSED( timerAction );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::hideAllControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::hideAllControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isVisible()
-{
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- Q_UNUSED( command );
- Q_UNUSED( value );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::volumeChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::volumeChanged( int volume )
-{
- Q_UNUSED( volume );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showVolumeControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showVolumeControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::durationChanged( int duration )
-{
- Q_UNUSED( duration );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::positionChanged( int position )
-{
- Q_UNUSED( position );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::aspectRatioChanged( int aspectRatio )
-{
- Q_UNUSED( aspectRatio );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormat()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormat( QString filename )
-{
- Q_UNUSED( filename );
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForStreaming()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
-{
- Q_UNUSED( des );
- bool realFormat = false;
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForLocal()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForLocal()
-{
- bool realFormat = false;
-
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::setDownloadSize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::setDownloadSize( int size )
-{
- Q_UNUSED( size );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateDownloadPosition()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateDownloadPosition( int size )
-{
- Q_UNUSED( size );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleErrors
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleErrors()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isSoftKeyVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ )
-{
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTvOutEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTvOutEvent(
- bool connected, TMPXVideoPlaybackControlCommandIds event, int value )
-{
- Q_UNUSED( event );
- Q_UNUSED( value );
- mFileDetails->mTvOutConnected = connected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRectDone
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRectDone()
-{
- mViewTransitionIsGoingOn = false;
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToPreviousVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToNextVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToNextVideoItem()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRect()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
-{
- Q_UNUSED( transitionEffect );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::layoutLoader
// -------------------------------------------------------------------------------------------------
//
@@ -384,14 +74,4 @@
return mLoader;
}
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/testcontrolconfiguration.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testcontrolconfiguration/testcontrolconfiguration.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building testcontrolconfiguration
#
#
-# Version : %version: 1 %
+# Version : %version: 2 %
TEMPLATE = app
@@ -29,8 +29,7 @@
../inc \
../../inc \
../../../inc \
- ../../../../inc \
- $$MW_LAYER_SYSTEMINCLUDE
+ ../../../../inc \
DEPENDPATH += stub/inc stub/src inc src
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/inc/testdetailsplaybackwindow.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,75 @@
+/**
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: tester for methods in TestDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 3 %
+
+
+#ifndef __TESTDETAILSPLAYBACKWINDOW_H__
+#define __TESTDETAILSPLAYBACKWINDOW_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+class QEvent;
+class QMPXVideoPlaybackDetailsPlaybackWindow;
+class QMPXVideoPlaybackControlsController;
+
+class TestDetailsPlaybackWindow : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * will be called before each testfunction is executed.
+ *
+ */
+ void init( bool attachOperation = false );
+
+ /**
+ * will be called after every testfunction.
+ *
+ */
+ void cleanup();
+
+ // test functions for the test framework
+private slots:
+
+ // the order in which these testXX methods are declared is important
+ // changing this order will affect the test results
+ void testUpdateState();
+ void testPlayPause();
+ void testMousePressEvent();
+ void testMouseReleaseEvent();
+ void testAttach();
+
+signals:
+ void commandSignal();
+
+private:
+ QMPXVideoPlaybackDetailsPlaybackWindow* mWindow;
+ QMPXVideoPlaybackControlsController* mController;
+};
+
+
+#endif // __TESTDETAILSPLAYBACKWINDOW_H__
+
+// End of file
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/src/testdetailsplaybackwindow.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,222 @@
+/**
+* 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: tester for methods in TestDetailsPlaybackWindow
+*
+*/
+
+// Version : %version: 3 %
+
+
+#include <qdebug>
+#include <qgraphicsscenemouseevent>
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "hbpushbutton.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+#include "testdetailsplaybackwindow.h"
+
+
+#define private public
+#include "mpxvideoplaybackdetailsplaybackwindow.h"
+#undef private
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::Main()"));
+
+ HbApplication app(argc, argv);
+ HbMainWindow window;
+
+ TestDetailsPlaybackWindow tv;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\testdetailsplaybackwindow.txt";
+
+ int res = QTest::qExec(&tv, 3, pass);
+
+ return res;
+}
+
+// ---------------------------------------------------------------------------
+// init
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::init( bool attachOperation )
+{
+ MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::init()"));
+
+ mController = new QMPXVideoPlaybackControlsController( attachOperation );
+ mWindow = new QMPXVideoPlaybackDetailsPlaybackWindow( mController );
+
+ mWindow->initialize();
+}
+
+// ---------------------------------------------------------------------------
+// cleanup
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestDetailsPlaybackWindow::cleanup()"));
+
+ if ( mController )
+ {
+ delete mController;
+ mController = NULL;
+ }
+
+ if ( mWindow )
+ {
+ delete mWindow;
+ mWindow = NULL;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// testUpdateState
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testUpdateState()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testUpdateState()"));
+
+ init();
+
+ TMPXPlaybackState state = EPbStatePlaying;
+ mWindow->updateState( state );
+ QVERIFY( mWindow->mPlayButton->isVisible() == false );
+
+ state = EPbStatePaused;
+ mWindow->updateState( state );
+ QVERIFY( mWindow->mPlayButton->isVisible() == true );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testMousePressEvent
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testMousePressEvent()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testMousePressEvent()"));
+
+ init();
+
+ QGraphicsSceneMouseEvent* event =
+ new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMousePress );
+ event->setAccepted( false );
+
+ mWindow->mousePressEvent( event );
+
+ QVERIFY( event->isAccepted() );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testMouseReleaseEvent
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testMouseReleaseEvent()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testMouseReleaseEvent()"));
+
+ init();
+
+ QGraphicsSceneMouseEvent* event =
+ new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseRelease );
+
+ mWindow->mouseReleaseEvent( event );
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
+
+ delete event;
+ event = NULL;
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testPlayPause
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testPlayPause()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testPlayPause()"));
+
+ init();
+
+ mWindow->mPlayButton->release();
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testAttach
+// ---------------------------------------------------------------------------
+//
+void TestDetailsPlaybackWindow::testAttach()
+{
+ MPX_ENTER_EXIT(
+ _L("TestDetailsPlaybackWindow::testAttach()"));
+
+ //
+ // test when 'attach' operation is enabled
+ //
+ init( true );
+
+ //
+ // connect signal/slot
+ //
+ connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // emit signal
+ //
+ emit commandSignal();
+
+ //
+ // verify the controller attachVideo() slot has been called
+ //
+ QVERIFY( mController->mCommand == EMPXPbvCmdClose );
+ QVERIFY( mController->mAttachVideoDone == true );
+
+ //
+ // disconnect signal/slot
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+}
+
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/hbpushbutton.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* 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 HbPushButton
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBPUSHBUTTON_H_
+#define HBPUSHBUTTON_H
+
+#include <hbwidget.h>
+#include <hbstyle.h>
+
+class QGraphicsItem;
+
+class HbPushButton : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbPushButton();
+ virtual ~HbPushButton();
+
+ public:
+ void setEnabled( bool enabled );
+ void setVisible( bool visible );
+ void setSelected( bool selected );
+ bool isEnabled();
+ bool isVisible();
+ bool isSelected();
+ QGraphicsItem* primitive( HbStyle::Primitive primitive ) const;
+ void press();
+ void release();
+
+ signals:
+ void pressed();
+ void released();
+
+ public:
+ bool mVisible;
+ bool mEnabled;
+ bool mSelected;
+
+ QGraphicsItem *mBackground;
+};
+
+#endif /*HBPUSHBUTTON_H*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* 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 MPXVideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
+
+// INCLUDES
+#include <qobject>
+#include <mpxplaybackframeworkdefs.h>
+
+#include "mpxvideo_debug.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "mpxvideoplaybackviewfiledetails.h"
+
+// FORWARD DECLARATIONS
+class QMPXVideoPlaybackDocumentLoader;
+
+
+// DATA TYPES
+
+enum TMPXTimerAction
+{
+ EMPXTimerCancel,
+ EMPXTimerReset
+};
+
+enum TPlaybackViewMode
+{
+ EFullScreenView,
+ EDetailsView,
+ EAudioOnlyView
+};
+
+// CLASS DECLARATION
+
+class QMPXVideoPlaybackControlsController : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * constructor.
+ */
+ QMPXVideoPlaybackControlsController( bool attachOperation );
+
+ /**
+ * Destructor.
+ */
+ virtual ~QMPXVideoPlaybackControlsController();
+
+ public:
+
+ /**
+ * Command handling function.
+ * Call HandleCommandL() of container
+ */
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
+
+ /**
+ * Reset or cancel timers for the controls
+ */
+ void resetDisappearingTimers( TMPXTimerAction timerAction );
+
+ /**
+ * Return state
+ */
+ inline TMPXPlaybackState state();
+
+ /**
+ * Return file details
+ */
+ inline QMPXVideoPlaybackViewFileDetails* fileDetails();
+
+ inline QMPXVideoPlaybackDocumentLoader* layoutLoader();
+
+ TPlaybackViewMode viewMode();
+
+ void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+
+ bool isAttachOperation();
+
+ private slots:
+ void attachVideo();
+
+ public:
+ QMPXVideoPlaybackViewFileDetails *mFileDetails;
+ QMPXVideoPlaybackDocumentLoader *mLoader;
+
+ TMPXPlaybackState mState;
+ TPlaybackViewMode mViewMode;
+ TMPXTimerAction mTimerAction;
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mCommandValue;
+ bool mIsAttachOperation;
+ bool mAttachVideoDone;
+};
+
+// INLINE METHODS
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::state
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
+{
+ return mState;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::fileDetails
+// -------------------------------------------------------------------------------------------------
+//
+inline
+QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
+{
+ return mFileDetails;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::layoutLoader
+// -------------------------------------------------------------------------------------------------
+//
+inline
+QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
+{
+ return mLoader;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
+{
+ return mViewMode;
+}
+
+#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackdocumentloader.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 QMPXVideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
+#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
+
+
+#include <qobject>
+#include <qlist>
+
+class QGraphicsWidget;
+class QMPXVideoPlaybackControlsController;
+
+class QMPXVideoPlaybackDocumentLoader : public QObject
+{
+ public:
+ QMPXVideoPlaybackDocumentLoader();
+ virtual ~QMPXVideoPlaybackDocumentLoader();
+
+ public:
+ QGraphicsWidget* findWidget( const QString &name );
+
+ private:
+ QGraphicsWidget* createWidget( const QString &name );
+ int exist( const QString &name );
+
+ private:
+ QList<QGraphicsWidget*> mWidgets;
+};
+
+#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,85 @@
+/*
+* 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: MPX Video File Details (QT)
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+
+#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+
+#include <qobject.h>
+#include "mpxhelixplaybackplugindefs.h"
+
+
+//
+// CLASS DECLARATION
+//
+class QMPXVideoPlaybackViewFileDetails : public QObject
+{
+ public:
+ //
+ // Constructor
+ //
+ QMPXVideoPlaybackViewFileDetails();
+
+ //
+ // Destructor.
+ //
+ virtual ~QMPXVideoPlaybackViewFileDetails();
+
+ //
+ // Clear all file details
+ //
+ void clearFileDetails();
+
+ public:
+ //
+ // Data
+ //
+ QString mClipName;
+ QString mTitle;
+ QString mArtist;
+ QString mMimeType;
+ QString mDescription;
+ QString mLocation;
+ QString mCopyright;
+ QString mLanguage;
+ QString mKeywords;
+
+ TMPXVideoMode mPlaybackMode;
+ bool mSeekable;
+ bool mPausableStream;
+ bool mAudioEnabled;
+ bool mVideoEnabled;
+ bool mPartialPlayback;
+ bool mRNFormat;
+ bool mTvOutConnected;
+ bool mTvOutPlayAllowed;
+ bool mDrmProtected;
+ bool mMultiItemPlaylist;
+
+ int mVideoHeight;
+ int mVideoWidth;
+ int mBitRate;
+ int mDuration;
+};
+
+#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/hbpushbutton.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,154 @@
+/*
+* 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 HbPushButton
+*
+*/
+
+// Version : %version: 3 %
+
+#include <qgraphicswidget>
+
+#include "mpxvideo_debug.h"
+#include "hbpushbutton.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::HbPushButton
+// -------------------------------------------------------------------------------------------------
+//
+HbPushButton::HbPushButton()
+ : mVisible( false )
+ , mEnabled( false )
+ , mSelected( false )
+{
+ MPX_ENTER_EXIT(_L("HbPushButton::HbPushButton()"));
+
+ mBackground = new QGraphicsWidget();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::~HbPushButton
+// -------------------------------------------------------------------------------------------------
+//
+HbPushButton::~HbPushButton()
+{
+ MPX_DEBUG(_L("HbPushButton::HbPushButton") );
+
+ if ( mBackground )
+ {
+ delete mBackground;
+ mBackground = NULL;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setEnabled
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setEnabled( bool enabled )
+{
+ MPX_DEBUG(_L("HbPushButton::setEnabled %d"), enabled );
+
+ mEnabled = enabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::isEnabled
+// -------------------------------------------------------------------------------------------------
+//
+bool HbPushButton::isEnabled()
+{
+ MPX_DEBUG(_L("HbPushButton::isEnabled %d"), mEnabled );
+
+ return mEnabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("HbPushButton::setVisible %d"), visible );
+
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbPushButton::isVisible()
+{
+ MPX_DEBUG(_L("HbPushButton::isVisible %d"), mVisible );
+
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::setSelected
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::setSelected( bool selected )
+{
+ MPX_DEBUG(_L("HbPushButton::setSelected %d"), selected );
+
+ mSelected = selected;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::isSelected
+// -------------------------------------------------------------------------------------------------
+//
+bool HbPushButton::isSelected()
+{
+ MPX_DEBUG(_L("HbPushButton::isSelected %d"), mSelected );
+
+ return mSelected;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::primitive
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsItem* HbPushButton::primitive( HbStyle::Primitive primitive ) const
+{
+ MPX_DEBUG(_L("HbPushButton::primitive") );
+
+ Q_UNUSED( primitive );
+ return mBackground;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::press
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::press()
+{
+ MPX_DEBUG(_L("HbPushButton::press") );
+
+ emit pressed();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::release
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::release()
+{
+ MPX_DEBUG(_L("HbPushButton::release") );
+
+ emit released();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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 MPXVideoPlaybackControlsController
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+// INCLUDE FILES
+
+
+#include "mpxvideoplaybackdocumentloader.h"
+#include "mpxvideoplaybackcontrolscontroller.h"
+
+// ================= MEMBER FUNCTIONS ==============================================================
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
+// -------------------------------------------------------------------------------------------------
+//
+QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController( bool attachOperation )
+ : mViewMode( EFullScreenView )
+ , mIsAttachOperation( attachOperation )
+ , mAttachVideoDone( false )
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
+
+ mLoader = new QMPXVideoPlaybackDocumentLoader();
+ mFileDetails = new QMPXVideoPlaybackViewFileDetails();
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
+// -------------------------------------------------------------------------------------------------
+//
+QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::handleCommand()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::handleCommand(
+ TMPXVideoPlaybackViewCommandIds command, int value )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
+
+ mCommand = command;
+ mCommandValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::changeViewMode
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::changeViewMode(
+ TPlaybackViewMode viewMode, bool transitionEffect )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
+
+ Q_UNUSED( transitionEffect );
+ mViewMode = viewMode;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
+
+ mTimerAction = timerAction;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::isAttachOperation()
+// -------------------------------------------------------------------------------------------------
+//
+bool QMPXVideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation);
+
+ return mIsAttachOperation;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::attachVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::attachVideo()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"));
+
+ handleCommand( EMPXPbvCmdClose );
+ mAttachVideoDone = true;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* 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 QMPXVideoPlaybackDocumentLoader
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "hbpushbutton.h"
+
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackdocumentloader.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
+// -------------------------------------------------------------------------------------------------
+//
+QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
+
+ for ( int i = 0 ; i < mWidgets.count() ; i++ )
+ {
+ mWidgets.removeAt( 0 );
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackDocumentLoader::findWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget( %s )"), name.data() );
+
+ QGraphicsWidget *object = NULL;
+
+ int index = exist( name );
+
+ if ( index == -1 )
+ {
+ object = createWidget( name );
+ }
+ else
+ {
+ object = mWidgets[ index ];
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackDocumentLoader::createWidget()
+// -------------------------------------------------------------------------------------------------
+//
+QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget( %s )"), name.data() );
+
+ QGraphicsWidget *object = NULL;
+
+ if ( name == "detailsViewPlayButton" || name == "detailsAttachButton" ||
+ name == "detailsShareButton" )
+ {
+ object = new HbPushButton();
+ object->setObjectName( name );
+ mWidgets.append( object );
+ }
+
+ return object;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackDocumentLoader::exist()
+// -------------------------------------------------------------------------------------------------
+//
+int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
+{
+ int i = 0;
+
+ for ( ; i < mWidgets.count() ; i++ )
+ {
+ if( mWidgets[i]->objectName() == name )
+ {
+ break;
+ }
+ }
+
+ if ( i == mWidgets.count() )
+ {
+ i = -1;
+ }
+
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist( %s ) ret %d"), name.data(), i );
+
+ return i;
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: class for MPX Video File Details (Qt)
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+//
+// INCLUDE FILES
+//
+#include "mpxvideo_debug.h"
+#include "mpxvideoplaybackviewfiledetails.h"
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
+
+ clearFileDetails();
+}
+
+void
+QMPXVideoPlaybackViewFileDetails::clearFileDetails()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
+
+ mMimeType = tr("");
+ mTitle = tr("");
+ mArtist = tr("");
+ mClipName = tr("");
+ mDescription = tr("");
+ mLocation = tr("");
+ mCopyright = tr("");
+ mLanguage = tr("");
+ mKeywords = tr("");
+
+ mPlaybackMode = EMPXVideoLocal;
+ mSeekable = false;
+ mPausableStream = false;
+ mAudioEnabled = false;
+ mVideoEnabled = false;
+ mPartialPlayback = false;
+ mRNFormat = false;
+
+ mDuration = 0;
+ mTvOutConnected = false;
+ mTvOutPlayAllowed = true;
+ mDrmProtected = false;
+
+ mVideoHeight = 0;
+ mVideoWidth = 0;
+ mBitRate = 0;
+}
+
+// EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testdetailsplaybackwindow/testdetailsplaybackwindow.pro Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,43 @@
+#
+# 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: Project file for building testdetailsplaybackwindow
+#
+#
+# Version : %version: 1 %
+
+TEMPLATE = app
+TARGET = testdetailsplaybackwindow
+CONFIG += qtestlib qt hb
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ ../../../inc
+
+
+DEPENDPATH += inc src stub/inc stub/src
+
+# Input
+HEADERS += testdetailsplaybackwindow.h \
+ mpxvideoplaybackcontrolscontroller.h \
+ mpxvideoplaybackdocumentloader.h \
+ mpxvideoplaybackviewfiledetails.h \
+ hbpushbutton.h \
+ ../../controlinc/mpxvideoplaybackdetailsplaybackwindow.h
+
+SOURCES += testdetailsplaybackwindow.cpp \
+ mpxvideoplaybackcontrolscontroller.cpp \
+ mpxvideoplaybackdocumentloader.cpp \
+ mpxvideoplaybackviewfiledetails.cpp \
+ hbpushbutton.cpp \
+ ../../controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/inc/testfullscreencontrol.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/inc/testfullscreencontrol.h Mon May 03 12:32:50 2010 +0300
@@ -25,7 +25,6 @@
#include "mpxvideoplaybackcontrol.hrh"
-class QMPXVideoPlaybackViewFileDetails;
class QMPXVideoPlaybackControlsController;
class QMPXVideoPlaybackFullScreenControl;
@@ -60,8 +59,6 @@
void testControlIndex();
- void testVolumeChanged();
-
void testDurationChanged();
void testPositionChanged();
@@ -79,7 +76,6 @@
void commandSignal(int);
private:
- QMPXVideoPlaybackViewFileDetails* mFileDetails;
QMPXVideoPlaybackControlsController* mControlsController;
QMPXVideoPlaybackFullScreenControl* mFullScreenControl;
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/src/testfullscreencontrol.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/src/testfullscreencontrol.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
#include <hbapplication.h>
@@ -78,9 +78,8 @@
{
MPX_ENTER_EXIT(_L("TestFullScreenControl::setup()"));
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-
- mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails );
+
+ mControlsController = new QMPXVideoPlaybackControlsController();
createControl( control );
}
@@ -130,12 +129,6 @@
{
MPX_ENTER_EXIT(_L("TestFullScreenControl::cleanup()"));
- if ( mFileDetails )
- {
- delete mFileDetails;
- mFileDetails = NULL;
- }
-
if ( mControlsController )
{
delete mControlsController;
@@ -163,18 +156,6 @@
}
// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-void TestFullScreenControl::testVolumeChanged()
-{
- setup( EMPXStatusPane );
-
- QVERIFY( ! mFullScreenControl->volumeChanged( 50 ) );
-
-}
-
-// ---------------------------------------------------------------------------
// testDurationChanged
// ---------------------------------------------------------------------------
//
@@ -264,15 +245,21 @@
{
MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlsWithFileDetails()"));
- delete mFullScreenControl;
- mFullScreenControl = NULL;
+ QMPXVideoPlaybackViewFileDetails *fileDetails = new QMPXVideoPlaybackViewFileDetails();
+
setup( EMPXControlBar );
- mFileDetails->mPausableStream = true;
+ fileDetails->mPausableStream = true;
- mFullScreenControl->updateControlsWithFileDetails(mFileDetails);
+ mFullScreenControl->updateControlsWithFileDetails( fileDetails );
QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mFileDetails->mPausableStream );
+
+ if ( fileDetails )
+ {
+ delete fileDetails;
+ fileDetails = NULL;
+ }
}
// ---------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -25,42 +25,9 @@
// INCLUDES
#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrol.hrh"
#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QTimer;
-class QString;
-class HbAction;
-class QActionGroup;
-class QMPXVideoPlaybackControlPolicy;
-class QMPXVideoPlaybackFullScreenControl;
-class QMPXVideoPlaybackNonTouchVolumeBar;
-class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackControlConfiguration;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const int KMPXControlsTimeOut = 4000;
-
// CLASS DECLARATION
@@ -73,7 +40,7 @@
/**
* constructor.
*/
- QMPXVideoPlaybackControlsController( QMPXVideoPlaybackViewFileDetails *details );
+ QMPXVideoPlaybackControlsController();
/**
* Destructor.
@@ -83,260 +50,12 @@
public:
/**
- * Handle event from container
- */
- void handleEvent( TMPXVideoPlaybackControlCommandIds event, int value = 0 );
-
- /**
* Command handling function.
* Call HandleCommandL() of container
*/
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /*
- * Return ETrue if TV-out cable gets connected
- */
- inline bool isTvOutConnected();
-
- /*
- * Return ETrue if TV-out cable is connected and content can be played
- */
- inline bool isTvOutPlaybackAllowed();
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- //
- // Add the file details to the controls controller when available
- //
- void addFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
- inline bool isFlipView();
-
- void updateVideoRectDone();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- TPlaybackViewMode viewMode();
-
- public:
- /**
- * Initialize controller
- */
- void initializeController();
-
- /**
- * Create controls
- */
- void createControls();
-
- /**
- * Update controls
- */
- void handleStateChange( TMPXPlaybackState newState );
-
- /**
- * Update Control's visibility
- */
- void updateControlsVisibility();
-
- /**
- * Toggle visibility
- */
- void toggleVisibility();
-
- /**
- * Create/delete controls based on updated control list
- */
- void controlsListUpdated();
-
- /**
- * Show Controls and reset the timers
- */
- void showControls();
-
- /**
- * Return ETrue if any control is visible
- */
- bool isVisible();
-
- /**
- * Append a control based on control index
- */
- void appendControl( TMPXVideoPlaybackControls controlIndex );
-
- /**
- * Set changed volume
- */
- void volumeChanged( int volume );
-
- /**
- * Set changed duration
- */
- void durationChanged( int duration);
-
- /**
- * Set changed position
- */
- void positionChanged( int position );
-
- /**
- * Set changed position
- */
- void aspectRatioChanged( int aspectRatio );
-
- /*
- * Sets the download size on the progress bar
- */
- void setDownloadSize( int size );
-
- /*
- * Updates the download ratio on the progress bar
- */
- void updateDownloadPosition( int newSize );
-
- /**
- * Set changed state on button bar
- */
- void updateStateOnButtonBar();
-
- /**
- * Check whether this clip is real format or not
- */
- bool realFormat( QString filename );
-
- /**
- * Check whether this clip is real format or not for streaming/live streaming
- */
- bool realFormatForStreaming( const TDesC& des );
-
- /**
- * Check whether this clip is real format or not for local/progressive donwload
- */
- bool realFormatForLocal();
-
- /**
- * Handle errors
- */
- void handleErrors();
-
- /**
- * Return ETrue if control is visible
- */
- bool isSoftKeyVisible( int value );
-
- /**
- * Handle tvout connected/disconnected event
- */
- void handleTvOutEvent( bool connected,
- TMPXVideoPlaybackControlCommandIds event,
- int value );
-
- HbAction* createAction( QActionGroup *actionsGroup,
- int index,
- const char *slot,
- const QString& toolTip );
-
- void updateVideoRect( bool transitionEffect = true );
-
- void showVolumeControls();
-
- private slots:
- void hideAllControls();
- void skipToNextVideoItem();
- void skipToPreviousVideoItem();
- void handleTappedOnScreen();
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
-
- QList<QMPXVideoPlaybackFullScreenControl*> mControls;
-
- QMPXVideoPlaybackControlPolicy *mControlsPolicy;
- QMPXVideoPlaybackControlConfiguration *mControlsConfig;
-
- QTimer *mControlsTimer;
-
- QMPXVideoPlaybackNonTouchVolumeBar *mVolumeControl;
-
- bool mFlipViewOpened;
- bool mViewTransitionIsGoingOn;
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
-
+ void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );\
};
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutConnected
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutConnected()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutConnected(%d)"),
- mFileDetails->mTvOutConnected);
-
- return mFileDetails->mTvOutConnected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed()
-{
- bool playable = ( ! mFileDetails->mTvOutConnected || mFileDetails->mTvOutPlayAllowed );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed() [%d]"),
- playable);
-
- return playable;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isFlipView
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isFlipView()
-{
- return mFlipViewOpened;
-}
-
#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/stub/src/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -25,8 +25,6 @@
#include <barsread.h>
#include <f32file.h>
-#include <qtimer>
-
#include <hblabel.h>
#include <hbaction.h>
#include <hbiconanimator.h>
@@ -43,29 +41,8 @@
// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController(
- QMPXVideoPlaybackViewFileDetails *details )
- : mFileDetails( details )
+QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
{
- initializeController();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::initializeController()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::initializeController()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::addFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::addFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- Q_UNUSED( details );
}
// -------------------------------------------------------------------------------------------------
@@ -78,111 +55,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleEvent(
- TMPXVideoPlaybackControlCommandIds event, int value )
-{
- switch ( event )
- {
- case EMPXControlCmdTvOutConnected:
- {
- handleTvOutEvent( true, event, value );
- break;
- }
- case EMPXControlCmdTvOutDisconnected:
- {
- handleTvOutEvent( false, event, value );
- break;
- }
- case EMPXControlCmdSetVolume:
- {
- mFileDetails->mAudioEnabled = false;
- break;
- }
- case EMPXControlCmdSetDuration:
- {
- mFileDetails->mDuration = value;
- break;
- }
- case EMPXControlCmdShowVolumeControls:
- {
- mFileDetails->mAudioEnabled = true;
- break;
- }
- case EMPXControlCmdSetPosition:
- {
- mFileDetails->mSeekable = true;
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleStateChange
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleStateChange( TMPXPlaybackState newState )
-{
- Q_UNUSED( newState );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::controlsListUpdated()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::controlsListUpdated()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::appendControl()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::appendControl( TMPXVideoPlaybackControls controlIndex )
-{
- Q_UNUSED( controlIndex );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- Q_UNUSED( timerAction );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::hideAllControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::hideAllControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isVisible()
-{
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::handleCommand()
// -------------------------------------------------------------------------------------------------
//
@@ -193,198 +65,4 @@
Q_UNUSED( value );
}
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::volumeChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::volumeChanged( int volume )
-{
- Q_UNUSED( volume );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showVolumeControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showVolumeControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::durationChanged( int duration )
-{
- Q_UNUSED( duration );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::positionChanged( int position )
-{
- Q_UNUSED( position );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::aspectRatioChanged( int aspectRatio )
-{
- Q_UNUSED( aspectRatio );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormat()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormat( QString filename )
-{
- Q_UNUSED( filename );
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForStreaming()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
-{
- Q_UNUSED( des );
- bool realFormat = false;
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForLocal()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForLocal()
-{
- bool realFormat = false;
-
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::setDownloadSize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::setDownloadSize( int size )
-{
- Q_UNUSED( size );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateDownloadPosition()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateDownloadPosition( int size )
-{
- Q_UNUSED( size );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleErrors
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleErrors()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isSoftKeyVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ )
-{
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTvOutEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTvOutEvent(
- bool connected, TMPXVideoPlaybackControlCommandIds event, int value )
-{
- Q_UNUSED( event );
- Q_UNUSED( value );
- mFileDetails->mTvOutConnected = connected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRectDone
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRectDone()
-{
- mViewTransitionIsGoingOn = false;
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToPreviousVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToNextVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToNextVideoItem()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRect()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
-{
- Q_UNUSED( transitionEffect );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
- Q_UNUSED( transitionEffect );
-
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/testfullscreencontrol.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/testfullscreencontrol.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building testfullscreencontrol
#
#
-# Version : %version: 2 %
+# Version : %version: 3 %
TEMPLATE = app
@@ -29,8 +29,7 @@
../inc \
../../inc \
../../../inc \
- ../../../../inc \
- /epoc32/include/platform/mw \
+ ../../../../inc \
DEPENDPATH += stub/inc stub/src inc src
@@ -51,5 +50,3 @@
mpxvideoplaybackcontrolbar.cpp \
mpxvideoplaybackfiledetailswidget.cpp \
mpxvideoplaybackdetailsplaybackwindow.cpp
-
-
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/inc/testmpxvideoplaybackbuttonbar.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/inc/testmpxvideoplaybackbuttonbar.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 3 %
#ifndef __TESTMPXVIDEOPLAYBACKBUTTONBAR_H__
#define __TESTMPXVIDEOPLAYBACKBUTTONBAR_H__
@@ -37,7 +37,7 @@
* will be called before each testfunction is executed.
*
*/
- void init();
+ void init( bool attachOperation = false );
/**
* will be called after every testfunction.
@@ -51,9 +51,10 @@
// the order in which these testXX methods are declared is important
// changing this order will affect the test results
void testPlay();
- void testStartFFSeeking();
- void testStartRWSeeking();
- void testEndSeeking();
+ void testLongTapOnFF();
+ void testLongTapOnRW();
+ void testShortTapOnFF();
+ void testShortTapOnRW();
void testPause();
void testChangeAspectRatio();
void testUpdateState();
@@ -61,6 +62,7 @@
void testHandleButtonPressed();
void testUpdateWithFileDetails();
void testOpenDetailsView();
+ void testAttach();
signals:
void commandSignal(int);
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/src/testmpxvideoplaybackbuttonbar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/src/testmpxvideoplaybackbuttonbar.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 4 %
#include <qdebug>
@@ -59,11 +59,11 @@
// init
// ---------------------------------------------------------------------------
//
-void TestMPXVideoPlaybackButtonBar::init()
+void TestMPXVideoPlaybackButtonBar::init( bool attachOperation )
{
MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::init()"));
- mController = new QMPXVideoPlaybackControlsController();
+ mController = new QMPXVideoPlaybackControlsController( attachOperation );
mButtonBar = new QMPXVideoPlaybackButtonBar( mController );
mButtonBar->initialize();
@@ -109,59 +109,138 @@
}
// ---------------------------------------------------------------------------
-// testStartFFSeeking
+// testLongTapOnFF
// ---------------------------------------------------------------------------
//
-void TestMPXVideoPlaybackButtonBar::testStartFFSeeking()
+void TestMPXVideoPlaybackButtonBar::testLongTapOnFF()
{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testStartFFSeeking()"));
+ MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testLongTapOnFF()"));
init();
+ //
+ // Start seeking
+ //
mButtonBar->mButtons[EMPXButtonFF]->press();
+ QVERIFY( mController->mTimerAction == EMPXTimerCancel );
+ mButtonBar->mButtons[EMPXButtonFF]->pressing();
+
+ QVERIFY( mButtonBar->mSeekingState == EMPXFastForwarding );
QVERIFY( mButtonBar->mButtons[EMPXButtonFF]->mSelected == true );
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
QVERIFY( mController->mCommand == EMPXPbvCmdSeekForward );
+ //
+ // End seeking
+ //
+ mButtonBar->mButtons[EMPXButtonFF]->release();
+
+ QVERIFY( mButtonBar->mSeekingState == EMPXNotSeeking );
+ QVERIFY( mButtonBar->mButtons[EMPXButtonFF]->mSelected == false );
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
+
cleanup();
}
// ---------------------------------------------------------------------------
-// testStartRWSeeking
+// testLongTapOnRW
// ---------------------------------------------------------------------------
//
-void TestMPXVideoPlaybackButtonBar::testStartRWSeeking()
+void TestMPXVideoPlaybackButtonBar::testLongTapOnRW()
{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testStartRWSeeking()"));
+ MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testLongTapOnRW()"));
init();
+ //
+ // Start seeking
+ //
mButtonBar->mButtons[EMPXButtonRW]->press();
+ QVERIFY( mController->mTimerAction == EMPXTimerCancel );
+ mButtonBar->mButtons[EMPXButtonRW]->pressing();
+
+ QVERIFY( mButtonBar->mSeekingState == EMPXRewinding );
QVERIFY( mButtonBar->mButtons[EMPXButtonRW]->mSelected == true );
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
QVERIFY( mController->mCommand == EMPXPbvCmdSeekBackward );
+ //
+ // End seeking
+ //
+ mButtonBar->mButtons[EMPXButtonRW]->release();
+
+ QVERIFY( mButtonBar->mSeekingState == EMPXNotSeeking );
+ QVERIFY( mButtonBar->mButtons[EMPXButtonRW]->mSelected == false );
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
+
cleanup();
}
// ---------------------------------------------------------------------------
-// testEndSeeking
+// testShortTapOnFF
// ---------------------------------------------------------------------------
//
-void TestMPXVideoPlaybackButtonBar::testEndSeeking()
+void TestMPXVideoPlaybackButtonBar::testShortTapOnFF()
{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testEndSeeking()"));
+ MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testShortTapOnFF()"));
init();
+ //
+ // If mPostion + KMPXFastForward < mDuration
+ //
+ mButtonBar->mPosition = 30;
+ mButtonBar->mDuration = 70;
+ mButtonBar->mButtons[EMPXButtonFF]->release();
+
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mCommandValue == mButtonBar->mPosition + KMPXFastForward );
+
+ //
+ // If mPostion + KMPXFastForward < mDuration
+ //
+ mButtonBar->mDuration = 50;
+ mController->mCommand = EMPXPbvCmdPlay;
+
+ mButtonBar->mButtons[EMPXButtonFF]->release();
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdPlay );
+
+ cleanup();
+}
+
+// ---------------------------------------------------------------------------
+// testShortTapOnRW
+// ---------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackButtonBar::testShortTapOnRW()
+{
+ MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testShortTapOnRW()"));
+
+ init();
+
+ //
+ // If mPostion + KMPXRewind > 0
+ //
+ mButtonBar->mPosition = 30;
mButtonBar->mButtons[EMPXButtonRW]->release();
- QVERIFY( mButtonBar->mButtons[EMPXButtonFF]->mSelected == false );
- QVERIFY( mButtonBar->mButtons[EMPXButtonRW]->mSelected == false );
QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( mController->mCommand == EMPXPbvCmdEndSeek );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mCommandValue == mButtonBar->mPosition + KMPXRewind );
+
+ //
+ // If mPostion + KMPXRewind < 0
+ //
+ mButtonBar->mPosition = 4;
+ mButtonBar->mButtons[EMPXButtonRW]->release();
+
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mCommandValue == 0 );
cleanup();
}
@@ -402,4 +481,60 @@
cleanup();
}
+// ---------------------------------------------------------------------------
+// testAttach
+// ---------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackButtonBar::testAttach()
+{
+ MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackButtonBar::testAttach()"));
+
+ //
+ // test when 'attach' operation is enabled
+ //
+ init( true );
+
+ //
+ // verify 'attach' button is visible
+ //
+ QVERIFY( mButtonBar->mButtons[EMPXButtonAttach]->isVisible() == true );
+
+ //
+ // release 'attach' button
+ //
+ mButtonBar->mButtons[EMPXButtonAttach]->release();
+
+ //
+ // verify the controller attachVideo() slot has been called
+ //
+ QVERIFY( mController->mCommand == EMPXPbvCmdClose );
+ QVERIFY( mController->mAttachVideoDone == true );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // test when 'attach' operation is disabled
+ //
+ init();
+
+ //
+ // verify 'attach' button is not visible
+ //
+ QVERIFY( mButtonBar->mButtons[EMPXButtonAttach]->isVisible() == false );
+
+ //
+ // verify the controller attachVideo() slot is not called
+ //
+ QVERIFY( mController->mAttachVideoDone == false );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+}
+
// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/inc/hbpushbutton.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/inc/hbpushbutton.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -45,10 +45,12 @@
QGraphicsItem* primitive( HbStyle::Primitive primitive ) const;
void press();
void release();
+ void pressing();
signals:
void pressed();
void released();
+ void longPress( QPointF );
public:
bool mVisible;
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -60,7 +60,7 @@
/**
* constructor.
*/
- QMPXVideoPlaybackControlsController();
+ QMPXVideoPlaybackControlsController( bool attachOperation );
/**
* Destructor.
@@ -96,6 +96,11 @@
void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
+ bool isAttachOperation();
+
+ private slots:
+ void attachVideo();
+
public:
QMPXVideoPlaybackViewFileDetails *mFileDetails;
QMPXVideoPlaybackDocumentLoader *mLoader;
@@ -105,6 +110,8 @@
TMPXTimerAction mTimerAction;
TMPXVideoPlaybackViewCommandIds mCommand;
int mCommandValue;
+ bool mIsAttachOperation;
+ bool mAttachVideoDone;
};
// INLINE METHODS
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/hbpushbutton.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/hbpushbutton.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 3 %
#include <qgraphicswidget>
@@ -27,6 +27,9 @@
// -------------------------------------------------------------------------------------------------
//
HbPushButton::HbPushButton()
+ : mVisible( false )
+ , mEnabled( false )
+ , mSelected( false )
{
MPX_ENTER_EXIT(_L("HbPushButton::HbPushButton()"));
@@ -54,7 +57,7 @@
//
void HbPushButton::setEnabled( bool enabled )
{
- MPX_DEBUG(_L("HbPushButton::setEnabled %d"), enabled );
+ MPX_DEBUG(_L("HbPushButton::setEnabled(%d)"), enabled );
mEnabled = enabled;
}
@@ -65,7 +68,7 @@
//
bool HbPushButton::isEnabled()
{
- MPX_DEBUG(_L("HbPushButton::isEnabled %d"), mEnabled );
+ MPX_DEBUG(_L("HbPushButton::isEnabled() ret %d"), mEnabled );
return mEnabled;
}
@@ -76,7 +79,7 @@
//
void HbPushButton::setVisible( bool visible )
{
- MPX_DEBUG(_L("HbPushButton::setVisible %d"), visible );
+ MPX_DEBUG(_L("HbPushButton::setVisible(%d)"), visible );
mVisible = visible;
}
@@ -87,7 +90,7 @@
//
bool HbPushButton::isVisible()
{
- MPX_DEBUG(_L("HbPushButton::isVisible %d"), mVisible );
+ MPX_DEBUG(_L("HbPushButton::isVisible() ret %d"), mVisible );
return mVisible;
}
@@ -98,7 +101,7 @@
//
void HbPushButton::setSelected( bool selected )
{
- MPX_DEBUG(_L("HbPushButton::setSelected %d"), selected );
+ MPX_DEBUG(_L("HbPushButton::setSelected(%d)"), selected );
mSelected = selected;
}
@@ -109,7 +112,7 @@
//
bool HbPushButton::isSelected()
{
- MPX_DEBUG(_L("HbPushButton::isSelected %d"), mSelected );
+ MPX_DEBUG(_L("HbPushButton::isSelected() ret %d"), mSelected );
return mSelected;
}
@@ -122,6 +125,8 @@
{
MPX_DEBUG(_L("HbPushButton::primitive") );
+ Q_UNUSED( primitive );
+
return mBackground;
}
@@ -147,4 +152,16 @@
emit released();
}
+// -------------------------------------------------------------------------------------------------
+// HbPushButton::pressing
+// -------------------------------------------------------------------------------------------------
+//
+void HbPushButton::pressing()
+{
+ MPX_DEBUG(_L("HbPushButton::pressing") );
+
+ QPointF point( 0, 0 );
+ emit longPress( point );
+}
+
// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -31,8 +31,10 @@
// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
// -------------------------------------------------------------------------------------------------
//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
+QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController( bool attachOperation )
: mViewMode( EFullScreenView )
+ , mIsAttachOperation( attachOperation )
+ , mAttachVideoDone( false )
{
MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
@@ -86,4 +88,28 @@
mTimerAction = timerAction;
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::isAttachOperation()
+// -------------------------------------------------------------------------------------------------
+//
+bool QMPXVideoPlaybackControlsController::isAttachOperation()
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isAttachOperation() ret %d"),
+ mIsAttachOperation);
+
+ return mIsAttachOperation;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackControlsController::attachVideo()
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackControlsController::attachVideo()
+{
+ MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"));
+
+ handleCommand( EMPXPbvCmdClose );
+ mAttachVideoDone = true;
+}
+
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/mpxvideoplaybackdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -54,7 +54,7 @@
//
QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget") );
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget( %s )"), name.data() );
QGraphicsWidget *object = NULL;
@@ -78,13 +78,13 @@
//
QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget") );
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget( %s )"), name.data() );
QGraphicsWidget *object = NULL;
if ( name == "rwButton" || name == "pauseButton" || name == "playButton" ||
name == "ffButton" || name == "naturalButton" || name == "stretchButton" ||
- name == "zoomButton" || name == "detailsButton" )
+ name == "zoomButton" || name == "detailsButton" || "attachButton" || "aspectRatioButtons" )
{
object = new HbPushButton();
object->setObjectName( name );
@@ -115,7 +115,7 @@
i = -1;
}
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist %d"), i );
+ MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist( %s ) ret %d"), name.data(), i );
return i;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/hbeffect.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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 HbEffect
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef HBEFFECT_H
+#define HBEFFECT_H
+
+#include <hbwidget.h>
+
+
+class HbEffect : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ struct EffectStatus
+ {
+ Hb::EffectEvent reason;
+ };
+
+ public:
+ static bool add( QGraphicsItem *item, const QString &filePath, const QString &effectEvent );
+ static bool remove( QGraphicsItem *item, const QString &filePath, const QString &effectEvent );
+
+ static bool start( QGraphicsItem *item,
+ const QString &effectEvent,
+ QObject *receiver = 0,
+ const char *member = 0 );
+
+ static bool cancel( QGraphicsItem *item );
+
+ static bool effectRunning( QGraphicsItem *item, const QString &effectEvent = QString() );
+
+ private:
+ void started();
+};
+
+#endif /*HBEFFECT_H*/
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackbuttonbar.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/inc/mpxvideoplaybackbuttonbar.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -42,11 +42,15 @@
void aspectRatioChanged( int aspectRatio );
void initialize();
void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
+ void durationChanged( int duration );
+ void positionChanged( int position );
public:
QMPXVideoPlaybackControlsController *mController;
QMPXVideoPlaybackViewFileDetails *mFileDetails;
int mAspectRatio;
+ int mPosition;
+ int mDuration;
TMPXPlaybackState mState;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/hbeffect.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* 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 HbEffect
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "hbeffect.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// HbEffect::add
+// -------------------------------------------------------------------------------------------------
+//
+bool HbEffect::add( QGraphicsItem *item, const QString &filePath, const QString &effectEvent )
+{
+ MPX_DEBUG(_L("HbEffect::add") );
+
+ Q_UNUSED( item );
+ Q_UNUSED( filePath );
+ Q_UNUSED( effectEvent );
+
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbEffect::remove
+// -------------------------------------------------------------------------------------------------
+//
+bool HbEffect::remove( QGraphicsItem *item, const QString &filePath, const QString &effectEvent )
+{
+ MPX_DEBUG(_L("HbEffect::remove") );
+
+ Q_UNUSED( item );
+ Q_UNUSED( filePath );
+ Q_UNUSED( effectEvent );
+
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbEffect::start
+// -------------------------------------------------------------------------------------------------
+//
+bool HbEffect::start(
+ QGraphicsItem *item, const QString &effectEvent, QObject *receiver, const char *member )
+{
+ MPX_DEBUG(_L("HbEffect::start") );
+
+ Q_UNUSED( item );
+ Q_UNUSED( effectEvent );
+
+ HbEffect::EffectStatus status;
+ status.reason = Hb::EffectFinished;
+
+ QMetaObject::invokeMethod(
+ receiver,
+ member,
+ Qt::AutoConnection,
+ QGenericReturnArgument(),
+ Q_ARG( HbEffect::EffectStatus, status ) );
+
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbEffect::cancel
+// -------------------------------------------------------------------------------------------------
+//
+bool HbEffect::cancel( QGraphicsItem *item )
+{
+ MPX_DEBUG(_L("HbEffect::cancel"));
+
+ Q_UNUSED( item );
+
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbEffect::effectRunning
+// -------------------------------------------------------------------------------------------------
+//
+bool HbEffect::effectRunning( QGraphicsItem *item, const QString &effectEvent )
+{
+ MPX_DEBUG(_L("HbEffect::effectRunning"));
+
+ Q_UNUSED( item );
+
+ return false;
+}
+
+// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackbuttonbar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/stub/src/mpxvideoplaybackbuttonbar.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -90,4 +90,26 @@
mFileDetails = details;
}
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackButtonBar::durationChanged
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackButtonBar::durationChanged( int duration )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::durationChanged duration = %d"), duration );
+
+ mDuration = duration;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMPXVideoPlaybackButtonBar::positionChanged
+// -------------------------------------------------------------------------------------------------
+//
+void QMPXVideoPlaybackButtonBar::positionChanged( int position )
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackButtonBar::positionChanged position = %d"), position );
+
+ mPosition = position;
+}
+
//End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/testmpxvideoplaybackcontrolbar.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolbar/testmpxvideoplaybackcontrolbar.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building testmpxvideoplaybackcontrolbar
#
#
-# Version : %version: 1 %
+# Version : %version: 2 %
TEMPLATE = app
TARGET = testmpxvideoplaybackcontrolbar
@@ -34,6 +34,7 @@
mpxvideoplaybackviewfiledetails.h \
mpxvideoplaybackprogressbar.h \
mpxvideoplaybackbuttonbar.h \
+ hbeffect.h \
../../controlinc/mpxvideoplaybackcontrolbar.h
SOURCES += testmpxvideoplaybackcontrolbar.cpp \
@@ -42,4 +43,5 @@
mpxvideoplaybackviewfiledetails.cpp \
mpxvideoplaybackprogressbar.cpp \
mpxvideoplaybackbuttonbar.cpp \
+ hbeffect.cpp \
../../controlsrc/mpxvideoplaybackcontrolbar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/src/testmpxvideoplaybackcontrolpolicy.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackcontrolpolicy/src/testmpxvideoplaybackcontrolpolicy.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 4 %
#include <qdebug>
@@ -119,14 +119,15 @@
TUint properties = 0;
- mDetails->mPlaybackMode = EMPXVideoLocal;
-
- mPolicy->setControlProperties( EMPXStatusPane, properties, mDetails, EFullScreenView );
- QVERIFY( properties == ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking ) );
-
+ mDetails->mPlaybackMode = EMPXVideoStreaming;
mPolicy->setControlProperties( EMPXStatusPane, properties, mDetails, EDetailsView );
QVERIFY( properties == EMPXAllProperties );
+ mDetails->mPlaybackMode = EMPXVideoLocal;
+ mPolicy->setControlProperties( EMPXStatusPane, properties, mDetails, EFullScreenView );
+ QVERIFY( properties ==
+ ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking | EMPXShownWhenBuffering) );
+
cleanup();
}
@@ -148,8 +149,15 @@
mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EAudioOnlyView );
QVERIFY( properties == EMPXAllProperties );
+ mDetails->mPlaybackMode = EMPXVideoLocal;
mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EFullScreenView );
- QVERIFY( properties == ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking ) );
+ QVERIFY( properties ==
+ ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking | EMPXShownWhenBuffering ) );
+
+ mDetails->mPlaybackMode = EMPXVideoStreaming;
+ mPolicy->setControlProperties( EMPXControlBar, properties, mDetails, EFullScreenView );
+ QVERIFY( properties ==
+ ( EMPXShownWhenPlaying | EMPXShownWhenPaused | EMPXShownWhenSeeking ) );
cleanup();
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/inc/testmpxvideoplaybackdetailsplaybackwindow.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: tester for methods in TestMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 1 %
-
-
-#ifndef __TESTMPXVIDEOPLAYDETAILSPLAYBACKWINDOW_H__
-#define __TESTMPXVIDEOPLAYDETAILSPLAYBACKWINDOW_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QEvent;
-class QMPXVideoPlaybackDetailsPlaybackWindow;
-class QMPXVideoPlaybackControlsController;
-
-class TestMPXVideoPlaybackDetailsPlaybackWindow : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testUpdateState();
- void testPlayPause();
- void testMousePressEvent();
- void testMouseReleaseEvent();
-
-signals:
- void commandSignal(int);
-
-private:
- QMPXVideoPlaybackDetailsPlaybackWindow* mWindow;
- QMPXVideoPlaybackControlsController* mController;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYDETAILSPLAYBACKWINDOW_H__
-
-// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/src/testmpxvideoplaybackdetailsplaybackwindow.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: tester for methods in TestMPXVideoPlaybackDetailsPlaybackWindow
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include <qdebug>
-#include <qgraphicsscenemouseevent>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-
-#include "hbpushbutton.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "testmpxvideoplaybackdetailsplaybackwindow.h"
-
-
-#define private public
-#include "mpxvideoplaybackdetailsplaybackwindow.h"
-#undef private
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDetailsPlaybackWindow::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackDetailsPlaybackWindow tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybackdetailsplaybackwindow.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDetailsPlaybackWindow::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDetailsPlaybackWindow::init()"));
-
- mController = new QMPXVideoPlaybackControlsController();
- mWindow = new QMPXVideoPlaybackDetailsPlaybackWindow( mController );
-
- mWindow->initialize();
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDetailsPlaybackWindow::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDetailsPlaybackWindow::cleanup()"));
-
- if ( mController )
- {
- delete mController;
- mController = NULL;
- }
-
- if ( mWindow )
- {
- delete mWindow;
- mWindow = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testUpdateState
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDetailsPlaybackWindow::testUpdateState()
-{
- MPX_ENTER_EXIT(
- _L("TestMPXVideoPlaybackDetailsPlaybackWindow::testUpdateState()"));
-
- init();
-
- TMPXPlaybackState state = EPbStatePlaying;
- mWindow->updateState( state );
- QVERIFY( mWindow->mPlayButton->isVisible() == false );
-
- state = EPbStatePaused;
- mWindow->updateState( state );
- QVERIFY( mWindow->mPlayButton->isVisible() == true );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testMousePressEvent
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDetailsPlaybackWindow::testMousePressEvent()
-{
- MPX_ENTER_EXIT(
- _L("TestMPXVideoPlaybackDetailsPlaybackWindow::testMousePressEvent()"));
-
- init();
-
- QGraphicsSceneMouseEvent* event =
- new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMousePress );
- event->setAccepted( false );
-
- mWindow->mousePressEvent( event );
-
- QVERIFY( event->isAccepted() );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testMouseReleaseEvent
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDetailsPlaybackWindow::testMouseReleaseEvent()
-{
- MPX_ENTER_EXIT(
- _L("TestMPXVideoPlaybackDetailsPlaybackWindow::testMouseReleaseEvent()"));
-
- init();
-
- QGraphicsSceneMouseEvent* event =
- new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseRelease );
-
- mWindow->mouseReleaseEvent( event );
- QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
-
- delete event;
- event = NULL;
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testPlayPause
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackDetailsPlaybackWindow::testPlayPause()
-{
- MPX_ENTER_EXIT(
- _L("TestMPXVideoPlaybackDetailsPlaybackWindow::testPlayPause()"));
-
- init();
-
- mWindow->mPlayButton->release();
- QVERIFY( mController->mCommand == EMPXPbvCmdPlayPause );
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/inc/hbpushbutton.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of HbPushButton
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HBPUSHBUTTON_H_
-#define HBPUSHBUTTON_H
-
-#include <hbwidget.h>
-#include <hbstyle.h>
-
-class QGraphicsItem;
-
-class HbPushButton : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbPushButton();
- virtual ~HbPushButton();
-
- public:
- void setEnabled( bool enabled );
- void setVisible( bool visible );
- void setSelected( bool selected );
- bool isEnabled();
- bool isVisible();
- bool isSelected();
- QGraphicsItem* primitive( HbStyle::Primitive primitive ) const;
- void press();
- void release();
-
- signals:
- void pressed();
- void released();
-
- public:
- bool mVisible;
- bool mEnabled;
- bool mSelected;
-
- QGraphicsItem *mBackground;
-};
-
-#endif /*HBPUSHBUTTON_H*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-// FORWARD DECLARATIONS
-class QMPXVideoPlaybackDocumentLoader;
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- /**
- * Return file details
- */
- inline QMPXVideoPlaybackViewFileDetails* fileDetails();
-
- inline QMPXVideoPlaybackDocumentLoader* layoutLoader();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- public:
- QMPXVideoPlaybackViewFileDetails *mFileDetails;
- QMPXVideoPlaybackDocumentLoader *mLoader;
-
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::fileDetails
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
-{
- return mFileDetails;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::layoutLoader
-// -------------------------------------------------------------------------------------------------
-//
-inline
-QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
- return mLoader;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/inc/mpxvideoplaybackdocumentloader.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-#define MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_
-
-
-#include <qobject>
-#include <qlist>
-
-class QGraphicsWidget;
-class QMPXVideoPlaybackControlsController;
-
-class QMPXVideoPlaybackDocumentLoader : public QObject
-{
- public:
- QMPXVideoPlaybackDocumentLoader();
- virtual ~QMPXVideoPlaybackDocumentLoader();
-
- public:
- QGraphicsWidget* findWidget( const QString &name );
-
- private:
- QGraphicsWidget* createWidget( const QString &name );
- int exist( const QString &name );
-
- private:
- QList<QGraphicsWidget*> mWidgets;
-};
-
-#endif /*MPXVIDEOPLAYBACKDOCUMENTHANDLER_H_*/
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: MPX Video File Details (QT)
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-
-#ifndef __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-#define __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-#include <qobject.h>
-#include "mpxhelixplaybackplugindefs.h"
-
-
-//
-// CLASS DECLARATION
-//
-class QMPXVideoPlaybackViewFileDetails : public QObject
-{
- public:
- //
- // Constructor
- //
- QMPXVideoPlaybackViewFileDetails();
-
- //
- // Destructor.
- //
- virtual ~QMPXVideoPlaybackViewFileDetails();
-
- //
- // Clear all file details
- //
- void clearFileDetails();
-
- public:
- //
- // Data
- //
- QString mClipName;
- QString mTitle;
- QString mArtist;
- QString mMimeType;
- QString mDescription;
- QString mLocation;
- QString mCopyright;
- QString mLanguage;
- QString mKeywords;
-
- TMPXVideoMode mPlaybackMode;
- bool mSeekable;
- bool mPausableStream;
- bool mAudioEnabled;
- bool mVideoEnabled;
- bool mPartialPlayback;
- bool mRNFormat;
- bool mTvOutConnected;
- bool mTvOutPlayAllowed;
- bool mDrmProtected;
- bool mMultiItemPlaylist;
-
- int mVideoHeight;
- int mVideoWidth;
- int mBitRate;
- int mDuration;
-};
-
-#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/src/hbpushbutton.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of HbPushButton
-*
-*/
-
-// Version : %version: 1 %
-
-#include <qgraphicswidget>
-
-#include "mpxvideo_debug.h"
-#include "hbpushbutton.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::HbPushButton
-// -------------------------------------------------------------------------------------------------
-//
-HbPushButton::HbPushButton()
-{
- MPX_ENTER_EXIT(_L("HbPushButton::HbPushButton()"));
-
- mBackground = new QGraphicsWidget();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::~HbPushButton
-// -------------------------------------------------------------------------------------------------
-//
-HbPushButton::~HbPushButton()
-{
- MPX_DEBUG(_L("HbPushButton::HbPushButton") );
-
- if ( mBackground )
- {
- delete mBackground;
- mBackground = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setEnabled
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setEnabled( bool enabled )
-{
- MPX_DEBUG(_L("HbPushButton::setEnabled %d"), enabled );
-
- mEnabled = enabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::isEnabled
-// -------------------------------------------------------------------------------------------------
-//
-bool HbPushButton::isEnabled()
-{
- MPX_DEBUG(_L("HbPushButton::isEnabled %d"), mEnabled );
-
- return mEnabled;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setVisible( bool visible )
-{
- MPX_DEBUG(_L("HbPushButton::setVisible %d"), visible );
-
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::isVisible
-// -------------------------------------------------------------------------------------------------
-//
-bool HbPushButton::isVisible()
-{
- MPX_DEBUG(_L("HbPushButton::isVisible %d"), mVisible );
-
- return mVisible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::setSelected
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::setSelected( bool selected )
-{
- MPX_DEBUG(_L("HbPushButton::setSelected %d"), selected );
-
- mSelected = selected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::isSelected
-// -------------------------------------------------------------------------------------------------
-//
-bool HbPushButton::isSelected()
-{
- MPX_DEBUG(_L("HbPushButton::isSelected %d"), mSelected );
-
- return mSelected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::primitive
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsItem* HbPushButton::primitive( HbStyle::Primitive primitive ) const
-{
- MPX_DEBUG(_L("HbPushButton::primitive") );
-
- return mBackground;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::press
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::press()
-{
- MPX_DEBUG(_L("HbPushButton::press") );
-
- emit pressed();
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::release
-// -------------------------------------------------------------------------------------------------
-//
-void HbPushButton::release()
-{
- MPX_DEBUG(_L("HbPushButton::release") );
-
- emit released();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-// INCLUDE FILES
-
-
-#include "mpxvideoplaybackdocumentloader.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-
-// ================= MEMBER FUNCTIONS ==============================================================
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
- : mViewMode( EFullScreenView )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()"));
-
- mLoader = new QMPXVideoPlaybackDocumentLoader();
- mFileDetails = new QMPXVideoPlaybackViewFileDetails();
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleCommand(
- TMPXVideoPlaybackViewCommandIds command, int value )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand(%d)"), command);
-
- mCommand = command;
- mCommandValue = value;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- mViewMode = viewMode;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers()"));
-
- mTimerAction = timerAction;
-}
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of QMPXVideoPlaybackDocumentLoader
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include "hbpushbutton.h"
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackdocumentloader.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader()"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackDocumentLoader::~QMPXVideoPlaybackDocumentLoader()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::QMPXVideoPlaybackDocumentLoader") );
-
- for ( int i = 0 ; i < mWidgets.count() ; i++ )
- {
- mWidgets.removeAt( 0 );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::findWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::findWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::findWidget") );
-
- QGraphicsWidget *object = NULL;
-
- int index = exist( name );
-
- if ( index == -1 )
- {
- object = createWidget( name );
- }
- else
- {
- object = mWidgets[ index ];
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::createWidget()
-// -------------------------------------------------------------------------------------------------
-//
-QGraphicsWidget *QMPXVideoPlaybackDocumentLoader::createWidget( const QString &name )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::createWidget") );
-
- QGraphicsWidget *object = NULL;
-
- if ( name == "detailsViewPlayButton" )
- {
- object = new HbPushButton();
- object->setObjectName( name );
- mWidgets.append( object );
- }
-
- return object;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackDocumentLoader::exist()
-// -------------------------------------------------------------------------------------------------
-//
-int QMPXVideoPlaybackDocumentLoader::exist( const QString &name )
-{
- int i = 0;
-
- for ( ; i < mWidgets.count() ; i++ )
- {
- if( mWidgets[i]->objectName() == name )
- {
- break;
- }
- }
-
- if ( i == mWidgets.count() )
- {
- i = -1;
- }
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::exist %d"), i );
-
- return i;
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: class for MPX Video File Details (Qt)
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-//
-// INCLUDE FILES
-//
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackviewfiledetails.h"
-
-
-// ============================ MEMBER FUNCTIONS ===================================================
-
-QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::~QMPXVideoPlaybackViewFileDetails()"));
-
- clearFileDetails();
-}
-
-void
-QMPXVideoPlaybackViewFileDetails::clearFileDetails()
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackViewFileDetails::ClearFileDetails()"));
-
- mMimeType = tr("");
- mTitle = tr("");
- mArtist = tr("");
- mClipName = tr("");
- mDescription = tr("");
- mLocation = tr("");
- mCopyright = tr("");
- mLanguage = tr("");
- mKeywords = tr("");
-
- mPlaybackMode = EMPXVideoLocal;
- mSeekable = false;
- mPausableStream = false;
- mAudioEnabled = false;
- mVideoEnabled = false;
- mPartialPlayback = false;
- mRNFormat = false;
-
- mDuration = 0;
- mTvOutConnected = false;
- mTvOutPlayAllowed = true;
- mDrmProtected = false;
-
- mVideoHeight = 0;
- mVideoWidth = 0;
- mBitRate = 0;
-}
-
-// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdetailsplaybackwindow/testmpxvideoplaybackdetailsplaybackwindow.pro Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: Project file for building testmpxvideoplaybackdetailsplaybackwindow
-#
-#
-# Version : %version: 1 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackdetailsplaybackwindow
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybackdetailsplaybackwindow.h \
- mpxvideoplaybackcontrolscontroller.h \
- mpxvideoplaybackdocumentloader.h \
- mpxvideoplaybackviewfiledetails.h \
- hbpushbutton.h \
- ../../controlinc/mpxvideoplaybackdetailsplaybackwindow.h
-
-SOURCES += testmpxvideoplaybackdetailsplaybackwindow.cpp \
- mpxvideoplaybackcontrolscontroller.cpp \
- mpxvideoplaybackdocumentloader.cpp \
- mpxvideoplaybackviewfiledetails.cpp \
- hbpushbutton.cpp \
- ../../controlsrc/mpxvideoplaybackdetailsplaybackwindow.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/src/testmpxvideoplaybackdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/src/testmpxvideoplaybackdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
#include <qdebug>
@@ -111,9 +111,6 @@
object = mLoader->createObject( "", "fileDetailsLayout" );
QVERIFY( object->objectName() == "fileDetailsLayout" );
- object = mLoader->createObject( "", "volumeSlider" );
- QVERIFY( object->objectName() == "volumeSlider" );
-
object = mLoader->createObject( "", "detailsPlaybackWindow" );
QVERIFY( object->objectName() == "detailsPlaybackWindow" );
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/testmpxvideoplaybackdocumentloader.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/testmpxvideoplaybackdocumentloader.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building testmpxvideoplaybackdocumentloader
#
#
-# Version : %version: 2 %
+# Version : %version: 3 %
TEMPLATE = app
TARGET = testmpxvideoplaybackdocumentloader
@@ -35,7 +35,6 @@
mpxvideoplaybackprogressbar.h \
mpxvideoplaybackbuttonbar.h \
mpxvideoplaybackcontrolbar.h \
- mpxvideoplaybacknontouchvolumebar.h \
../../controlinc/mpxvideoplaybackdocumentloader.h
SOURCES += testmpxvideoplaybackdocumentloader.cpp \
@@ -45,5 +44,4 @@
mpxvideoplaybackprogressbar.cpp \
mpxvideoplaybackbuttonbar.cpp \
mpxvideoplaybackcontrolbar.cpp \
- mpxvideoplaybacknontouchvolumebar.cpp \
../../controlsrc/mpxvideoplaybackdocumentloader.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/inc/testmpxvideoplaybackfiledetailswidget.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/inc/testmpxvideoplaybackfiledetailswidget.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef __TESTMPXVIDEOPLAYBACKFILEDETAILSWIDGET_H__
#define __TESTMPXVIDEOPLAYBACKFILEDETAILSWIDGET_H__
@@ -26,6 +26,7 @@
class QMPXVideoPlaybackFileDetailsWidget;
class QMPXVideoPlaybackControlsController;
+class QDateTime;
class TestMPXVideoPlaybackFileDetailsWidget : public QObject
{
@@ -71,6 +72,8 @@
QString expectedSecondaryText = "",
bool needToBeCompared = true );
+ QString dateTimeStringFormat( QDateTime dateTime );
+
signals:
void commandSignal(int);
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/src/testmpxvideoplaybackfiledetailswidget.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/src/testmpxvideoplaybackfiledetailswidget.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,14 +15,17 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 4 %
-#include <qdebug>
+#include <QDateTime>
+#include <QFileInfo>
+
#include <hbmainwindow.h>
#include <hbapplication.h>
#include <hblistwidget.h>
#include <hblistwidgetitem.h>
+#include <hbextendedlocale.h>
#include "mpxvideoplaybackviewfiledetails.h"
#include "mpxvideoplaybackcontrolscontroller.h"
@@ -174,25 +177,12 @@
//
// If it's local mode, need to show the duration
//
- details->mPlaybackMode = EMPXVideoLiveStreaming;
- details->mDuration = 3700000;
-
- mWidget->updateWithFileDetails( details );
-
- verifyResult( "Duration", "" );
-
- mWidget->mListWidget->clear();
- mWidget->mFileDetailsUpdated = false;
-
- //
- // If it's local mode, need to show the duration
- //
details->mPlaybackMode = EMPXVideoLocal;
details->mDuration = 3700000;
mWidget->updateWithFileDetails( details );
- verifyResult( "Duration", true, "1 hr 1 min 40 sec " );
+ verifyResult( "Duration", true, "1 hr 1 min 40 sec" );
cleanup();
}
@@ -208,30 +198,82 @@
init();
QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
-
+
+ QDateTime dateTime;
+ QString created("");
+ QString modified("");
+ details->mClipName = KFILEPATH;
+ QFileInfo fileInfo( details->mClipName );
+
//
// If it is streaming case, we don't show size information
- //
- details->mClipName = KFILEPATH;
+ //
details->mPlaybackMode = EMPXVideoStreaming;
mWidget->updateWithFileDetails( details );
+ //
+ // verify results for streaming clip
+ //
verifyResult( "Date", false );
verifyResult( "Modified", false );
+ //
+ // clear the widget list
+ //
mWidget->mListWidget->clear();
mWidget->mFileDetailsUpdated = false;
//
- // If it is local, we show size information
+ // local clip, with no date/time metadata
//
- details->mClipName = KFILEPATH;
details->mPlaybackMode = EMPXVideoLocal;
mWidget->updateWithFileDetails( details );
- verifyResult( "Date", true, "", false );
- verifyResult( "Modified", true, "", false );
+ //
+ // compare and verify 'Date' for non-metadata local clip
+ //
+ dateTime = fileInfo.created();
+ created = dateTimeStringFormat( dateTime );
+ verifyResult( "Date", true, created, true );
+
+ //
+ // compare and verify 'Modified' for non-metadata local clip
+ //
+ dateTime = fileInfo.lastModified();
+ modified = dateTimeStringFormat( dateTime );
+ verifyResult( "Modified", true, modified, true );
+
+ //
+ // clear the widget list
+ //
+ mWidget->mListWidget->clear();
+ mWidget->mFileDetailsUpdated = false;
+
+ //
+ // local clip, with date/time metadata
+ //
+ details->mPlaybackMode = EMPXVideoLocal;
+ details->mCreationTime = 1242367251; // POSIX creation time
+ details->mModificationTime = 1270773249; // POSIX modification time
+ mWidget->updateWithFileDetails( details );
+ //
+ // compare and verify 'Date' for metadata local clip
+ //
+ dateTime.setTime_t( details->mCreationTime );
+ created = dateTimeStringFormat( dateTime );
+ verifyResult( "Date", true, created, true );
+
+ //
+ // compare and verify 'Modified' for metadata local clip
+ //
+ dateTime.setTime_t( details->mModificationTime );
+ modified = dateTimeStringFormat( dateTime );
+ verifyResult( "Modified", true, modified, true );
+
+ //
+ // clean up
+ //
cleanup();
}
@@ -404,7 +446,7 @@
mWidget->updateWithFileDetails( details );
- QString resolution = QString("%1 x %2")
+ QString resolution = QString("%1x%2")
.arg( details->mVideoWidth ).arg( details->mVideoHeight );
verifyResult( "Resolution", true, resolution );
@@ -444,11 +486,11 @@
init();
QMPXVideoPlaybackViewFileDetails *details = mController->fileDetails();
- details->mBitRate = 1024;
+ details->mBitRate = 512;
mWidget->updateWithFileDetails( details );
- verifyResult( "Bitrate", true, "1024 Kbps" );
+ verifyResult( "Bitrate", true, "512 kbps" );
cleanup();
}
@@ -498,6 +540,9 @@
void TestMPXVideoPlaybackFileDetailsWidget::verifyResult(
QString primaryText, bool exist, QString expectedSecondaryText, bool needToBeCompared )
{
+ MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::verifyResult(%s, %d, %s, %d)"),
+ primaryText.data(), exist, expectedSecondaryText.data(), needToBeCompared );
+
QString secondaryText = "";
int i = 0;
@@ -519,10 +564,16 @@
{
if ( needToBeCompared )
{
+ MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::verifyResult() : secondaryText(%s)"),
+ secondaryText.data() );
+
QVERIFY( expectedSecondaryText == secondaryText );
}
else
{
+ MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::verifyResult() : i(%d) count(%d)"),
+ i, mWidget->mListWidget->count() );
+
//
// Doens't need to compare the secondary text. Just make sure it's in the list
//
@@ -539,4 +590,22 @@
}
}
+
+// -------------------------------------------------------------------------------------------------
+// dateTimeStringFormat
+// -------------------------------------------------------------------------------------------------
+//
+QString TestMPXVideoPlaybackFileDetailsWidget::dateTimeStringFormat( QDateTime dateTime )
+{
+ HbExtendedLocale locale = HbExtendedLocale::system();
+ QString date = locale.format( dateTime.date(), r_qtn_date_usual );
+ QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
+ QString dateTimeString( date + " " + time );
+
+ MPX_DEBUG(_L("TestMPXVideoPlaybackFileDetailsWidget::dateTimeStringFormat() ret '%s'"),
+ dateTimeString.data() );
+
+ return dateTimeString;
+}
+
// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/inc/mpxvideoplaybackviewfiledetails.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -78,6 +78,8 @@
int mVideoWidth;
int mBitRate;
int mDuration;
+ int mCreationTime;
+ int mModificationTime;
};
#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/hbglobal.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -77,7 +77,7 @@
{
loc = "Collection";
}
- else if ( string == "txt_videos_title_videos" )
+ else if ( string == "txt_videos_list_title" )
{
loc = "Title";
}
@@ -89,6 +89,35 @@
{
loc = "Bitrate";
}
+ else if ( string == "txt_videos_list_l1_l2_l3" )
+ {
+ loc = "%L1 hr %L2 min %L3 sec";
+ }
+ else if ( string == "txt_videos_list_l1_kb" )
+ {
+ loc = "%L1 kB";
+ }
+ else if ( string == "txt_videos_list_l1_mb" )
+ {
+ loc = "%L1 MB";
+ }
+ else if ( string == "txt_videos_list_l1_gb" )
+ {
+ loc = "%L1 GB";
+ }
+ else if ( string == "txt_videos_list_l1_kbps" )
+ {
+ loc = "%L1 kbps";
+ }
+ else if ( string == "txt_videos_list_l1_mbps" )
+ {
+ loc = "%L1 Mbps";
+ }
+ else if ( string == "txt_videos_list_l1l2" )
+ {
+ loc = "%L1x%L2";
+ }
+
return loc;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackfiledetailswidget/stub/src/mpxvideoplaybackviewfiledetails.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -73,6 +73,8 @@
mVideoHeight = 0;
mVideoWidth = 0;
mBitRate = 0;
+ mCreationTime = 0;
+ mModificationTime = 0;
}
// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackvolumebar/inc/testmpxvideoplaybackvolumebar.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: tester for methods in TestMPXVideoPlaybackVolumeBar
-*
-*/
-
-// Version : %version: 1 %
-
-#ifndef __TESTMPXVIDEOPLAYBACKVOLUMEBAR_H__
-#define __TESTMPXVIDEOPLAYBACKVOLUMEBAR_H__
-
-
-// INCLUDES
-#include <QtTest/QtTest>
-
-class QMPXVideoPlaybackNonTouchVolumeBar;
-
-class TestMPXVideoPlaybackVolumeBar : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * will be called before each testfunction is executed.
- *
- */
- void init();
-
- /**
- * will be called after every testfunction.
- *
- */
- void cleanup();
-
- // test functions for the test framework
-private slots:
-
- // the order in which these testXX methods are declared is important
- // changing this order will affect the test results
- void testSetVisible();
- void testHideVolumeControl();
- void testMousePressEvent();
- void testMouseReleaseEvent();
-
-
-signals:
- void commandSignal();
-
-private:
- QMPXVideoPlaybackNonTouchVolumeBar* mVolumeBar;
-};
-
-
-#endif // __TESTMPXVIDEOPLAYBACKVOLUMEBAR_H__
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackvolumebar/src/testmpxvideoplaybackvolumebar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: tester for methods in TestMPXVideoPlaybackVolumeBar
-*
-*/
-
-// Version : %version: 2 %
-
-
-#include <qdebug>
-#include <qtimer>
-#include <qgraphicsscenemouseevent>
-
-#include <hbmainwindow.h>
-#include <hbapplication.h>
-#include <hbvolumeslider.h>
-
-#include "mpxvideo_debug.h"
-#include "testmpxvideoplaybackvolumebar.h"
-
-#define private public
-#include "mpxvideoplaybacknontouchvolumebar.h"
-#undef private
-
-// ---------------------------------------------------------------------------
-// main
-// ---------------------------------------------------------------------------
-//
-int main(int argc, char *argv[])
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::Main()"));
-
- HbApplication app(argc, argv);
- HbMainWindow window;
-
- TestMPXVideoPlaybackVolumeBar tv;
-
- char *pass[3];
- pass[0] = argv[0];
- pass[1] = "-o";
- pass[2] = "c:\\data\\testmpxvideoplaybackvolumebar.txt";
-
- int res = QTest::qExec(&tv, 3, pass);
-
- return res;
-}
-
-
-// ---------------------------------------------------------------------------
-// init
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackVolumeBar::init()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::init()"));
-
- mVolumeBar = new QMPXVideoPlaybackNonTouchVolumeBar();
-}
-
-// ---------------------------------------------------------------------------
-// cleanup
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackVolumeBar::cleanup()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::cleanup()"));
-
- if ( mVolumeBar )
- {
- delete mVolumeBar;
- mVolumeBar = NULL;
- }
-}
-
-// ---------------------------------------------------------------------------
-// testSetVisible
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackVolumeBar::testSetVisible()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::testSetVisible()"));
-
- init();
-
- mVolumeBar->setVisible( false );
-
- QVERIFY( mVolumeBar->mVolumeTimer->isActive() == false );
- QVERIFY( mVolumeBar->isVisible() == false );
-
- mVolumeBar->setVisible( true );
-
- QVERIFY( mVolumeBar->mVolumeTimer->isActive() == true );
- QVERIFY( mVolumeBar->isVisible() == true );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testHideVolumeControl
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackVolumeBar::testHideVolumeControl()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::testHideVolumeControl()"));
-
- init();
-
- connect( this, SIGNAL( commandSignal() ), mVolumeBar, SLOT( hideVolumeControl() ) );
- emit commandSignal();
- disconnect( this, SIGNAL( commandSignal() ), mVolumeBar, SLOT( hideVolumeControl() ) );
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testMousePressEvent
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackVolumeBar::testMousePressEvent()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::testMousePressEvent()"));
-
- init();
-
- QGraphicsSceneMouseEvent* event =
- new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMousePress );
- event->setAccepted( true );
-
- mVolumeBar->mousePressEvent( event );
-
- QVERIFY( ! event->isAccepted() );
-
- delete event;
- event = NULL;
-
- cleanup();
-}
-
-// ---------------------------------------------------------------------------
-// testMouseReleaseEvent
-// ---------------------------------------------------------------------------
-//
-void TestMPXVideoPlaybackVolumeBar::testMouseReleaseEvent()
-{
- MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackVolumeBar::testMouseReleaseEvent()"));
-
- init();
-
- QGraphicsSceneMouseEvent* event =
- new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseRelease );
- event->setAccepted( true );
-
- mVolumeBar->mouseReleaseEvent( event );
- QVERIFY( ! event->isAccepted() );
-
- delete event;
- event = NULL;
-
- cleanup();
-}
-
-// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackvolumebar/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of MPXVideoPlaybackControlsController
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-#define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
-
-// INCLUDES
-#include <qobject>
-#include <mpxplaybackframeworkdefs.h>
-
-#include "mpxvideo_debug.h"
-#include "mpxcommonvideoplaybackview.hrh"
-
-
-// FORWARD DECLARATIONS
-
-
-// DATA TYPES
-
-enum TMPXTimerAction
-{
- EMPXTimerCancel,
- EMPXTimerReset
-};
-
-enum TPlaybackViewMode
-{
- EFullScreenView,
- EDetailsView,
- EAudioOnlyView
-};
-
-const int KMPXControlsTimeOut = 4000;
-
-// CLASS DECLARATION
-
-class QMPXVideoPlaybackControlsController : public QObject
-{
- Q_OBJECT
-
- public:
-
- /**
- * constructor.
- */
- QMPXVideoPlaybackControlsController();
-
- /**
- * Destructor.
- */
- virtual ~QMPXVideoPlaybackControlsController();
-
- public:
-
- /**
- * Command handling function.
- * Call HandleCommandL() of container
- */
- void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
-
- /**
- * Reset or cancel timers for the controls
- */
- void resetDisappearingTimers( TMPXTimerAction timerAction );
-
- /**
- * Return state
- */
- inline TMPXPlaybackState state();
-
- TPlaybackViewMode viewMode();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
- public:
- TMPXPlaybackState mState;
- TPlaybackViewMode mViewMode;
- TMPXTimerAction mTimerAction;
- TMPXVideoPlaybackViewCommandIds mCommand;
- int mCommandValue;
-};
-
-// INLINE METHODS
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::state
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
-{
- return mState;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::viewMode
-// -------------------------------------------------------------------------------------------------
-//
-inline
-TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
-{
- return mViewMode;
-}
-
-#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
-
-// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackvolumebar/testmpxvideoplaybackvolumebar.pro Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: Project file for building testmpxvideoplaybackvolumebar
-#
-#
-# Version : %version: 1 %
-
-TEMPLATE = app
-TARGET = testmpxvideoplaybackvolumebar
-CONFIG += qtestlib qt hb
-
-INCLUDEPATH += stub/inc \
- ../../../../inc \
- ../../../inc
-
-
-DEPENDPATH += inc src stub/inc stub/src
-
-# Input
-HEADERS += testmpxvideoplaybackvolumebar.h \
- ../../controlinc/mpxvideoplaybacknontouchvolumebar.h
-
-SOURCES += testmpxvideoplaybackvolumebar.cpp \
- ../../controlsrc/mpxvideoplaybacknontouchvolumebar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 6 %
@@ -87,9 +87,7 @@
int value );
private slots:
- void hideAllControls();
- void skipToNextVideoItem();
- void skipToPreviousVideoItem();
+
void handleTappedOnScreen();
public:
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackuserinputhandler.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackuserinputhandler.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -23,18 +23,14 @@
#define MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_
// INCLUDES
-#include <remconcoreapitargetobserver.h> // Side volume key
// FORWARD DECLARATIONS
-class CRemConInterfaceSelector; // Side volume key
-class CRemConCoreApiTarget;
class CMPXVideoViewWrapper;
// CLASS DECLARATION
-class CMPXVideoPlaybackUserInputHandler : public CBase,
- public MRemConCoreApiTargetObserver
+class CMPXVideoPlaybackUserInputHandler : public CBase
{
public: // Constructors and destructor
@@ -64,84 +60,12 @@
public:
void ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
- void ProcessMediaKey( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- void DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- // From MRemConCoreApiTargetObserver
- /**
- * Side volume key API from MRemConCoreApiTargetObserver
- * @since 3.2
- * @see MRemConCoreApiTargetObserver
- */
- virtual void MrccatoPlay(
- TRemConCoreApiPlaybackSpeed aSpeed,
- TRemConCoreApiButtonAction aButtonAct );
-
- virtual void MrccatoCommand(
- TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct );
-
- /**
- * Setter method for iForeground
- * @param aForeground - the value to be set
- * @return void
- */
void SetForeground( TBool aForeground );
void HandleTVOutEventL(TBool aTVOutConnected);
- private:
- /**
- * Handles volume repeat timer timout
- * @return TInt
- */
- static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
-
- /**
- * Adjust volume(+1/-1) for media key
- * @return void
- */
- void HandleVolumeRepeatL();
-
- void HandleFastForward( TRemConCoreApiButtonAction aButtonAct );
-
- void HandleRewind( TRemConCoreApiButtonAction aButtonAct );
-
- void HandleVolumeUp( TRemConCoreApiButtonAction aButtonAct );
-
- void HandleVolumeDown( TRemConCoreApiButtonAction aButtonAct );
-
- // Handles the Display light timer timeout
- static TInt HandleDisplayTimeout( TAny* aPtr );
-
- // Disable the display backlight
- void DisableBacklight();
-
- // Enable the display backlight
- void EnableBacklight();
-
- // Restarts the timer for display light time-out
- void RestartDisplayTimer();
-
private:
-
- TMPXVideoUserInputType iProcessingInputType; // the type of input being processed
- TUint iLastPressedKeyCode; // keycode of last key that sent EEventKeyDown
- TInt iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown
- TRemConCoreApiOperationId iLastMediaKeyPressed; // Id of last mediakey thats sent a button-press
-
- CRemConInterfaceSelector* iInterfaceSelector; // Side volume key, owned
- CRemConCoreApiTarget* iCoreTarget; // Owned by CRemConInterfaceSelector
-
- CPeriodic* iVolumeRepeatTimer; // owned
- TBool iVolumeRepeatUp;
TBool iTVOutConnected; // Flag to indicate if TV is connected
- CPeriodic* iDisplayTimer; // Timer to timeout the lights time-out
- TInt iDisplayTimeOut; // Value of the lights time-out
-
TBool iForeground;
CMPXVideoViewWrapper* iViewWrapper;
};
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/inc/mpxvideoplaybackviewfiledetails.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -78,6 +78,8 @@
int mVideoWidth;
int mBitRate;
int mDuration;
+ int mCreationTime;
+ int mModificationTime;
};
#endif // __MPXVIDEOPLAYBACKVIEWFILEDETAILS__
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 7 %
@@ -118,15 +118,6 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::hideAllControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::hideAllControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::handleTvOutEvent
// -------------------------------------------------------------------------------------------------
//
@@ -145,35 +136,15 @@
void QMPXVideoPlaybackControlsController::updateVideoRectDone()
{
mViewTransitionIsGoingOn = false;
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToPreviousVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()
-{
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToNextVideoItem
+// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
// -------------------------------------------------------------------------------------------------
//
-void QMPXVideoPlaybackControlsController::skipToNextVideoItem()
-{
-
-}
+void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-// -------------------------------------------------------------------------------------------------
-//
-
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTappedOnScreen"));
}
-
-
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackuserinputhandler.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackuserinputhandler.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
// INCLUDE FILES
@@ -25,18 +25,10 @@
#include <e32base.h>
#include <eikclbd.h>
#include <aknconsts.h>
-#include <remconcoreapi.h>
-#include <remconcoreapitarget.h>
-#include <remconinterfaceselector.h> // Side volume key
#include <mpxplaybackframeworkdefs.h>
-#include <centralrepository.h> // for peripheral display timeout setting
-#include <settingsinternalcrkeys.h> // display timeout setting keys
#include <hwrmlightdomaincrkeys.h>
#include <mpxvideoplaybackdefs.h>
-#include <hal.h>
-#include <hal_data.h>
-
#include "mpxvideo_debug.h"
#include "mpxvideoviewwrapper.h"
#include "mpxcommonvideoplaybackview.hrh"
@@ -95,77 +87,6 @@
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::MrccatoPlay()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/,
- TRemConCoreApiButtonAction aButtonAct )
-{
- Q_UNUSED( aButtonAct );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::MrccatoCommand()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::MrccatoCommand(TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct )
-{
- Q_UNUSED( aOperationId );
- Q_UNUSED( aButtonAct );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::DoHandleMediaKey( TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct )
-{
- Q_UNUSED( aOperationId );
- Q_UNUSED( aButtonAct );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleFastForward()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleFastForward(TRemConCoreApiButtonAction aButtonAct)
-{
- Q_UNUSED( aButtonAct );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleRewind()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleRewind(TRemConCoreApiButtonAction aButtonAct)
-{
- Q_UNUSED( aButtonAct );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeUp()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleVolumeUp(TRemConCoreApiButtonAction aButtonAct)
-{
- Q_UNUSED( aButtonAct );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeDown()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleVolumeDown(TRemConCoreApiButtonAction aButtonAct)
-{
- Q_UNUSED( aButtonAct );
-}
-
-// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackUserInputHandler::ProcessKeyEvent()
// -------------------------------------------------------------------------------------------------
//
@@ -177,36 +98,6 @@
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::ProcessMediaKey()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::ProcessMediaKey(TRemConCoreApiOperationId aOperationId,
- TRemConCoreApiButtonAction aButtonAct)
-{
- Q_UNUSED( aOperationId );
- Q_UNUSED( aButtonAct );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL()
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatTimeoutL( TAny* aPtr )
-{
- Q_UNUSED( aPtr );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::HandleVolumeRepeatL()
-{
-}
-
-
-// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackUserInputHandler::SetForeground()
// -------------------------------------------------------------------------------------------------
//
@@ -216,25 +107,6 @@
}
// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::DisableBacklight()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::DisableBacklight()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::EnableBacklight()
-// -------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::EnableBacklight()
-{
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackUserInputHandler::HandleTVOutEvent()
// -------------------------------------------------------------------------------------------------
//
@@ -243,24 +115,4 @@
Q_UNUSED( aTVOutConnected );
}
-
-
-// -------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMPXVideoPlaybackUserInputHandler::HandleDisplayTimeout( TAny* aPtr )
-{
- Q_UNUSED( aPtr );
-}
-
-// -----------------------------------------------------------------------------
-// CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer
-// -----------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackUserInputHandler::RestartDisplayTimer()
-{
-
-}
-
// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/stub/src/mpxvideoplaybackviewfiledetails.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -71,6 +71,8 @@
mVideoHeight = 0;
mVideoWidth = 0;
mBitRate = 0;
+ mCreationTime = 0;
+ mModificationTime = 0;
}
// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testmpxvideoviewwrapper/testmpxvideoviewwrapper.pro Mon May 03 12:32:50 2010 +0300
@@ -11,65 +11,47 @@
#
# Contributors:
#
-# Description: Project file for building Videoplayer components
+# Description: Project file for building testmpxvideoviewwrapper
#
#
-# Version : %version: 4 %
+# Version : %version: 5 %
TEMPLATE = app
TARGET = testmpxvideoviewwrapper
CONFIG += qtestlib hb qt
-DEPENDPATH += . \
- inc \
- src
+DEPENDPATH += inc src stub/src stub/inc
INCLUDEPATH += ../inc \
- ../../inc \
+ ../../inc \
../../../inc \
../../../../inc \
../../controlinc \
../../viewinc \
$$MW_LAYER_SYSTEMINCLUDE
-LIBS += -lmpxplaybackutility.dll \
- -lmpxcommon.dll \
- -lmpxviewplugin.dll \
+LIBS += -lmpxcommon.dll \
+ -lflogger.dll \
+ -lmpxcollectionutility.dll \
-lcone.dll \
- -lws32.dll \
- -lestor.dll \
- -leuser.dll \
- -lcommonengine.dll \
- -lavkon.dll \
- -lefsrv.dll \
- -lflogger.dll \
- -lsysutil.dll \
- -lmpxcollectionutility.dll \
- -lremconcoreapi.dll \
- -lremconInterfacebase.dll \
- -lhal.dll \
- -lcentralrepository.dll
-
-
+ -lws32.dll
+
# Input
-HEADERS += stub/inc/mpxvideoplaybackuserinputhandler.h \
+HEADERS += testmpxvideoviewwrapper.h \
stub/inc/hbvideobaseplaybackview.h \
- inc/testmpxvideoviewwrapper.h \
- ../../viewinc/mpxvideoviewwrapper.h \
- stub/inc/mpxvideoplaybackcontrolscontroller.h \
- stub/inc/mpxvideoplaybackviewfiledetails.h \
- stub/inc/mpxplaybackutilityimpl.h
-
-
-SOURCES += stub/src/hbvideobaseplaybackview.cpp \
- src/testmpxvideoviewwrapper.cpp \
- ../../viewsrc/mpxvideoviewwrapper.cpp \
- stub/src/mpxvideoplaybackdisplayhandler.cpp \
- stub/src/mpxvideoplaybackviewfiledetails.cpp \
- stub/src/mpxvideoplaybackcontrolscontroller.cpp \
- stub/src/mpxplaybackutility.cpp \
- stub/src/mpxplaybackutilityimpl.cpp \
- stub/src/mpxvideoplaybackuserinputhandler.cpp
-
-
\ No newline at end of file
+ mpxvideoplaybackuserinputhandler.h \
+ mpxvideoplaybackcontrolscontroller.h \
+ mpxvideoplaybackviewfiledetails.h \
+ mpxplaybackutilityimpl.h \
+ ../../viewinc/mpxvideoviewwrapper.h
+
+SOURCES += testmpxvideoviewwrapper.cpp \
+ stub/src/hbvideobaseplaybackview.cpp \
+ mpxvideoplaybackdisplayhandler.cpp \
+ mpxvideoplaybackviewfiledetails.cpp \
+ mpxvideoplaybackcontrolscontroller.cpp \
+ mpxplaybackutility.cpp \
+ mpxplaybackutilityimpl.cpp \
+ mpxvideoplaybackuserinputhandler.cpp \
+ ../../viewsrc/mpxvideoviewwrapper.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/inc/testprogressbar.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/inc/testprogressbar.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef __TESTPROGRESSBAR_H__
#define __TESTPROGRESSBAR_H__
@@ -49,17 +49,17 @@
// test functions for the test framework
private slots:
- void testMousePressEvent();
- void testMouseReleaseEvent();
- void testMouseMoveEvent();
- void testUpdateWithFileDetails();
- void testUpdateState();
- void testDurationChanged();
- void testPositionChanged();
-
+ void testHandleSliderPressed();
+ void testHandleSliderMoved();
+ void testHandleSliderReleased();
+ void testUpdateWithFileDetails();
+ void testUpdateState();
+ void testDurationChanged();
+ void testPositionChanged();
+ void testHandleSeekingTimeout();
signals:
- void commandSignal(int);
+ void commandSignal();
private:
QMPXVideoPlaybackProgressBar* mProgBar;
@@ -70,6 +70,3 @@
#endif // __TESTPROGRESSBAR_H__
// End of file
-
-
-
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,28 +15,27 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 3 %
#include <qdebug>
#include <hbmainwindow.h>
#include <hbapplication.h>
#include <qgraphicssceneevent>
-#include <hbprogressbar.h>
+#include <hbprogressslider.h>
#include "testprogressbar.h"
#include "mpxvideoplaybackviewfiledetails.h"
#include "mpxvideoplaybackcontrolscontroller.h"
-#include "hblabel.h"
#define private public
#include "mpxvideoplaybackprogressbar.h"
#undef private
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// main
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
int main(int argc, char *argv[])
{
@@ -50,7 +49,7 @@
char *pass[3];
pass[0] = argv[0];
pass[1] = "-o";
- pass[2] = "c:\\data\\TestProgressBar.txt";
+ pass[2] = "c:\\data\\testprogressbar.txt";
int res = QTest::qExec(&tv, 3, pass);
@@ -58,18 +57,18 @@
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// init
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::init()
{
MPX_ENTER_EXIT(_L("TestProgressBar::init()"));
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// setup
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::setup()
{
@@ -81,9 +80,9 @@
mProgBar->initialize();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// cleanup
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::cleanup()
{
@@ -102,149 +101,301 @@
}
}
-// ---------------------------------------------------------------------------
-// testMousePressEvent
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// testHandleSliderPressed
+// -------------------------------------------------------------------------------------------------
//
-void TestProgressBar::testMousePressEvent()
+void TestProgressBar::testHandleSliderPressed()
{
- MPX_ENTER_EXIT(_L("TestProgressBar::testMousePressEvent()"));
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderPressed()"));
+
+ setup();
- setup();
+ //
+ // If it is playing state
+ //
mController->mState = EPbStatePlaying;
- QGraphicsSceneMouseEvent* event = new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMousePress );
- event->setAccepted( false );
+
+ emit mProgBar->mProgressSlider->press();
+
+ QVERIFY( mController->mTimerAction == EMPXTimerCancel );
+ QVERIFY( mController->mCommand == EMPXPbvCmdCustomPause );
+ QVERIFY( mProgBar->mSliderDragging );
+ QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
- mProgBar->mousePressEvent(event);
-
- QVERIFY( mController->mTimerAction == EMPXTimerCancel );
- QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
- QVERIFY( event->isAccepted() );
-
- delete event;
- event = NULL;
+ //
+ // If it is pause state
+ //
+ mController->mState = EPbStatePaused;
+ mController->mCommand = EMPXPbvCmdStop;
+
+ emit mProgBar->mProgressSlider->press();
+
+ QVERIFY( mController->mTimerAction == EMPXTimerCancel );
+ QVERIFY( mController->mCommand == EMPXPbvCmdStop );
+ QVERIFY( mProgBar->mSliderDragging );
+ QVERIFY( mProgBar->mNeedToResumeAfterSetPosition );
+
+ cleanup();
}
-// ---------------------------------------------------------------------------
-// testMouseReleaseEvent
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// testHandleSliderReleased
+// -------------------------------------------------------------------------------------------------
//
-void TestProgressBar::testMouseReleaseEvent()
+void TestProgressBar::testHandleSliderReleased()
{
- MPX_ENTER_EXIT(_L("TestProgressBar::testMouseReleaseEvent()"));
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderReleased()"));
setup();
- QGraphicsSceneMouseEvent* event = new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseRelease );
- event->setAccepted( false );
-
- mProgBar->mouseReleaseEvent(event);
+
+ //
+ // Moved position >= duration
+ //
+ mProgBar->mDuration = 120;
+ mProgBar->mProgressSlider->mSliderValue = 130;
+ mController->mTimerAction = EMPXTimerCancel;
+ mController->mCommand = EMPXPbvCmdStop;
+
+ emit mProgBar->mProgressSlider->release();
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( ! mProgBar->mSliderDragging );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndOfClip );
+
+ //
+ // Moved position < 0
+ //
+ mProgBar->mProgressSlider->mSliderValue = -1;
+ mController->mTimerAction = EMPXTimerCancel;
+ mController->mCommand = EMPXPbvCmdStop;
+ mController->mValue = 100;
+
+ emit mProgBar->mProgressSlider->release();
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( ! mProgBar->mSliderDragging );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == 0 );
- QVERIFY( mController->mTimerAction == EMPXTimerReset );
- QVERIFY( event->isAccepted() );
-
- delete event;
- event = NULL;
+ //
+ // 0 <= moved position < duration
+ //
+ mProgBar->mProgressSlider->mSliderValue = 60;
+ mController->mTimerAction = EMPXTimerCancel;
+ mController->mCommand = EMPXPbvCmdStop;
+
+ emit mProgBar->mProgressSlider->release();
+ QVERIFY( mController->mTimerAction == EMPXTimerReset );
+ QVERIFY( ! mProgBar->mSliderDragging );
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == mProgBar->mProgressSlider->mSliderValue );
+
+ cleanup();
}
-// ---------------------------------------------------------------------------
-// testMouseMoveEvent
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// testHandleSliderMoved
+// -------------------------------------------------------------------------------------------------
//
-void TestProgressBar::testMouseMoveEvent()
+void TestProgressBar::testHandleSliderMoved()
{
- MPX_ENTER_EXIT(_L("TestProgressBar::testMouseMoveEvent()"));
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSliderMoved()"));
setup();
- QGraphicsSceneMouseEvent* event = new QGraphicsSceneMouseEvent( QEvent::GraphicsSceneMouseMove );
- event->setAccepted( false );
- mProgBar->mDuration = 0;
-
- mProgBar->mouseMoveEvent(event);
-
- QVERIFY( mProgBar->mPositionLabel->mTextSet );
- QVERIFY( event->isAccepted() );
-
- delete event;
- event = NULL;
+
+ //
+ // If user is dragging the slider
+ //
+ int movedPositoin = 5;
+ mProgBar->mDuration = 20;
+ mProgBar->mSliderDragging = true;
+ emit mProgBar->mProgressSlider->move( movedPositoin );
+
+ QVERIFY( mProgBar->mDraggingPosition == movedPositoin );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == movedPositoin );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == movedPositoin );
+
+ //
+ // If user isnot dragging the slider and movedPosition > mDuration
+ //
+ movedPositoin = 30;
+ mProgBar->mSliderDragging = false;
+
+ emit mProgBar->mProgressSlider->move( movedPositoin );
+
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == mProgBar->mDuration );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == mProgBar->mDuration );
+ QVERIFY( mController->mCommand == EMPXPbvCmdEndOfClip );
+
+ //
+ // If user isnot dragging the slider and movedPosition < mDuration
+ //
+ movedPositoin = 10;
+
+ emit mProgBar->mProgressSlider->move( movedPositoin );
+
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == movedPositoin );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == movedPositoin );
+
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == movedPositoin );
+
+ cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testUpdateWithFileDetails
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::testUpdateWithFileDetails()
{
MPX_ENTER_EXIT(_L("TestProgressBar::testUpdateWithFileDetails()"));
setup();
-
- // test for live
- mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
- mProgBar->updateWithFileDetails( mController->mFileDetails );
- QVERIFY( mProgBar->mDurationLabel->mLabelText == "Live" );
-
+
// test for tv-out
mController->mFileDetails->mPlaybackMode = EMPXVideoLocal;
mController->mFileDetails->mTvOutConnected = true;
mController->mFileDetails->mTvOutPlayAllowed = false;
mProgBar->updateWithFileDetails( mController->mFileDetails );
- QVERIFY( ! mProgBar->isEnabled() );
-
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ // live streaming
+ mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
+ mProgBar->updateWithFileDetails( mController->mFileDetails );
+ QVERIFY( ! mProgBar->mProgressSlider->isEnabled() );
+
+ // other cases
+ mController->mFileDetails->mPlaybackMode = EMPXVideoLocal;
+ mController->mFileDetails->mTvOutConnected = false;
+ mProgBar->updateWithFileDetails( mController->mFileDetails );
+ QVERIFY( mProgBar->mProgressSlider->isEnabled() );
+
+ cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testUpdateState
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::testUpdateState()
{
MPX_ENTER_EXIT(_L("TestProgressBar::testUpdateState()"));
setup();
-
+
// test for 1st block of cases
- mController->mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
- mController->mViewMode = EAudioOnlyView;
- mProgBar->updateState(EPbStatePlaying);
- QVERIFY( mProgBar->mDurationLabel->mLabelText == "Live" );
-
+ mProgBar->updateState( EPbStatePlaying );
+ QVERIFY( mProgBar->isEnabled() );
+
// test for 2nd block of cases
- mProgBar->updateState(EPbStateBuffering);
+ mProgBar->updateState( EPbStateBuffering );
QVERIFY( ! mProgBar->isEnabled() );
-
+
+ cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testDurationChanged
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::testDurationChanged()
{
MPX_ENTER_EXIT(_L("TestProgressBar::testDurationChanged()"));
setup();
-
- mProgBar->durationChanged( 120 );
-
- QVERIFY( mProgBar->mDuration == 120 );
- QVERIFY( mProgBar->mProgressSlider->maximum() == 120 );
-
+
+ int duration = 120;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "2:00" );
+
+ cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testPositionChanged
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestProgressBar::testPositionChanged()
{
MPX_ENTER_EXIT(_L("TestProgressBar::testPositionChanged()"));
setup();
- mProgBar->mDragging = false;
-
- mProgBar->positionChanged( 60 );
- QVERIFY( mProgBar->mPositionLabel->mTextSet );
-
+
+ //
+ // position < duration
+ //
+ int position = 60;
+ int duration = 120;
+ mProgBar->durationChanged( duration );
+
+ mProgBar->mSliderDragging = false;
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "1:00" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == position );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == position );
+
+ //
+ // position > duration
+ //
+ position = 130;
+
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "2:00" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == duration );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == duration );
+
+ //
+ // position < 0
+ //
+ position = -1;
+
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "0:00" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == 0 );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == 0 );
+
+ //
+ // duration >= 1 hour
+ //
+ duration = 3600;
+ mProgBar->durationChanged( duration );
+
+ position = 5;
+ mProgBar->positionChanged( position );
+
+ QVERIFY( mProgBar->mProgressSlider->minText() == "0:00:05" );
+ QVERIFY( mProgBar->mProgressSlider->sliderValue() == position );
+ QVERIFY( mProgBar->mProgressSlider->progressValue() == position );
+ cleanup();
+}
+
+// -------------------------------------------------------------------------------------------------
+// testHandleSeekingTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void TestProgressBar::testHandleSeekingTimeout()
+{
+ MPX_ENTER_EXIT(_L("TestProgressBar::testHandleSeekingTimeout()"));
+
+ setup();
+
+ mProgBar->mDraggingPosition = 10;
+ mProgBar->mDuration = 30;
+ mProgBar->mSetPosition = 0;
+
+ connect( this, SIGNAL( commandSignal() ), mProgBar, SLOT( handleSeekingTimeout() ) );
+ emit commandSignal();
+
+ QVERIFY( mController->mCommand == EMPXPbvCmdSetPosition );
+ QVERIFY( mController->mValue == mProgBar->mDraggingPosition );
+
+ cleanup();
}
// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/hblabel.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Stub Implementation of HbLabel
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef HBLABEL_H_
-#define HBLABEL_H_
-
-#include <hbwidget.h>
-
-
-class HbLabel : public HbWidget
-{
- Q_OBJECT
-
- public:
- HbLabel();
- virtual ~HbLabel();
-
- public:
- void setVisible( bool visible );
-
- bool isVisible();
-
- void setPlainText(const QString &text);
-
- public:
- bool mVisible;
- bool mTextSet;
- QString mLabelText;
-};
-
-#endif /*HBPUSHBUTTON_H*/
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/hbprogressslider.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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 HbProgressSlider
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBPROGRESSSLIDER_H_
+#define HBPROGRESSSLIDER_H_
+
+#include <hbwidget.h>
+#include <hbstyle.h>
+
+class QGraphicsItem;
+
+class HbProgressSlider : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbProgressSlider();
+ virtual ~HbProgressSlider();
+
+ public:
+ void setRange( int minimum, int maximum );
+
+ void setMaxText( const QString &text );
+ QString maxText();
+
+ void setMinText( const QString &text );
+ QString minText();
+
+ void setProgressValue( int value );
+ void setSliderValue( int value );
+
+ int sliderValue();
+ int progressValue();
+
+ int maximum();
+
+ public:
+ void press();
+ void release();
+ void move( int value );
+
+ signals:
+ void sliderPressed();
+ void sliderReleased();
+ void sliderMoved( int value );
+
+ public:
+ int mSliderValue;
+ int mProgressValue;
+ int mMax;
+ int mMin;
+
+ QString mMaxText;
+ QString mMinText;
+};
+
+#endif /*HBPROGRESSSLIDER_H_*/
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/inc/mpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -33,17 +33,8 @@
#include "mpxvideoplaybackviewfiledetails.h"
// FORWARD DECLARATIONS
-class QTimer;
-class QString;
-class HbAction;
-class QActionGroup;
-class QMPXVideoPlaybackControlPolicy;
-class QMPXVideoPlaybackControlsLayout;
class QMPXVideoPlaybackDocumentLoader;
-class QMPXVideoPlaybackFullScreenControl;
-class QMPXVideoPlaybackNonTouchVolumeBar;
class QMPXVideoPlaybackControlsController;
-class QMPXVideoPlaybackControlConfiguration;
// DATA TYPES
@@ -61,8 +52,6 @@
EAudioOnlyView
};
-const int KMPXControlsTimeOut = 4000;
-
// CLASS DECLARATION
@@ -83,11 +72,10 @@
virtual ~QMPXVideoPlaybackControlsController();
public:
-
/**
- * Handle event from container
+ * Initialize controller
*/
- void handleEvent( TMPXVideoPlaybackControlCommandIds event, int value = 0 );
+ void initializeController();
/**
* Command handling function.
@@ -95,16 +83,6 @@
*/
void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
- /*
- * Return ETrue if TV-out cable gets connected
- */
- inline bool isTvOutConnected();
-
- /*
- * Return ETrue if TV-out cable is connected and content can be played
- */
- inline bool isTvOutPlaybackAllowed();
-
/**
* Reset or cancel timers for the controls
*/
@@ -120,168 +98,18 @@
*/
inline QMPXVideoPlaybackViewFileDetails* fileDetails();
- //
- // Add the file details to the controls controller when available
- //
- void addFileDetails( QMPXVideoPlaybackViewFileDetails* details );
-
QMPXVideoPlaybackDocumentLoader* layoutLoader();
- inline bool isFlipView();
-
- void updateVideoRectDone();
-
- void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
TPlaybackViewMode viewMode();
public:
- /**
- * Initialize controller
- */
- void initializeController();
-
- /**
- * Create controls
- */
- void createControls();
-
- /**
- * Update controls
- */
- void handleStateChange( TMPXPlaybackState newState );
-
- /**
- * Update Control's visibility
- */
- void updateControlsVisibility();
-
- /**
- * Toggle visibility
- */
- void toggleVisibility();
-
- /**
- * Create/delete controls based on updated control list
- */
- void controlsListUpdated();
-
- /**
- * Show Controls and reset the timers
- */
- void showControls();
-
- /**
- * Return ETrue if any control is visible
- */
- bool isVisible();
-
- /**
- * Append a control based on control index
- */
- void appendControl( TMPXVideoPlaybackControls controlIndex );
-
- /**
- * Set changed volume
- */
- void volumeChanged( int volume );
-
- /**
- * Set changed duration
- */
- void durationChanged( int duration);
-
- /**
- * Set changed position
- */
- void positionChanged( int position );
-
- /**
- * Set changed position
- */
- void aspectRatioChanged( int aspectRatio );
-
- /*
- * Sets the download size on the progress bar
- */
- void setDownloadSize( int size );
-
- /*
- * Updates the download ratio on the progress bar
- */
- void updateDownloadPosition( int newSize );
-
- /**
- * Set changed state on button bar
- */
- void updateStateOnButtonBar();
-
- /**
- * Check whether this clip is real format or not
- */
- bool realFormat( QString filename );
-
- /**
- * Check whether this clip is real format or not for streaming/live streaming
- */
- bool realFormatForStreaming( const TDesC& des );
-
- /**
- * Check whether this clip is real format or not for local/progressive donwload
- */
- bool realFormatForLocal();
-
- /**
- * Handle errors
- */
- void handleErrors();
-
- /**
- * Return ETrue if control is visible
- */
- bool isSoftKeyVisible( int value );
-
- /**
- * Handle tvout connected/disconnected event
- */
- void handleTvOutEvent( bool connected,
- TMPXVideoPlaybackControlCommandIds event,
- int value );
-
- HbAction* createAction( QActionGroup *actionsGroup,
- int index,
- const char *slot,
- const QString& toolTip );
-
- void updateVideoRect( bool transitionEffect = true );
-
- void showVolumeControls();
-
- private slots:
- void hideAllControls();
- void skipToNextVideoItem();
- void skipToPreviousVideoItem();
- void handleTappedOnScreen();
-
- public:
QMPXVideoPlaybackViewFileDetails *mFileDetails;
-
- QList<QMPXVideoPlaybackFullScreenControl*> mControls;
-
- QMPXVideoPlaybackControlPolicy *mControlsPolicy;
- QMPXVideoPlaybackControlConfiguration *mControlsConfig;
-
- QTimer *mControlsTimer;
-
QMPXVideoPlaybackDocumentLoader *mLoader;
- QMPXVideoPlaybackNonTouchVolumeBar *mVolumeControl;
-
- bool mFlipViewOpened;
- bool mViewTransitionIsGoingOn;
TMPXPlaybackState mState;
TPlaybackViewMode mViewMode;
TMPXTimerAction mTimerAction;
-
+ TMPXVideoPlaybackViewCommandIds mCommand;
+ int mValue;
};
// INLINE METHODS
@@ -305,45 +133,6 @@
return mFileDetails;
}
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutConnected
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutConnected()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutConnected(%d)"),
- mFileDetails->mTvOutConnected);
-
- return mFileDetails->mTvOutConnected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed()
-{
- bool playable = ( ! mFileDetails->mTvOutConnected || mFileDetails->mTvOutPlayAllowed );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::isTvOutPlaybackAllowed() [%d]"),
- playable);
-
- return playable;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isFlipView
-// -------------------------------------------------------------------------------------------------
-//
-inline
-bool QMPXVideoPlaybackControlsController::isFlipView()
-{
- return mFlipViewOpened;
-}
-
-
#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/hblabel.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of HbLabel
-*
-*/
-
-// Version : %version: 1 %
-
-
-#include "hblabel.h"
-
-// -------------------------------------------------------------------------------------------------
-// HbPushButton::HbPushButton
-// -------------------------------------------------------------------------------------------------
-//
-HbLabel::HbLabel()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::~HbLabel
-// -------------------------------------------------------------------------------------------------
-//
-HbLabel::~HbLabel()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::setVisible
-// -------------------------------------------------------------------------------------------------
-//
-void HbLabel::setVisible( bool visible )
-{
- mVisible = visible;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::setPlainText
-// -------------------------------------------------------------------------------------------------
-//
-void HbLabel::setPlainText(const QString &text)
-{
- mTextSet = true;
- mLabelText = text;
-}
-
-// -------------------------------------------------------------------------------------------------
-// HbLabel::isVisible
-// -------------------------------------------------------------------------------------------------
-//
-bool HbLabel::isVisible()
-{
- return mVisible;
-}
-
-
-// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/hbprogressslider.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,187 @@
+/*
+* 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 HbProgressSlider
+*
+*/
+
+// Version : %version: 1 %
+
+#include <qgraphicswidget>
+
+#include "mpxvideo_debug.h"
+#include "hbprogressslider.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::HbProgressSlider
+// -------------------------------------------------------------------------------------------------
+//
+HbProgressSlider::HbProgressSlider()
+{
+ MPX_ENTER_EXIT(_L("HbProgressSlider::HbProgressSlider()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::~HbProgressSlider
+// -------------------------------------------------------------------------------------------------
+//
+HbProgressSlider::~HbProgressSlider()
+{
+ MPX_DEBUG(_L("HbProgressSlider::HbProgressSlider") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setRange
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setRange( int minimum, int maximum )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setRange"));
+
+ mMax = maximum;
+ mMin = minimum;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setMaxText
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setMaxText( const QString &text )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setMaxText") );
+
+ mMaxText = text;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::maxText
+// -------------------------------------------------------------------------------------------------
+//
+QString HbProgressSlider::maxText()
+{
+ MPX_DEBUG(_L("HbProgressSlider::maxText") );
+
+ return mMaxText;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setMinText
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setMinText( const QString &text )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setMinText") );
+
+ mMinText = text;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::minText
+// -------------------------------------------------------------------------------------------------
+//
+QString HbProgressSlider::minText()
+{
+ MPX_DEBUG(_L("HbProgressSlider::minText") );
+
+ return mMinText;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setProgressValue
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setProgressValue( int value )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setProgressValue") );
+
+ mProgressValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::setSliderValue
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::setSliderValue( int value )
+{
+ MPX_DEBUG(_L("HbProgressSlider::setSliderValue") );
+
+ mSliderValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::sliderValue
+// -------------------------------------------------------------------------------------------------
+//
+int HbProgressSlider::sliderValue()
+{
+ MPX_DEBUG(_L("HbProgressSlider::sliderValue") );
+
+ return mSliderValue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::progressValue
+// -------------------------------------------------------------------------------------------------
+//
+int HbProgressSlider::progressValue()
+{
+ MPX_DEBUG(_L("HbProgressSlider::progressValue") );
+
+ return mProgressValue;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::maximum
+// -------------------------------------------------------------------------------------------------
+//
+int HbProgressSlider::maximum()
+{
+ MPX_DEBUG(_L("HbProgressSlider::maximum") );
+
+ return mMax;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::press
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::press()
+{
+ MPX_DEBUG(_L("HbProgressSlider::press") );
+
+ emit sliderPressed();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::release
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::release()
+{
+ MPX_DEBUG(_L("HbProgressSlider::release") );
+
+ emit sliderReleased();
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbProgressSlider::move
+// -------------------------------------------------------------------------------------------------
+//
+void HbProgressSlider::move( int value )
+{
+ MPX_DEBUG(_L("HbProgressSlider::move") );
+
+ emit sliderMoved( value );
+}
+
+// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version:2 %
+// Version : %version:3 %
@@ -37,6 +37,8 @@
//
QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController()
{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::QMPXVideoPlaybackControlsController") );
+
initializeController();
}
@@ -46,21 +48,13 @@
//
void QMPXVideoPlaybackControlsController::initializeController()
{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::initializeController") );
+
mLoader = new QMPXVideoPlaybackDocumentLoader();
mFileDetails = new QMPXVideoPlaybackViewFileDetails();
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::addFileDetails()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::addFileDetails(
- QMPXVideoPlaybackViewFileDetails* details )
-{
- Q_UNUSED( details );
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::~QMPXVideoPlaybackControlsController
// -------------------------------------------------------------------------------------------------
//
@@ -82,108 +76,14 @@
}
// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleEvent(
- TMPXVideoPlaybackControlCommandIds event, int value )
-{
- switch ( event )
- {
- case EMPXControlCmdTvOutConnected:
- {
- handleTvOutEvent( true, event, value );
- break;
- }
- case EMPXControlCmdTvOutDisconnected:
- {
- handleTvOutEvent( false, event, value );
- break;
- }
- case EMPXControlCmdSetVolume:
- {
- mFileDetails->mAudioEnabled = false;
- break;
- }
- case EMPXControlCmdSetDuration:
- {
- mFileDetails->mDuration = value;
- break;
- }
- case EMPXControlCmdShowVolumeControls:
- {
- mFileDetails->mAudioEnabled = true;
- break;
- }
- case EMPXControlCmdSetPosition:
- {
- mFileDetails->mSeekable = true;
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleStateChange
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleStateChange( TMPXPlaybackState newState )
-{
- Q_UNUSED( newState );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::controlsListUpdated()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::controlsListUpdated()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::appendControl()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::appendControl( TMPXVideoPlaybackControls controlIndex )
-{
- Q_UNUSED( controlIndex );
-}
-
-// -------------------------------------------------------------------------------------------------
// QMPXVideoPlaybackControlsController::resetDisappearingTimers()
// -------------------------------------------------------------------------------------------------
//
void QMPXVideoPlaybackControlsController::resetDisappearingTimers( TMPXTimerAction timerAction )
{
- mTimerAction = timerAction;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::hideAllControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::hideAllControls()
-{
-
-}
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::resetDisappearingTimers") );
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isVisible()
-{
- return false;
+ mTimerAction = timerAction;
}
// -------------------------------------------------------------------------------------------------
@@ -193,192 +93,10 @@
void QMPXVideoPlaybackControlsController::handleCommand(
TMPXVideoPlaybackViewCommandIds command, int value )
{
- Q_UNUSED( command );
- Q_UNUSED( value );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::volumeChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::volumeChanged( int volume )
-{
- Q_UNUSED( volume );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::showVolumeControls()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::showVolumeControls()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::durationChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::durationChanged( int duration )
-{
- Q_UNUSED( duration );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::positionChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::positionChanged( int position )
-{
- Q_UNUSED( position );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::aspectRatioChanged()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::aspectRatioChanged( int aspectRatio )
-{
- Q_UNUSED( aspectRatio );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormat()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormat( QString filename )
-{
- Q_UNUSED( filename );
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForStreaming()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForStreaming( const TDesC& des )
-{
- Q_UNUSED( des );
- bool realFormat = false;
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::realFormatForLocal()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::realFormatForLocal()
-{
- bool realFormat = false;
-
- return realFormat;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::setDownloadSize()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::setDownloadSize( int size )
-{
- Q_UNUSED( size );
-}
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleCommand") );
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateDownloadPosition()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateDownloadPosition( int size )
-{
- Q_UNUSED( size );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleErrors
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleErrors()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::isSoftKeyVisible()
-// -------------------------------------------------------------------------------------------------
-//
-bool QMPXVideoPlaybackControlsController::isSoftKeyVisible( int /*value*/ )
-{
- return false;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTvOutEvent
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTvOutEvent(
- bool connected, TMPXVideoPlaybackControlCommandIds event, int value )
-{
- Q_UNUSED( event );
- Q_UNUSED( value );
- mFileDetails->mTvOutConnected = connected;
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRectDone
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRectDone()
-{
- mViewTransitionIsGoingOn = false;
-
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToPreviousVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToPreviousVideoItem()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::skipToNextVideoItem
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::skipToNextVideoItem()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::updateVideoRect()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::updateVideoRect( bool transitionEffect )
-{
- Q_UNUSED( transitionEffect );
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::handleTappedOnScreen()
-{
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackControlsController::changeViewMode
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackControlsController::changeViewMode(
- TPlaybackViewMode viewMode, bool transitionEffect )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::changeViewMode()"));
-
- Q_UNUSED( transitionEffect );
- mViewMode = viewMode;
+ mCommand = command;
+ mValue = value;
}
// -------------------------------------------------------------------------------------------------
@@ -386,7 +104,9 @@
// -------------------------------------------------------------------------------------------------
//
QMPXVideoPlaybackDocumentLoader* QMPXVideoPlaybackControlsController::layoutLoader()
-{
+{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::layoutLoader") );
+
return mLoader;
}
@@ -396,8 +116,9 @@
//
TPlaybackViewMode QMPXVideoPlaybackControlsController::viewMode()
{
+ MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::viewMode") );
+
return mViewMode;
}
-
// End of File
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/stub/src/mpxvideoplaybackdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,12 +15,12 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#include <hbwidget.h>
#include <hbtransparentwindow.h>
-#include <hbprogressbar.h>
+#include <hbprogressslider.h>
#include "mpxvideo_debug.h"
#include "mpxvideoplaybackdocumentloader.h"
@@ -84,29 +84,12 @@
QGraphicsWidget *object = NULL;
- if ( name == "transparentWindow" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating transparentWindow") );
-
- object = new HbTransparentWindow();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending to object list") );
- mWidgets.append( object );
- }
- else if ( name == "title" || name == "positionLabel" || name == "durationLabel" )
+ if ( name == "progressSlider" )
{
- object = new HbLabel();
- object->setObjectName( name );
- mWidgets.append( object );
- }
- else if ( name == "progressSlider" )
- {
- object = new HbProgressBar();
- object->setObjectName( name );
+ object = new HbProgressSlider();
+ object->setObjectName( name );
mWidgets.append( object );
}
-
return object;
}
--- a/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/testprogressbar.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testprogressbar/testprogressbar.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building testprogressbar
#
#
-# Version : %version: 1 %
+# Version : %version: 2 %
TEMPLATE = app
TARGET = testprogressbar
@@ -32,12 +32,12 @@
mpxvideoplaybackcontrolscontroller.h \
mpxvideoplaybackdocumentloader.h \
mpxvideoplaybackviewfiledetails.h \
- hblabel.h \
+ hbprogressslider.h \
../../controlinc/mpxvideoplaybackprogressbar.h
SOURCES += testprogressbar.cpp \
mpxvideoplaybackcontrolscontroller.cpp \
mpxvideoplaybackdocumentloader.cpp \
mpxvideoplaybackviewfiledetails.cpp \
- hblabel.cpp \
+ hbprogressslider.cpp \
../../controlsrc/mpxvideoplaybackprogressbar.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
#include <hbapplication.h>
@@ -186,7 +186,8 @@
mStatusPane->updateControlsWithFileDetails( mFileDetails );
- QVERIFY( mControlsController->view()->mTitleFlag == HbView::TitleBarTransparent );
+ QVERIFY( mControlsController->view()->viewFlags() ==
+ HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ));
// 2. test for detial view mode
mControlsController->mViewMode = EDetailsView;
@@ -195,7 +196,7 @@
mStatusPane->updateControlsWithFileDetails( mFileDetails );
- QVERIFY( mControlsController->view()->mTitleFlag == HbView::TitleBarFlagNone );
+ QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone );
// 3. test for audio only mode
mControlsController->mViewMode = EAudioOnlyView;
@@ -204,7 +205,7 @@
mStatusPane->updateControlsWithFileDetails( mFileDetails );
- QVERIFY( mControlsController->view()->mTitleFlag == HbView::TitleBarFlagNone );
+ QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone );
}
// ---------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/hbvideobaseplaybackview.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 5 %
@@ -48,17 +48,20 @@
virtual void handleClosePlaybackView();
- virtual void closePlaybackView();
-
void startClosingPlaybackView();
virtual void doClosePlayer();
- void setTitleBarFlags( HbTitleBarFlags flags );
+ void setViewFlags( HbView::HbViewFlags flags );
+ HbView::HbViewFlags viewFlags();
+
+ protected slots:
+
+ virtual void closePlaybackView();
public:
bool mViewActive;
- HbTitleBarFlags mTitleFlag;
+ HbView::HbViewFlags mFlag;
};
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/hbvideobaseplaybackview.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -102,9 +102,18 @@
// HbVideoBasePlaybackView::setTitleBarFlags()
// -------------------------------------------------------------------------------------------------
//
-void HbVideoBasePlaybackView::setTitleBarFlags( HbTitleBarFlags flags )
+void HbVideoBasePlaybackView::setViewFlags( HbView::HbViewFlags flags )
{
- mTitleFlag = flags;
+ mFlag = flags;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVideoBasePlaybackView::viewFlags()
+// -------------------------------------------------------------------------------------------------
+//
+HbView::HbViewFlags HbVideoBasePlaybackView::viewFlags()
+{
+ return mFlag;
}
// EOF
--- a/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackfullscreencontrol.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/src/mpxvideoplaybackfullscreencontrol.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -99,6 +99,7 @@
//
void QMPXVideoPlaybackFullScreenControl::updateState( TMPXPlaybackState state )
{
+ Q_UNUSED( state );
}
// -------------------------------------------------------------------------------------------------
@@ -108,7 +109,7 @@
void QMPXVideoPlaybackFullScreenControl::updateControlsWithFileDetails(
QMPXVideoPlaybackViewFileDetails* details )
{
-
+ Q_UNUSED( details );
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/testvideodisplayhandler.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideodisplayhandler/testvideodisplayhandler.pro Mon May 03 12:32:50 2010 +0300
@@ -14,16 +14,14 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 1 %
+# Version : %version: 2 %
TEMPLATE = app
TARGET = testvideodisplayhandler
CONFIG += qtestlib hb qt
DEFINES += BUILD_VIDEOPLAYBACK_DLL
-DEPENDPATH += . \
- inc \
- src
+DEPENDPATH += inc src stub/inc stub/src
INCLUDEPATH += ../../../inc \
../../../../inc \
@@ -33,23 +31,27 @@
LIBS += -lmpxplaybackutility.dll \
-lmpxcommon.dll \
-lestor.dll \
- -lsysutil.dll
+ -lsysutil.dll \
+ -lcone.dll \
+ -lefsrv.dll \
+ -lws32.dll \
+ -lgdi.dll
# Input
-HEADERS += stub/inc/mpxvideoviewwrapper.h \
- stub/inc/hbvideobaseplaybackview.h \
- stub/inc/mpxvideoplaybackviewfiledetails.h \
- stub/inc/mpxvideocontainer.h \
- stub/inc/alfcompositionutility.h \
- stub/inc/mediaclientvideodisplay.h \
- inc/testvideodisplayhandler.h \
+HEADERS += mpxvideoviewwrapper.h \
+ hbvideobaseplaybackview.h \
+ mpxvideoplaybackviewfiledetails.h \
+ mpxvideocontainer.h \
+ alfcompositionutility.h \
+ mediaclientvideodisplay.h \
+ testvideodisplayhandler.h \
../../viewinc/mpxvideoplaybackdisplayhandler.h
-SOURCES += stub/src/mpxvideoviewwrapper.cpp \
- stub/src/hbvideobaseplaybackview.cpp \
- stub/src/mpxvideoplaybackviewfiledetails.cpp \
- stub/src/mpxvideocontainer.cpp \
- stub/src/alfcompositionutility.cpp \
- stub/src/mediaclientvideodisplay.cpp \
- src/testvideodisplayhandler.cpp \
- ../../viewsrc/mpxvideoplaybackdisplayhandler.cpp
+SOURCES += mpxvideoviewwrapper.cpp \
+ hbvideobaseplaybackview.cpp \
+ mpxvideoplaybackviewfiledetails.cpp \
+ mpxvideocontainer.cpp \
+ alfcompositionutility.cpp \
+ mediaclientvideodisplay.cpp \
+ testvideodisplayhandler.cpp \
+ ../../viewsrc/mpxvideoplaybackdisplayhandler.cpp
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/inc/testmpxvideoplaybackcontrolscontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
#define __TESTMPXVIDEOPLAYBACKCONTROLSCONTROLLER_H__
@@ -95,6 +95,11 @@
void testUpdateVideoRectDone();
//
+ // test isAttachOperation()
+ //
+ void testIsAttachOperation();
+
+ //
// test private slot skipToNextVideoItem()
//
void testslot_skipToNextVideoItem();
@@ -104,6 +109,11 @@
//
void testslot_skipToPreviousVideoItem();
+ //
+ // test private slot attachVideo()
+ //
+ void testslot_attachVideo();
+
signals:
void commandSignal();
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/src/testmpxvideoplaybackcontrolscontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 4 %
#include <e32err.h>
#include <w32std.h>
@@ -35,9 +35,11 @@
#include "mpxvideoviewwrapper.h"
#include "mpxvideoplaybackfullscreencontrol.h"
#include "mpxvideoplaybackcontrolconfiguration.h"
-#include "mpxvideoplaybacknontouchvolumebar.h"
#include "thumbnailmanager_qt.h"
#include "mpxvideoplaybackdocumentloader.h"
+#include "hbvolumesliderpopup.h"
+#include "videoservices.h"
+#include "xqserviceutilxtra.h"
#define private public
#include "mpxvideoplaybackcontrolscontroller.h"
@@ -250,33 +252,9 @@
TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdStateChanged;
//
- // state change (EPbStateInitialised, streaming)
- //
- int value = EPbStateInitialised;
- mFileDetails->mPlaybackMode = EMPXVideoStreaming;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateInitialised, live-streaming)
- //
- value = EPbStateInitialised;
- mFileDetails->mPlaybackMode = EMPXVideoLiveStreaming;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
- // state change (EPbStateInitialised, non-streaming)
- //
- value = EPbStateInitialised;
- mFileDetails->mPlaybackMode = EMPXVideoLocal;
- mController->handleEvent( event, value );
- verifyHandleEventStateChangedResult( value );
-
- //
// state change (EPbStateInitialising)
//
- value = EPbStateInitialising;
+ int value = EPbStateInitialising;
mController->handleEvent( event, value );
verifyHandleEventStateChangedResult( value );
@@ -866,6 +844,66 @@
}
// -------------------------------------------------------------------------------------------------
+// TestMPXVideoPlaybackControlsController::testIsAttachOperation
+// -------------------------------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackControlsController::testIsAttachOperation()
+{
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsAttachOperation()") );
+
+ //
+ // get access to XQServiceUtilXtra stub
+ //
+ XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
+
+ //
+ // set service enable
+ //
+ extraUtil->setCurrentService( true );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // verify 'mIsAttachOperation' flag is enabled
+ //
+ QVERIFY( mController->mIsAttachOperation == true );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // set service disable
+ //
+ extraUtil->setCurrentService( false );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // verify 'mIsAttachOperation' flag is disabled
+ //
+ QVERIFY( mController->mIsAttachOperation == false );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // dereference extraUtil count
+ //
+ extraUtil->decreaseReferenceCount();
+
+}
+
+// -------------------------------------------------------------------------------------------------
// TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem
// -------------------------------------------------------------------------------------------------
//
@@ -907,6 +945,67 @@
cleanup();
}
+// -------------------------------------------------------------------------------------------------
+// TestMPXVideoPlaybackControlsController::testslot_attachVideo
+// -------------------------------------------------------------------------------------------------
+//
+void TestMPXVideoPlaybackControlsController::testslot_attachVideo()
+{
+ MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_attachVideo()") );
+
+ //
+ // get access to XQServiceUtilXtra stub to enable XQServiceUtil::isService() method
+ //
+ XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
+
+ //
+ // set service enable
+ //
+ extraUtil->setCurrentService( true );
+
+ //
+ // initialize controlscontroller
+ //
+ init();
+
+ //
+ // connect signal with controller attachVideo() slot
+ //
+ bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // emit signal, this will in turns invoke videoservices itemSelected() slot
+ //
+ emit commandSignal();
+
+ //
+ // verify command EMPXPbvCmdClose has been issued
+ //
+ QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdClose );
+
+ //
+ // verify videoservices itemSelected() slot is called
+ //
+ QVERIFY( mController->mVideoServices->mItemSelected == true );
+
+ //
+ // disconnect signal
+ //
+ disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
+
+ //
+ // clean up
+ //
+ cleanup();
+
+ //
+ // dereference extraUtil count
+ //
+ extraUtil->decreaseReferenceCount();
+
+}
+
+
// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/hbvolumesliderpopup.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 HbVolumeSliderPopup
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#ifndef HBVOLUMESLIDERPOPUP_H
+#define HBVOLUMESLIDERPOPUP_H
+
+#include <hbwidget.h>
+
+
+class HbVolumeSliderPopup : public HbWidget
+{
+ Q_OBJECT
+
+ public:
+ HbVolumeSliderPopup();
+ virtual ~HbVolumeSliderPopup();
+
+ public:
+ void setEnabled( bool enabled );
+ void setVisible( bool visible );
+ bool isEnabled();
+ bool isVisible();
+ void setValue( int value );
+ void setTimeout( int timeout );
+ void setTickPosition( Hb::SliderTickPositions position );
+ void setRange( int min, int max );
+
+ public:
+ bool mVisible;
+ bool mEnabled;
+ int mValue;
+ int mTimeOut;
+ int mMin;
+ int mMax;
+ Hb::SliderTickPositions mPosition;
+};
+
+#endif /*HBVOLUMESLIDERPOPUP_H*/
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrolconfiguration.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybackcontrolconfiguration.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -64,12 +64,13 @@
void updateControlsWithFileDetails();
- private:
/**
* Create control list
*/
void createControlList();
+ private:
+
/**
* Delete controls from list
*/
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/mpxvideoplaybacknontouchvolumebar.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of QMPXVideoPlaybackNonTouchVolumeBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#ifndef MPXVIDEOPLAYBACKNONTOUCHVOLUMEBAR_H_
-#define MPXVIDEOPLAYBACKNONTOUCHVOLUMEBAR_H_
-
-
-#include <hbvolumeslider.h>
-
-class QTimer;
-class QGraphicsSceneMouseEvent;
-
-class QMPXVideoPlaybackNonTouchVolumeBar : public HbVolumeSlider
-{
- Q_OBJECT
-
- public:
- QMPXVideoPlaybackNonTouchVolumeBar(
- bool currentValueVisible = false, QGraphicsItem *parent = 0 );
-
- virtual ~QMPXVideoPlaybackNonTouchVolumeBar();
-
- public:
- void setVisible( bool visible );
-
- void setValue( int value );
-
- public:
-
- bool mVisible;
- int mValue;
-
-};
-
-#endif /*MPXVIDEOPLAYBACKNONTOUCHVOLUMEBAR_H_*/
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/videoservices.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* 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: VideoServices STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICES_H__
+#define __VIDEOSERVICES_H__
+
+#include <QStringList>
+
+#include "videoserviceurifetch.h"
+
+class VideoServiceUriFetch;
+
+class VideoServices : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ enum TVideoService
+ {
+ ENoService,
+ EUriFetcher,
+ EPlayback,
+ EView
+ };
+
+ static VideoServices *instance();
+ void decreaseReferenceCount();
+ QString contextTitle() { return QString(""); }
+ VideoServices::TVideoService currentService();
+
+ public slots:
+
+ void itemSelected( const QString& item );
+
+ private:
+
+ VideoServices();
+ virtual ~VideoServices();
+ void setCurrentService( VideoServices::TVideoService service );
+
+ Q_DISABLE_COPY( VideoServices )
+
+ private:
+
+ static VideoServices* mInstance;
+ VideoServiceUriFetch* mServiceUriFetch;
+ VideoServices::TVideoService mCurrentService;
+
+ private:
+
+ friend class VideoServiceUriFetch;
+
+ public:
+
+ static int mReferenceCount;
+ bool mItemSelected;
+
+};
+
+#endif //__VIDEOSERVICES_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/videoserviceurifetch.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VideoServiceUriFetch STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICESURIFETCH_H__
+#define __VIDEOSERVICESURIFETCH_H__
+
+#include <qobject>
+
+class VideoServices;
+
+class VideoServiceUriFetch : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ VideoServiceUriFetch( VideoServices *parent = 0 );
+ ~VideoServiceUriFetch();
+
+};
+
+#endif //__VIDEOSERVICESURIFETCH_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/xqserviceutil.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,33 @@
+/**
+* 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: XQServiceUtil STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef XQSERVICEUTIL_H
+#define XQSERVICEUTIL_H
+
+#include <QObject>
+
+namespace XQServiceUtil
+{
+ static void toBackground( bool value );
+ static bool isEmbedded();
+ static bool isService();
+}
+
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/inc/xqserviceutilxtra.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,50 @@
+/**
+* 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: XQServiceUtilXtra STUB class definition
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef XQSERVICEUTILXTRA_H_
+#define XQSERVICEUTILXTRA_H_
+
+#include <QObject>
+
+class XQServiceUtilXtra : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ static XQServiceUtilXtra *instance();
+ void decreaseReferenceCount();
+ bool currentService();
+ void setCurrentService( bool service );
+
+ private:
+
+ XQServiceUtilXtra();
+ static XQServiceUtilXtra* mInstance;
+ virtual ~XQServiceUtilXtra();
+
+ Q_DISABLE_COPY( XQServiceUtilXtra )
+
+ public:
+
+ static int mReferenceCount;
+ static bool service;
+
+};
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/hbvolumesliderpopup.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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 HbVolumeSliderPopup
+*
+*/
+
+// Version : %version: 2 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "hbvolumesliderpopup.h"
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::HbVolumeSliderPopup
+// -------------------------------------------------------------------------------------------------
+//
+HbVolumeSliderPopup::HbVolumeSliderPopup()
+{
+ MPX_ENTER_EXIT(_L("HbVolumeSliderPopup::HbVolumeSliderPopup()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::~HbVolumeSliderPopup
+// -------------------------------------------------------------------------------------------------
+//
+HbVolumeSliderPopup::~HbVolumeSliderPopup()
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::HbVolumeSliderPopup") );
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setEnabled
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setEnabled( bool enabled )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setEnabled %d"), enabled );
+
+ mEnabled = enabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::isEnabled
+// -------------------------------------------------------------------------------------------------
+//
+bool HbVolumeSliderPopup::isEnabled()
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::isEnabled %d"), mEnabled );
+
+ return mEnabled;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setVisible
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setVisible( bool visible )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setVisible %d"), visible );
+
+ mVisible = visible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::isVisible
+// -------------------------------------------------------------------------------------------------
+//
+bool HbVolumeSliderPopup::isVisible()
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::isVisible %d"), mVisible );
+
+ return mVisible;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setValue
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setValue( int value )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setValue %d"), value );
+
+ mValue = value;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setTimeout
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setTimeout( int timeout )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setTimeout %d"), timeout );
+
+ mTimeOut = timeout;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setTickPosition
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setTickPosition( Hb::SliderTickPositions position )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setTickPosition"));
+
+ mPosition = position;
+}
+
+// -------------------------------------------------------------------------------------------------
+// HbVolumeSliderPopup::setRange
+// -------------------------------------------------------------------------------------------------
+//
+void HbVolumeSliderPopup::setRange( int min, int max )
+{
+ MPX_DEBUG(_L("HbVolumeSliderPopup::setRange"));
+
+ mMin = min;
+ mMax = max;
+}
+
+// End of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybackdocumentloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -30,7 +30,6 @@
#include "mpxvideoplaybackcontrolbar.h"
#include "mpxvideoplaybackfiledetailswidget.h"
-#include "mpxvideoplaybacknontouchvolumebar.h"
#include "mpxvideoplaybackcontrolconfiguration.h"
#include "mpxvideoplaybackdetailsplaybackwindow.h"
@@ -149,16 +148,6 @@
MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[fileDetailsLayout] to object list") );
mWidgets.append( object );
}
- else if ( name == "volumeSlider" )
- {
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating volumeSlider") );
-
- object = new QMPXVideoPlaybackNonTouchVolumeBar();
- object->setObjectName( name );
-
- MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::appending[volumeSlider] to object list") );
- mWidgets.append( object );
- }
else if ( name == "detailsPlaybackWindow" )
{
MPX_DEBUG(_L("QMPXVideoPlaybackDocumentLoader::creating detailsPlaybackWindow") );
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/mpxvideoplaybacknontouchvolumebar.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of QMPXVideoPlaybackNonTouchVolumeBar
-*
-*/
-
-// Version : %version: 1 %
-
-
-
-#include <qtimer>
-#include <qgraphicsscenemouseevent>
-
-#include "mpxvideo_debug.h"
-#include "mpxvideoplaybackcontrolscontroller.h"
-#include "mpxvideoplaybacknontouchvolumebar.h"
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar(
- bool currentValueVisible,QGraphicsItem *parent )
- : HbVolumeSlider( currentValueVisible, parent )
-{
- MPX_ENTER_EXIT(_L("QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar()"));
-
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::~QMPXVideoPlaybackNonTouchVolumeBar()
-// -------------------------------------------------------------------------------------------------
-//
-QMPXVideoPlaybackNonTouchVolumeBar::~QMPXVideoPlaybackNonTouchVolumeBar()
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackNonTouchVolumeBar::QMPXVideoPlaybackNonTouchVolumeBar"));
-}
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::setVisible()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackNonTouchVolumeBar::setVisible( bool visible )
-{
- MPX_DEBUG(_L("QMPXVideoPlaybackNonTouchVolumeBar::setVisible"));
-
- mVisible = visible;
-
- QGraphicsItem::setVisible( visible );
-}
-
-
-// -------------------------------------------------------------------------------------------------
-// QMPXVideoPlaybackNonTouchVolumeBar::setValue()
-// -------------------------------------------------------------------------------------------------
-//
-void QMPXVideoPlaybackNonTouchVolumeBar::setValue( int value )
-{
- mValue = value;
-}
-
-// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/videoservices.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of VideoServices STUB
+*
+*/
+
+// Version : %version: 1 %
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "mpxvideo_debug.h"
+
+
+VideoServices *VideoServices::mInstance = 0;
+int VideoServices::mReferenceCount = 0;
+
+// -----------------------------------------------------------------------------
+// VideoServices::instance()
+// -----------------------------------------------------------------------------
+//
+VideoServices* VideoServices::instance()
+{
+ MPX_DEBUG(_L("VideoServices::instance()"));
+
+ if ( !mInstance )
+ {
+ mInstance = new VideoServices();
+ }
+
+ mInstance->mReferenceCount++;
+
+ return mInstance;
+}
+
+// -----------------------------------------------------------------------------
+// VideoServices::decreaseReferenceCount()
+// -----------------------------------------------------------------------------
+//
+void VideoServices::decreaseReferenceCount()
+{
+ MPX_DEBUG(_L("VideoServices::decreaseReferenceCount()"));
+
+ if ( mInstance )
+ {
+ if ( --mInstance->mReferenceCount == 0 )
+ {
+ delete mInstance;
+ mInstance = NULL;
+ }
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+// VideoServices()
+// ----------------------------------------------------------------------------
+//
+VideoServices::VideoServices()
+ : mCurrentService( VideoServices::ENoService )
+ , mItemSelected( false )
+{
+ MPX_DEBUG(_L("VideoServices::VideoServices()"));
+
+ mServiceUriFetch = new VideoServiceUriFetch( this );
+}
+
+// ----------------------------------------------------------------------------
+// ~VideoServices()
+// ----------------------------------------------------------------------------
+//
+VideoServices::~VideoServices()
+{
+ MPX_DEBUG(_L("VideoServices::~VideoServices()"));
+
+ delete mServiceUriFetch;
+}
+
+
+// ----------------------------------------------------------------------------
+// currentService()
+// ----------------------------------------------------------------------------
+//
+VideoServices::TVideoService VideoServices::currentService()
+{
+ MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService);
+
+ return mCurrentService;
+}
+
+
+// ----------------------------------------------------------------------------
+// setCurrentService()
+// ----------------------------------------------------------------------------
+//
+void VideoServices::setCurrentService( VideoServices::TVideoService service )
+{
+ MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service);
+
+ mCurrentService = service;
+}
+
+// ----------------------------------------------------------------------------
+// itemSelected()
+// ----------------------------------------------------------------------------
+//
+void VideoServices::itemSelected( const QString& item )
+{
+ MPX_DEBUG(_L("VideoServices::itemSelected()") );
+
+ Q_UNUSED( item );
+
+ mItemSelected = true;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/videoserviceurifetch.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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 VideoServiceUriFetch STUB
+*
+*/
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "mpxvideo_debug.h"
+
+
+// ----------------------------------------------------------------------------
+// VideoServiceUriFetch()
+// ----------------------------------------------------------------------------
+//
+VideoServiceUriFetch::VideoServiceUriFetch( VideoServices* parent )
+{
+ MPX_DEBUG(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
+
+ if ( parent )
+ {
+ parent->setCurrentService( VideoServices::EUriFetcher );
+ }
+}
+
+// ----------------------------------------------------------------------------
+// ~VideoServiceUriFetch()
+// ----------------------------------------------------------------------------
+//
+VideoServiceUriFetch::~VideoServiceUriFetch()
+{
+ MPX_DEBUG(_L("VideoServiceUriFetch::~VideoServiceUriFetch()"));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/xqserviceutil.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ?Description
+*
+*/
+
+#include "xqserviceutil.h"
+#include "xqserviceutilxtra.h"
+#include "mpxvideo_debug.h"
+
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::toBackground()
+// ----------------------------------------------------------------------------
+//
+void XQServiceUtil::toBackground( bool value )
+{
+ MPX_DEBUG(_L("XQServiceUtil::toBackground( %d )"), value );
+}
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::isEmbedded()
+// ----------------------------------------------------------------------------
+//
+bool XQServiceUtil::isEmbedded()
+{
+ MPX_DEBUG(_L("XQServiceUtil::isEmbedded()"));
+
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// XQServiceUtil::isService()
+// ----------------------------------------------------------------------------
+//
+bool XQServiceUtil::isService()
+{
+ bool service;
+ XQServiceUtilXtra* ptr = XQServiceUtilXtra::instance();
+ service = ptr->currentService();
+ ptr->decreaseReferenceCount();
+
+ MPX_DEBUG(_L("XQServiceUtil::isEmbedded() ret %d"), service);
+ return service;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/stub/src/xqserviceutilxtra.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,102 @@
+/**
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "xqserviceutilxtra.h"
+#include "mpxvideo_debug.h"
+
+XQServiceUtilXtra* XQServiceUtilXtra::mInstance = 0;
+int XQServiceUtilXtra::mReferenceCount = 0;
+bool XQServiceUtilXtra::service = false;
+
+// -----------------------------------------------------------------------------
+// XQServiceUtilXtra::instance()
+// -----------------------------------------------------------------------------
+//
+XQServiceUtilXtra* XQServiceUtilXtra::instance()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::instance()"));
+
+ if ( !mInstance )
+ {
+ mInstance = new XQServiceUtilXtra();
+ }
+ mInstance->mReferenceCount++;
+
+ return mInstance;
+}
+
+// -----------------------------------------------------------------------------
+// XQServiceUtilXtra::decreaseReferenceCount()
+// -----------------------------------------------------------------------------
+//
+void XQServiceUtilXtra::decreaseReferenceCount()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::decreaseReferenceCount()"));
+
+ if ( mInstance )
+ {
+ if (--mInstance->mReferenceCount == 0 )
+ {
+ delete mInstance;
+ mInstance = NULL;
+ }
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+// XQServiceUtilXtra()
+// ----------------------------------------------------------------------------
+//
+XQServiceUtilXtra::XQServiceUtilXtra()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::XQServiceUtilXtra()"));
+}
+
+// ----------------------------------------------------------------------------
+// ~XQServiceUtilXtra()
+// ----------------------------------------------------------------------------
+//
+XQServiceUtilXtra::~XQServiceUtilXtra()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::~XQServiceUtilXtra()"));
+}
+
+
+// ----------------------------------------------------------------------------
+// currentService()
+// ----------------------------------------------------------------------------
+//
+bool XQServiceUtilXtra::currentService()
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::currentService() ret %d"), mInstance->service);
+
+ return mInstance->service;
+}
+
+
+// ----------------------------------------------------------------------------
+// setCurrentService()
+// ----------------------------------------------------------------------------
+//
+void XQServiceUtilXtra::setCurrentService( bool service )
+{
+ MPX_DEBUG(_L("XQServiceUtilXtra::setCurrentService( %d )"), service);
+
+ mInstance->service = service;
+}
+
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/testmpxvideoplaybackcontrolscontroller.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackcontrolscontroller/testmpxvideoplaybackcontrolscontroller.pro Mon May 03 12:32:50 2010 +0300
@@ -14,16 +14,15 @@
# Description: Project file for building testmpxvideoplaybackcontrolscontroller
#
#
-# Version : %version: 2 %
+# Version : %version: 5 %
TEMPLATE = app
TARGET = testmpxvideoplaybackcontrolscontroller
CONFIG += qtestlib hb qt
-DEPENDPATH += . \
- inc \
- src
+LIBS += -lxqserviceutil.dll \
+ -lefsrv.dll
INCLUDEPATH += stub/inc \
../inc \
@@ -42,12 +41,16 @@
mpxvideoplaybackdocumentloader.h \
mpxvideoplaybackfiledetailswidget.h \
mpxvideoplaybackfullscreencontrol.h \
- mpxvideoplaybacknontouchvolumebar.h \
mpxvideoplaybackstatuspanecontrol.h \
mpxvideoplaybackviewfiledetails.h \
mpxvideoviewwrapper.h \
thumbnailmanager_qt.h \
testmpxvideoplaybackcontrolscontroller.h \
+ hbvolumesliderpopup.h \
+ xqserviceutilxtra.h \
+ xqserviceutil.h \
+ videoservices.h \
+ videoserviceurifetch.h \
../../inc/mpxvideoplaybackcontrolscontroller.h
@@ -59,12 +62,16 @@
mpxvideoplaybackdocumentloader.cpp \
mpxvideoplaybackfiledetailswidget.cpp \
mpxvideoplaybackfullscreencontrol.cpp \
- mpxvideoplaybacknontouchvolumebar.cpp \
mpxvideoplaybackstatuspanecontrol.cpp \
mpxvideoplaybackviewfiledetails.cpp \
mpxvideoviewwrapper.cpp \
thumbnailmanager_qt.cpp \
testmpxvideoplaybackcontrolscontroller.cpp \
+ hbvolumesliderpopup.cpp \
+ xqserviceutilxtra.cpp \
+ xqserviceutil.cpp \
+ videoservices.cpp \
+ videoserviceurifetch.cpp \
../../controlsrc/mpxvideoplaybackcontrolscontroller.cpp
\ No newline at end of file
--- a/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/testvideoplaybackview.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/testvideoplaybackview.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 6 %
+# Version : %version: 7 %
TEMPLATE = app
TARGET = testvideoplaybackview
@@ -31,24 +31,9 @@
../../controlinc \
$$MW_LAYER_SYSTEMINCLUDE
-LIBS += -lmpxplaybackutility.dll \
- -lmpxcommon.dll \
- -lmpxviewplugin.dll \
- -lcone.dll \
- -lws32.dll \
- -lestor.dll \
- -leuser.dll \
+LIBS += -lcone.dll \
-lcommonengine.dll \
- -lavkon.dll \
- -lefsrv.dll \
- -lflogger.dll \
- -lsysutil.dll \
- -lmpxcollectionutility.dll \
- -lremconcoreapi.dll \
- -lremconInterfacebase.dll \
- -lhal.dll \
- -lcentralrepository.dll
-
+ -lflogger.dll
# Input
HEADERS += stub/inc/mpxvideoviewwrapper.h \
@@ -56,12 +41,9 @@
../../../inc/hbvideobaseplaybackview.h \
../../../inc/hbvideoplaybackview.h \
../../inc/mpxvideoplaybackviewfiledetails.h
-
-
-
-
+
SOURCES += stub/src/mpxvideoviewwrapper.cpp \
- src/testvideoplaybackview.cpp \
- ../../viewsrc/hbvideobaseplaybackview.cpp \
- ../../viewsrc/hbvideoplaybackview.cpp \
- ../../viewsrc/mpxvideoplaybackviewfiledetails.cpp
\ No newline at end of file
+ src/testvideoplaybackview.cpp \
+ ../../viewsrc/hbvideobaseplaybackview.cpp \
+ ../../viewsrc/hbvideoplaybackview.cpp \
+ ../../viewsrc/mpxvideoplaybackviewfiledetails.cpp
--- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#32 %
+// Version : %version: da1mmcf#34 %
@@ -122,7 +122,7 @@
menu()->close();
- hideItems( Hb::AllItems );
+ hideItems( Hb::ToolBarItem );
//
// Landscape orientation
@@ -159,7 +159,7 @@
//
//hbInstance->allMainWindows()[0]->unsetOrientation();
- showItems( Hb::AllItems );
+ showItems( Hb::ToolBarItem );
}
// -------------------------------------------------------------------------------------------------
@@ -171,7 +171,7 @@
MPX_DEBUG(
_L("HbVideoBasePlaybackView::handleClosePlaybackView()") );
- if ( mVideoMpxWrapper->IsMultiItemPlaylist() )
+ if ( mVideoMpxWrapper && mVideoMpxWrapper->IsMultiItemPlaylist() )
{
TRAP_IGNORE( mVideoMpxWrapper->HandleCommandL( EMPXPbvCmdNextListItem ) );
}
@@ -201,26 +201,22 @@
case KErrCANoRights:
case KErrCANoPermission:
{
- const QString qString = "License has expired or it is missing";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_license_has_expired_or_it_is_missi" ) );
break;
}
case KMPXVideoCallOngoingError:
{
- const QString qString = "Video playback is not allowed during video call";
- showDialog( qString, false );
+ showDialog( hbTrId( "txt_videos_info_video_playback_is_not_allowed_duri" ), false );
break;
}
case KMPXVideoTvOutPlaybackNotAllowed:
{
- const QString qString = "Protected clip, can not be played through TV-Out";
- showDialog( qString, false );
+ showDialog( hbTrId( "txt_videos_info_protected_clip_can_not_be_played" ), false );
break;
}
case KMPXVideoTvOutPlaybackNotAllowedClose:
{
- const QString qString = "Protected clip, can not be played through TV-Out";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_protected_clip_can_not_be_played" ) );
break;
}
default:
--- a/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewsrc/hbvideoplaybackview.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#9 %
+// Version : %version: da1mmcf#10 %
@@ -115,8 +115,7 @@
case KErrCorrupt:
case KErrTooBig:
{
- const QString qString = "Invalid Clip. Operation canceled";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_invalid_clip_operation_canceled" ) );
break;
}
@@ -124,8 +123,7 @@
case KErrMMInvalidURL:
case KErrArgument:
{
- const QString qString = "Unable to connect: Invalid URL";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_invalid_url" ) );
break;
}
@@ -133,8 +131,7 @@
{
if ( ! mVideoMpxWrapper->IsLive() )
{
- const QString qString = "Resource Lost";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_resource_lost" ) );
}
else
{
@@ -144,20 +141,17 @@
}
case KErrTimedOut:
{
- const QString qString = "Unable to connect: Connection timeout";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_connection_time" ) );
break;
}
case KErrNotFound:
{
- const QString qString = "Unable to connect: File not found";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_file_not_found" ) );
break;
}
case KErrMMNotEnoughBandwidth:
{
- const QString qString = "Unable to connect: Not enough bandwidth";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect_not_enough_band" ) );
break;
}
case KErrDisconnected:
@@ -165,14 +159,12 @@
case KErrCouldNotConnect:
case KErrAbort:
{
- const QString qString = "Unable to connect";
- showDialog( qString );
+ showDialog( hbTrId( "txt_videos_info_unable_to_connect" ) );
break;
}
case KMPXVideoPlayOver2GDuringVoiceCallError:
{
- const QString qString = "Video play not allowed during voice call over 2G network";
- showDialog( qString, false );
+ showDialog( hbTrId( "txt_videos_info_video_play_not_allowed_during_voic" ), false );
break;
}
default:
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoplaybackdisplayhandler.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 18 %
+// Version : %version: 19 %
#include <sysutil.h>
#include <s32file.h>
@@ -172,6 +172,8 @@
delete iVideoContainer;
iVideoContainer = NULL;
}
+
+ iSurfaceId = TSurfaceId::CreateNullId();
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#24 %
+// Version : %version: da1mmcf#27 %
@@ -129,7 +129,6 @@
//
if ( iDisplayHandler )
{
- iDisplayHandler->RemoveDisplayWindow();
delete iDisplayHandler;
iDisplayHandler = NULL;
}
@@ -237,17 +236,6 @@
{
MPX_DEBUG(_L("CMPXVideoViewWrapper::HandleCommandL() EMPXPbvCmdClose"));
- //
- // The display window must be removed before closing the playback plugin
- //
- if ( iDisplayHandler )
- {
- //
- // Remove the display window so the surface can be released
- //
- iDisplayHandler->RemoveDisplayWindow();
- }
-
CreateGeneralPlaybackCommandL( EPbCmdClose );
break;
}
@@ -473,17 +461,12 @@
{
HandleVideoPlaybackMessage( aMessage );
}
- else if ( KMPXMediaIdVideoDisplaySyncMessage == id )
+ else if ( KMPXMediaIdVideoDisplayMessage == id )
{
if ( iDisplayHandler )
{
iDisplayHandler->HandleVideoDisplayMessageL( aMessage );
}
-
- //
- // Signal Sync Message handling is complete
- //
- iPlaybackUtility->CommandL( EPbCmdSyncMsgComplete );
}
}
@@ -656,11 +639,6 @@
}
case EPbStateStopped:
{
- if ( iPlaylistView && iDisplayHandler )
- {
- iDisplayHandler->RemoveDisplayWindow();
- }
-
if ( iFileDetails->mMultiItemPlaylist )
{
iView->handleStoppedState();
@@ -929,6 +907,23 @@
const QString qKeywords( (QChar*)keywords.Ptr(), keywords.Length() );
iFileDetails->mKeywords = qKeywords;
}
+
+ //
+ // Creation date/time
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoCreated ) )
+ {
+ iFileDetails->mCreationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoCreated );
+ }
+
+ //
+ // Last Modified date/time
+ //
+ if ( aMedia.IsSupported( KMPXMediaVideoLastModified ) )
+ {
+ iFileDetails->mModificationTime = aMedia.ValueTObjectL<TInt>( KMPXMediaVideoLastModified );
+ }
+
}
// -------------------------------------------------------------------------------------------------
@@ -1283,7 +1278,24 @@
//
iControlsController->handleEvent( EMPXControlCmdShowVolumeControls );
- iPlaybackUtility->CommandL( aCmd );
+ switch( aCmd )
+ {
+ case EPbCmdDecreaseVolume:
+ {
+ CreateVideoSpecificCmdL( EPbCmdHandleDecreaseVolume );
+ break;
+ }
+ case EPbCmdIncreaseVolume:
+ {
+ CreateVideoSpecificCmdL( EPbCmdHandleIncreaseVolume );
+ break;
+ }
+ default:
+ {
+ iPlaybackUtility->CommandL( aCmd );
+ break;
+ }
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -1417,11 +1429,11 @@
if ( iFileDetails )
{
- MPX_DEBUG(_L("CMPXVideoViewWrapper::IsMultiItemPlaylist(%d)"),
- iFileDetails->mMultiItemPlaylist );
multiLinks = iFileDetails->mMultiItemPlaylist;
}
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::IsMultiItemPlaylist() ret %d"), multiLinks );
+
return multiLinks;
}
--- a/videoplayback/hbvideoplaybackviewplugin/hbvideoplaybackviewplugin.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackviewplugin/hbvideoplaybackviewplugin.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#15 %
+# Version : %version: da1mmcf#16 %
TEMPLATE = lib
@@ -23,7 +23,7 @@
symbian:
{
- TARGET.CAPABILITY = CAP_GENERAL_DLL
+ TARGET.CAPABILITY = ALL -TCB -DRM
TARGET.EPOCALLOWDLLDATA = 1
TARGET.UID3 = 0x20024335
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
--- a/videoplayback/hbvideoplaybackviewplugin/src/mpxhbvideoplaybackviewplugin.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/hbvideoplaybackviewplugin/src/mpxhbvideoplaybackviewplugin.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -58,9 +58,12 @@
void QMpxHbVideoPlaybackViewPlugin::createView()
{
MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::createView()"));
-
- mView = new HbVideoPlaybackView();
- connect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
+
+ if ( ! mView )
+ {
+ mView = new HbVideoPlaybackView();
+ connect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
+ }
}
// ---------------------------------------------------------------------------
@@ -73,6 +76,8 @@
if ( mView )
{
+ disconnect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) );
+
delete mView;
mView = NULL;
}
@@ -101,8 +106,11 @@
{
MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::deactivateView()"));
- mView->handleDeactivateView();
- mViewActivated = false;
+ if ( mView && mViewActivated )
+ {
+ mView->handleDeactivateView();
+ mViewActivated = false;
+ }
}
// ---------------------------------------------------------------------------
--- a/videoplayback/videohelix/inc/mpxvideofiledetails.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideofiledetails.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
@@ -69,7 +69,9 @@
TInt iResolutionHeight;
TInt iMaxVolume;
TInt iBitRate;
-
+ TInt iCreationTime;
+ TInt iModificationTime;
+
TBool iSeekable;
TBool iPausableStream;
TBool iLiveStream;
--- a/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,8 @@
*
*/
-// Version : %version: ou1cpsw#21 %
+
+// Version : %version: 24 %
#ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_
@@ -52,6 +53,7 @@
class CMPXVideoSeeker;
class CMpxVideoDrmHelper;
class CHWRMLight;
+
//
// CLASS DECLARATION
//
@@ -94,7 +96,7 @@
void HandleSettingChange( const TUid& aRepositoryUid,
TUint32 aSettingId );
- void OpenFileL( const TDesC& aMediaFile, RFile& aFile, TInt aPosition, TInt aAccessPointId = KUseDefaultIap );
+ void OpenFileL( const TDesC& aMediaFile, RFile& aFile, TInt aPosition, TInt aAccessPointId = KUseDefaultIap );
void HandleGeneralPlaybackCommandL( CMPXCommand& aCmd );
@@ -130,9 +132,11 @@
void SetVolumeSteps( TInt aVolumeSteps );
void HandleVolumeL( TBool aIncrease );
+ void SendHideControlsEventL();
+
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
- void OpenFile64L( const TDesC& aMediaFile, RFile64& aFile, TInt aPosition, TInt aAccessPointId = KUseDefaultIap );
+ void OpenFile64L( const TDesC& aMediaFile, RFile64& aFile, TInt aPosition, TInt aAccessPointId = KUseDefaultIap );
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
@@ -155,33 +159,35 @@
void DetermineMediaTypeL();
void ResetMemberVariables();
-
+
void StartLightsControl();
void CancelLightsControl();
-
+
void EnableDisplayBacklight();
void DisableDisplayBacklight();
-
+
static TInt HandleBackLightTimeout( TAny* aPtr );
void DoHandleBackLightTimeout();
void StartBackLightTimer();
void CancelBackLightTimer();
-
+
void InitUserActivityTimerL();
void RestartUserActivityTimer();
void CancelUserActivityTimer();
static TInt HandleUserActivityTimeout( TAny* aPtr );
void DoHandleUserActivityTimeout();
-
+
TTimeIntervalMicroSeconds32 InitDisplayTimerL();
void RestartDisplayTimer();
void CancelDisplayTimer();
static TInt HandleDisplayTimeout( TAny* aPtr );
void DoHandleDisplayTimeout();
-
+
CHWRMLight* GetLightsL();
void ReleaseLights();
+ void SendTvOutEventL( TBool aConnected, TBool aPlaybackAllowed );
+
protected:
/*
@@ -244,15 +250,14 @@
// Timer for calling User::ResetInactivityTime() periodicallly while playing.
// This keeps backligth on and screensaver off.
- CPeriodic* iBackLightTimer;
-
+ CPeriodic* iBackLightTimer;
+
// Timer to turn display lights off when playing to TV-out
- CPeriodic* iDisplayTimer;
+ CPeriodic* iDisplayTimer;
TTimeIntervalMicroSeconds32 iDisplayTimerTimeout;
// Timer monitoring user activity when TV-out is connected
- CPeriodic* iUserActivityTimer;
+ CPeriodic* iUserActivityTimer;
-
TBool iSeekable;
CMpxVideoDrmHelper* iDrmHelper;
--- a/videoplayback/videohelix/inc/mpxvideoplayerutility.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -123,8 +123,6 @@
const TSurfaceId& aSurfaceId,
const TRect& aCropRect,
TVideoAspectRatio aAspectRatio );
-
- void SurfaceRemovedFromView();
#endif
--- a/videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoaccessoryobserver.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 8 %
//
// INCLUDE FILES
@@ -153,10 +153,12 @@
for ( TInt index = 0 ; index < count ; index++ )
{
+ TAccPolGenericID genId = iGenericIdArray.GetGenericIDL( index );
+
//
// Get all supported capabilities for this connected accessory.
//
- iConnection.GetSubblockNameArrayL( iGenericIdArray.GetGenericIDL( index ), *nameArray );
+ iConnection.GetSubblockNameArrayL( genId, *nameArray );
//
// Check if this connected accessory supports TV-Out
@@ -165,8 +167,7 @@
{
MPX_DEBUG(_L(" TV-Out Capabilities Exist"));
- tvOutConnected = ETrue;
- break;
+ tvOutConnected = ETrue;
}
}
@@ -180,7 +181,7 @@
{
iTvOutConnected = tvOutConnected;
- if ( iTvOutConnected )
+ if ( iTvOutConnected )
{
//
// Check the playablility of the clip
@@ -195,7 +196,7 @@
statusChanged = ETrue;
}
- MPX_DEBUG(_L(" iTvOutConnected = %d"), iTvOutConnected);
+ MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL iTvOutConnected = %d"), iTvOutConnected);
MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged);
--- a/videoplayback/videohelix/src/mpxvideofiledetails.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideofiledetails.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
@@ -126,6 +126,8 @@
iFourCCCode = 0;
iDuration = 0;
+ iCreationTime = 0;
+ iModificationTime = 0;
}
// EOF
--- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,8 @@
*
*/
-// Version : %version: 50 %
+
+// Version : %version: 56 %
//
@@ -41,7 +42,7 @@
#include <e32std.h>
#include <devsoundif.h>
#include <avkondomainpskeys.h>
-#include <hwrmlight.h>
+#include <hwrmlight.h>
#include <centralrepository.h> // For display timeout setting
#include <hwrmlightdomaincrkeys.h>
@@ -85,6 +86,8 @@
_LIT( KRightCopy, "Copyright" );
_LIT( KLanguage, "Language" );
_LIT( KKeywords, "Keywords" );
+_LIT( KCreated, "CreationTime" );
+_LIT( KLastModified, "ModificationTime" );
// ============================ MEMBER FUNCTIONS ===================================================
@@ -164,7 +167,7 @@
iBackLightTimer = CPeriodic::NewL( CActive::EPriorityStandard );
iDrmHelper = CMpxVideoDrmHelper::NewL();
-
+
iSavedPosition = 0;
}
@@ -185,7 +188,7 @@
void CMPXVideoPlaybackController::OpenFileL( const TDesC& aMediaFile,
RFile& aFile,
TInt aPosition,
- TInt aAccessPointId )
+ TInt aAccessPointId )
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::OpenFileL()"),
_L("file = %S"), &aMediaFile );
@@ -216,7 +219,7 @@
SetPlaybackModeL();
iSavedPosition = aPosition;
-
+
//
// Create accessory monitor to search for TV-Out events
//
@@ -349,16 +352,16 @@
delete iPlayer;
iPlayer = NULL;
}
-
+
if ( iUserActivityTimer )
{
iUserActivityTimer->Cancel();
delete iUserActivityTimer;
iUserActivityTimer = NULL;
}
-
+
ReleaseLights();
-
+
CancelDisplayTimer();
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
@@ -495,7 +498,7 @@
{
iSeekable = aCmd.ValueTObjectL<TBool>(KMPXMediaGeneralExtVideoSeekable);
- if( iFileDetails )
+ if ( iFileDetails )
{
iFileDetails->iSeekable &= iSeekable;
}
@@ -545,15 +548,6 @@
break;
}
- case EPbCmdSurfaceRemoved:
- {
- iPlayer->SurfaceRemovedFromView();
- break;
- }
- default:
- {
- break;
- }
}
}
}
@@ -1203,7 +1197,7 @@
case EMPXVideoPlaying:
{
iState = iPlayingState;
-
+
//
// If clip is audio only, stop the backlight timer and break switch
// If clip has audio and video, proceed to the next case which will
@@ -1217,7 +1211,7 @@
{
CancelLightsControl();
}
-
+
break;
}
case EMPXVideoPaused:
@@ -1378,9 +1372,9 @@
if ( ! metaData->Name().CompareF( KSeekable ) )
{
- if ( ! metaData->Value().CompareF( KTrue ) )
+ if ( ! metaData->Value().CompareF( KFalse ) )
{
- iFileDetails->iSeekable = ETrue;
+ iFileDetails->iSeekable = EFalse;
}
}
else if ( ! metaData->Name().CompareF( KLiveStream ) )
@@ -1450,6 +1444,16 @@
{
iFileDetails->iKeywords = metaData->Value().AllocL();
}
+ else if ( !metaData->Name().CompareF( KCreated ) )
+ {
+ TLex lex( metaData->Value() );
+ lex.Val( iFileDetails->iCreationTime );
+ }
+ else if ( !metaData->Name().CompareF( KLastModified ) )
+ {
+ TLex lex( metaData->Value() );
+ lex.Val( iFileDetails->iModificationTime );
+ }
CleanupStack::PopAndDestroy( metaData );
}
@@ -1751,9 +1755,9 @@
return alarm;
}
-// -----------------------------------------------------------------------------
-// CMPXVideoPlaybackController::IsKeyLocked
-// -----------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::IsKeyLocked
+// -------------------------------------------------------------------------------------------------
//
TBool CMPXVideoPlaybackController::IsKeyLocked()
{
@@ -1765,55 +1769,13 @@
return keylock;
}
-// ------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackController::HandleTvOutEventL()
-// ------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::SendTvOutEventL
+// -------------------------------------------------------------------------------------------------
//
-void CMPXVideoPlaybackController::HandleTvOutEventL( TBool aConnected )
+void CMPXVideoPlaybackController::SendTvOutEventL( TBool aConnected, TBool aPlaybackAllowed )
{
- MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleTvOutEventL()"),
- _L("aConnected = %d"), aConnected );
-
- TBool playbackAllowed = ETrue;
-
- if ( aConnected )
- {
- //
- // TV-Out accessory connected
- //
- if ( ! iAccessoryMonitor->IsTvOutPlaybackAllowed() )
- {
- //
- // Clip has DRM protection and TV-Out is connected
- // Pause playback and display info note
- //
- DoHandleCommandL( EPbCmdPause );
-
- playbackAllowed = EFalse;
-
- iState->SendErrorToViewL( KMPXVideoTvOutPlaybackNotAllowed );
- }
- else
- {
- // If lights are being controlled enable display timer so that screen backlight will be turned
- // of after timeout.
- if ( iBackLightTimer->IsActive() )
- {
- RestartDisplayTimer();
- }
- }
- }
- else
- {
- // TV out disconnected
- CancelDisplayTimer();
-
- // Ensure that lights are on after this
- ReleaseLights();
-
- // Pause playback since TV-Out accessory has been disconnected.
- DoHandleCommandL( EPbCmdPause );
- }
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SendTvOutEventL()"));
//
// Send notice to the playback view with TV-Out connection status
@@ -1826,7 +1788,32 @@
message->SetTObjectValueL<TMPXVideoPlaybackCommand>
( KMPXMediaVideoPlaybackCommand, EPbCmdTvOutEvent );
message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutConnected, aConnected );
- message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutPlayAllowed, playbackAllowed );
+ message->SetTObjectValueL<TInt>( KMPXMediaVideoTvOutPlayAllowed, aPlaybackAllowed );
+
+ iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
+
+ CleanupStack::PopAndDestroy( message );
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::SendHideControlsEventL
+// -------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::SendHideControlsEventL()
+{
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::SendHideControlsEventL()"));
+
+ //
+ // Send notice to the playback view to hide the controls
+ // when key lock
+ //
+ CMPXMessage* message = CMPXMessage::NewL();
+ CleanupStack::PushL( message );
+
+ message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMediaIdVideoPlayback );
+
+ message->SetTObjectValueL<TMPXVideoPlaybackCommand>
+ ( KMPXMediaVideoPlaybackCommand, EPbCmdHideControls );
iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
@@ -1834,6 +1821,60 @@
}
// ------------------------------------------------------------------------------------------------
+// CMPXVideoPlaybackController::HandleTvOutEventL()
+// ------------------------------------------------------------------------------------------------
+//
+void CMPXVideoPlaybackController::HandleTvOutEventL( TBool aConnected )
+{
+ MPX_ENTER_EXIT( _L("CMPXVideoPlaybackController::HandleTvOutEventL()"),
+ _L("aConnected = %d"), aConnected );
+
+ TBool playbackAllowed = iAccessoryMonitor->IsTvOutPlaybackAllowed();
+
+ SendTvOutEventL( aConnected, playbackAllowed );
+
+ //
+ // Check playback status of clip with new Tv-Out status
+ //
+ if ( aConnected )
+ {
+ //
+ // TV-Out accessory connected
+ //
+ if ( ! playbackAllowed )
+ {
+ //
+ // Clip has DRM protection and TV-Out is connected
+ // Pause playback and display info note
+ //
+ DoHandleCommandL( EPbCmdPause );
+
+ iState->SendErrorToViewL( KMPXVideoTvOutPlaybackNotAllowed );
+ }
+ else
+ {
+ // If lights are being controlled enable display timer so that screen backlight will be turned
+ // of after timeout.
+ if ( iBackLightTimer->IsActive() )
+ {
+ RestartDisplayTimer();
+ }
+ }
+ }
+ else
+ {
+ // TV out disconnected
+ CancelDisplayTimer();
+
+ // Ensure that lights are on after this
+ ReleaseLights();
+
+ // Pause playback since TV-Out accessory has been disconnected.
+ DoHandleCommandL( EPbCmdPause );
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::CancelBackLightTimer
// ------------------------------------------------------------------------------------------------
void CMPXVideoPlaybackController::CancelBackLightTimer()
@@ -1844,7 +1885,6 @@
{
iBackLightTimer->Cancel();
}
-
}
// ------------------------------------------------------------------------------------------------
@@ -1861,7 +1901,6 @@
KMPXBackLightTimeOut,
TCallBack( CMPXVideoPlaybackController::HandleBackLightTimeout, this ));
}
-
}
// -------------------------------------------------------------------------------------------------
@@ -1881,13 +1920,13 @@
void CMPXVideoPlaybackController::DoHandleBackLightTimeout()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleBackLightTimeout()"));
-
+
TBool tvOutConnected( EFalse );
if ( iAccessoryMonitor )
{
tvOutConnected = iAccessoryMonitor->IsTvOutConnected();
}
-
+
// User activity timer runs always when TV-out is connected
// it keeps resetting display timer and keeps lights on whenever there is user activity
if ( tvOutConnected )
@@ -1896,9 +1935,9 @@
// Cancel activity timer. Otherwise resetting inactivity time would fire user activity detection
CancelUserActivityTimer();
}
-
+
User::ResetInactivityTime();
-
+
if ( tvOutConnected )
{
// Restart user activity timer. It must be running between backlight timer intervals so that backlight
@@ -1916,7 +1955,7 @@
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::StartLightsControl()"));
StartBackLightTimer();
-
+
if (iAccessoryMonitor )
{
if ( iAccessoryMonitor->IsTvOutConnected() )
@@ -1933,21 +1972,21 @@
void CMPXVideoPlaybackController::CancelLightsControl()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelLightsControl()"));
-
+
// This is called whenever there is no need to keep screensaver of anymore
- // This means that also displaytimer and activity monitoring can be stopped.
+ // This means that also displaytimer and activity monitoring can be stopped.
// This method is not correct place for these calls
CancelBackLightTimer();
-
+
CancelUserActivityTimer();
-
+
CancelDisplayTimer();
-
+
// Ensure that lights are on
EnableDisplayBacklight();
-
- // Release lights if releserved
- ReleaseLights();
+
+ // Release lights if releserved
+ ReleaseLights();
}
@@ -1958,23 +1997,22 @@
TTimeIntervalMicroSeconds32 CMPXVideoPlaybackController::InitDisplayTimerL()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::InitDisplayTimerL()"));
-
+
if ( !iDisplayTimer )
{
iDisplayTimer = CPeriodic::NewL( CPeriodic::EPriorityStandard );
-
- MPX_DEBUG(_L("CMPXVideoPlaybackController::InitDisplayTimerL() - created") );
-
+
+ MPX_DEBUG(_L("CMPXVideoPlaybackController::InitDisplayTimerL() - created") );
}
-
+
if ( iDisplayTimerTimeout.Int() == 0 )
{
// Get the display light time-out value from CenRep
- CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
+ CRepository* repository = CRepository::NewLC( KCRUidLightSettings );
// What's the timeout value (in seconds ) for the display light?
TInt displayTimeOut ( 0 );
repository->Get( KDisplayLightsTimeout, displayTimeOut );
-
+
if ( ( displayTimeOut * KMPXMicroSecondsInASecond ) > KMaxTInt )
{
iDisplayTimerTimeout = KMaxTInt;
@@ -1983,15 +2021,14 @@
{
iDisplayTimerTimeout = displayTimeOut * KMPXMicroSecondsInASecond;
}
-
+
CleanupStack::PopAndDestroy( repository );
- }
-
-
+ }
+
MPX_DEBUG( _L("CMPXVideoPlaybackController::InitDisplayTimerL Timeout(%d)"), iDisplayTimerTimeout.Int() );
-
+
// Convert the timeout value to microseconds
- return iDisplayTimerTimeout;
+ return iDisplayTimerTimeout;
}
// -----------------------------------------------------------------------------
@@ -2006,29 +2043,28 @@
// Leave system to safe state if following leaves. Lights stay on
MPX_TRAPD(err, displayTimeOut=InitDisplayTimerL(); )
if ( err == KErrNone )
- {
+ {
// check if the display timer is running and cancel it
if ( iDisplayTimer->IsActive() )
{
iDisplayTimer->Cancel();
}
-
+
MPX_DEBUG( _L("CMPXVideoPlaybackController::RestartDisplayTimer() restarting displayTimer to=%d ms"), displayTimeOut.Int() );
-
+
iDisplayTimer->Start( displayTimeOut, displayTimeOut,
TCallBack( CMPXVideoPlaybackController::HandleDisplayTimeout, this ) );
}
-
}
// -----------------------------------------------------------------------------
// CMPXVideoPlaybackController::CancelDisplayTimer
// -----------------------------------------------------------------------------
//
-void CMPXVideoPlaybackController::CancelDisplayTimer()
+void CMPXVideoPlaybackController::CancelDisplayTimer()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelDisplayTimer"));
-
+
if ( iDisplayTimer )
{
if ( iDisplayTimer->IsActive() )
@@ -2071,21 +2107,21 @@
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::EnableDisplayBacklight
// ------------------------------------------------------------------------------------------------
-//
+//
void CMPXVideoPlaybackController::EnableDisplayBacklight()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::EnableDisplayBacklight()"));
-
+
// ELightStatusUnknown - We are not controlling lights and we don't care about lights
- // ELightOn - Ligths are certainly on
+ // ELightOn - Ligths are certainly on
MPX_DEBUG(_L("CMPXVideoPlaybackController::EnableDisplayBacklight() iLightStatus=%d"), iLightStatus );
-
+
// We are responsible of turning lights on only if we have switched them off.
if ( iLightStatus == CHWRMLight::ELightOff )
{
MPX_TRAPD( err,
- {
+ {
// Following GetLightsL() call will not leave.
// This call should not result to creation of CHWRMLight in this case
// because CHWRMLight was created when lights were turned off.
@@ -2093,105 +2129,103 @@
if ( lights->LightStatus(CHWRMLight::EPrimaryDisplay) == CHWRMLight::ELightOff )
{
MPX_DEBUG(_L("CMPXVideoPlaybackController::EnableDisplayBacklight() enabling") );
-
+
lights->LightOnL( CHWRMLight::EPrimaryDisplay, 0 );
iLightStatus = CHWRMLight::ELightOn;
}
} );
-
}
-
}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::DisableDisplayBacklight
// ------------------------------------------------------------------------------------------------
-//
+//
void CMPXVideoPlaybackController::DisableDisplayBacklight()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DisableDisplayBacklight()"));
-
+
// No major harm done if following block leaves. Lights are left on
MPX_TRAPD( err,
- {
+ {
CHWRMLight* lights = GetLightsL();
if ( lights->LightStatus(CHWRMLight::EPrimaryDisplay) == CHWRMLight::ELightOn )
{
MPX_DEBUG(_L("CMPXVideoPlaybackController::DisableDisplayBacklight() disabling") );
-
+
lights->LightOffL( CHWRMLight::EPrimaryDisplay, 0 );
iLightStatus = CHWRMLight::ELightOff;
}
} );
-
}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::InitUserActivityTimer
// ------------------------------------------------------------------------------------------------
-//
+//
void CMPXVideoPlaybackController::InitUserActivityTimerL()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::InitUserActivityTimerL()"));
-
+
iUserActivityTimer = CPeriodic::NewL( CActive::EPriorityStandard);
-
- // This timer will not run to the end. Timer will be canceled and reset at backlight timeout.
+
+ // This timer will not run to the end. Timer will be canceled and reset at backlight timeout.
iUserActivityTimer->Start(
0,
KMPXInactivityTimeout,
TCallBack( CMPXVideoPlaybackController::HandleUserActivityTimeout, this ));
-
}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::RestartUserActivityTimer
// ------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackController::RestartUserActivityTimer()
+//
+void CMPXVideoPlaybackController::RestartUserActivityTimer()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::RestartUserActivityTimer()"));
-
+
if ( !iUserActivityTimer )
{
// This is first call. Create and initialize timer
MPX_TRAPD( err,
- {
+ {
InitUserActivityTimerL();
} );
- // If user activity timer creation fails we can't detect user activity and
- // get lights back on when user taps screen.
+
+ // If user activity timer creation fails we can't detect user activity and
+ // get lights back on when user taps screen.
// Leave lights on.
if ( err != KErrNone )
- {
- EnableDisplayBacklight();
- }
+ {
+ EnableDisplayBacklight();
+ }
}
-
+
if ( iUserActivityTimer )
{
if ( iUserActivityTimer->IsActive() )
{
iUserActivityTimer->Cancel();
- }
+ }
+
// Not interested about inactivity callback, only activity
- // If CPeriodic::Inactivity is started with argument 0
+ // If CPeriodic::Inactivity is started with argument 0
// timer will fire when system's user inactivity timer resets.
iUserActivityTimer->Inactivity( 0 );
- }
+ }
}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::CancelUserActivityTimer
// ------------------------------------------------------------------------------------------------
-//
-void CMPXVideoPlaybackController::CancelUserActivityTimer()
+//
+void CMPXVideoPlaybackController::CancelUserActivityTimer()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CancelUserActivityTimer()"));
-
- if ( iUserActivityTimer )
- {
+
+ if ( iUserActivityTimer )
+ {
if ( iUserActivityTimer->IsActive() )
{
iUserActivityTimer->Cancel();
@@ -2202,35 +2236,35 @@
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::HandleUserActivityTimeout
// ------------------------------------------------------------------------------------------------
-//
+//
TInt CMPXVideoPlaybackController::HandleUserActivityTimeout( TAny* aPtr )
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::HandleUserActivityTimeout()"));
-
+
static_cast<CMPXVideoPlaybackController*>(aPtr)->DoHandleUserActivityTimeout();
- return KErrNone;
+ return KErrNone;
}
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackController::DoHandleUserActivityTimeout
// ------------------------------------------------------------------------------------------------
-//
+//
void CMPXVideoPlaybackController::DoHandleUserActivityTimeout()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::DoHandleUserActivityTimeout()"));
-
+
// Act only once for detected activity.
- if ( iUserActivityTimer->IsActive() )
+ if ( iUserActivityTimer->IsActive() )
{
iUserActivityTimer->Cancel();
}
-
+
// iUserActivityTimer runs when TV-out is connected and playback with video is going on
- // This timer fires in two situations.
+ // This timer fires in two situations.
// a) Lights are off and user activity is detected - Turn lights on and restart display timer
// b) Lights are on and user activity is detected - restart display timer to prevent lights go off
EnableDisplayBacklight();
-
+
// Start counting down to next lights off
RestartDisplayTimer();
}
@@ -2242,8 +2276,8 @@
CHWRMLight* CMPXVideoPlaybackController::GetLightsL()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::GetLightsL()"));
-
- if ( !iLight )
+
+ if ( !iLight )
{
MPX_DEBUG( _L("CMPXVideoPlaybackController::GetLightsL() - creating") );
iLight = CHWRMLight::NewL();
@@ -2258,13 +2292,13 @@
void CMPXVideoPlaybackController::ReleaseLights()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::ReleaseLights()"));
-
+
if ( iLight )
{
- // If iLights was created when ReleaseLights was called then TV out must be connected and lights may be off.
+ // If iLights was created when ReleaseLights was called then TV out must be connected and lights may be off.
// This call ensures that lights are on again.
EnableDisplayBacklight();
-
+
MPX_DEBUG( _L("CMPXVideoPlaybackController::ReleaseLights() - deleting") );
delete iLight;
iLight = NULL;
@@ -2379,7 +2413,7 @@
iFileHandle64.Close();
}
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
-
+
// reset to True
iSeekable = ETrue;
@@ -2484,8 +2518,8 @@
DetermineMediaTypeL();
SetPlaybackModeL();
- iSavedPosition = aPosition;
-
+ iSavedPosition = aPosition;
+
//
// Create accessory monitor to search for TV-Out events
//
--- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: e003sa33#21 %
+// Version : %version: 23 %
@@ -179,12 +179,17 @@
if ( iVideoPlaybackCtlr->iAppInForeground )
{
- if ( iVideoPlaybackCtlr->IsAlarm() ||
- ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ) )
+ if ( iVideoPlaybackCtlr->IsAlarm() )
{
iVideoPlaybackCtlr->iForegroundPause = ETrue;
iVideoPlaybackCtlr->iState->HandlePause();
}
+ else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
+ {
+ iVideoPlaybackCtlr->iForegroundPause = ETrue;
+ iVideoPlaybackCtlr->iState->HandlePause();
+ iVideoPlaybackCtlr->SendHideControlsEventL();
+ }
else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() )
{
iVideoPlaybackCtlr->iForegroundPause = EFalse;
@@ -199,11 +204,12 @@
}
// ------------------------------------------------------------------------------------------------
-// CMPXVideoPlaybackMode::CanPlayNow
+// CMPXVideoPlaybackMode::CanPlayNow()
// ------------------------------------------------------------------------------------------------
TBool CMPXVideoPlaybackMode::CanPlayNow()
{
- MPX_DEBUG(_L("CMPXVideoPlaybackMode::CanPlayNow"));
+ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::CanPlayNow"));
+
TBool playAllowed = EFalse;
if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
@@ -362,31 +368,34 @@
TInt apMaxLen = 3;
MPX_TRAPD( err,
- HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
- accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
+ {
+ HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
+ accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
- tempBuf = HBufC8::NewLC( accessPoint->Length() );
- tempBuf->Des().Copy( accessPoint->Des() );
+ tempBuf = HBufC8::NewLC( accessPoint->Length() );
+ tempBuf->Des().Copy( accessPoint->Des() );
- if ( tempBuf )
- {
- iVideoPlaybackCtlr->iPlayer->CustomCommandSync( destinationPckg,
- EMMFROPControllerSetApplicationConfig,
- tempBuf->Des(),
- savePckg );
- }
+ if ( tempBuf )
+ {
+ iVideoPlaybackCtlr->iPlayer->CustomCommandSync(
+ destinationPckg,
+ EMMFROPControllerSetApplicationConfig,
+ tempBuf->Des(),
+ savePckg );
+ }
- CleanupStack::PopAndDestroy(2); // accessPoint, tempBuf
- );
+ CleanupStack::PopAndDestroy(2);
+ } );
}
}
// ------------------------------------------------------------------------------------------------
-// CMPXStreamingPlaybackMode::CanPlayNow
+// CMPXStreamingPlaybackMode::CanPlayNow
// ------------------------------------------------------------------------------------------------
TBool CMPXStreamingPlaybackMode::CanPlayNow()
{
- MPX_DEBUG(_L("CMPXStreamingPlaybackMode::CanPlayNow"));
+ MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::CanPlayNow"));
+
TBool playAllowed = EFalse;
if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
@@ -425,6 +434,7 @@
MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::IsTvOutAllowedL(1)"));
return ETrue;
}
+
// ------------------------------------------------------------------------------------------------
// CMPXStreamingPlaybackMode::HandlePause()
// ------------------------------------------------------------------------------------------------
@@ -440,9 +450,10 @@
{
iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
- iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
- 0,
- err );
+ iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
+ MMPXPlaybackPluginObserver::EPPaused,
+ 0,
+ err );
}
else
{
--- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,8 @@
*
*/
-// Version : %version: e003sa33#36 %
+
+// Version : %version: 39 %
//
@@ -116,8 +117,6 @@
// ------------------------------------------------------------------------------------------------
// CMPXVideoPlaybackState::HandlePause()
-//
-// @@FP for now we are assuming that Pause is only valid for Playing state
// ------------------------------------------------------------------------------------------------
void CMPXVideoPlaybackState::HandlePause()
{
@@ -187,8 +186,6 @@
void CMPXVideoPlaybackState::HandleBackground()
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandleBackground()"));
-
- // Just pause the plackback
HandlePause();
}
@@ -526,7 +523,7 @@
TMPXAttribute( KMPXMediaVideoDrmProtected ),
iVideoPlaybackCtlr->iFileDetails->iDrmProtected );
}
-
+
//
// Description
//
@@ -537,7 +534,7 @@
TMPXAttribute( KMPXMediaVideoDescription ),
*( iVideoPlaybackCtlr->iFileDetails->iDescription ) );
}
-
+
//
// Location
//
@@ -548,7 +545,7 @@
TMPXAttribute( KMPXMediaVideoLocation ),
*( iVideoPlaybackCtlr->iFileDetails->iLocation ) );
}
-
+
//
// Copyright
//
@@ -559,7 +556,7 @@
TMPXAttribute( KMPXMediaVideoCopyright ),
*( iVideoPlaybackCtlr->iFileDetails->iCopyright ) );
}
-
+
//
// Language
//
@@ -570,7 +567,7 @@
TMPXAttribute( KMPXMediaVideoLanguage ),
*( iVideoPlaybackCtlr->iFileDetails->iLanguage ) );
}
-
+
//
// Keywords
//
@@ -580,7 +577,28 @@
aMedia->SetTextValueL(
TMPXAttribute( KMPXMediaVideoKeywords ),
*( iVideoPlaybackCtlr->iFileDetails->iKeywords ) );
- }
+ }
+
+ //
+ // Creation date/time
+ //
+ if ( attrV & KMPXMediaVideoCreated.iAttributeId )
+ {
+ aMedia->SetTObjectValueL<TInt>(
+ TMPXAttribute( KMPXMediaVideoCreated ),
+ iVideoPlaybackCtlr->iFileDetails->iCreationTime );
+ }
+
+ //
+ // Last Modified date/time
+ //
+ if ( attrV & KMPXMediaVideoLastModified.iAttributeId )
+ {
+ aMedia->SetTObjectValueL<TInt>(
+ TMPXAttribute( KMPXMediaVideoLastModified ),
+ iVideoPlaybackCtlr->iFileDetails->iModificationTime );
+ }
+
}
// ------------------------------------------------------------------------------------------------
@@ -673,6 +691,13 @@
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::CommandHandleBackground()"));
+ //
+ // Block playback in the following cases:
+ // - App is not in foreground
+ // - Alarm
+ // - Phone call
+ // - Video call
+ //
if ( !iVideoPlaybackCtlr->iAppInForeground ||
iVideoPlaybackCtlr->IsAlarm() ||
iVideoPlaybackCtlr->IsPhoneCall() ||
@@ -689,7 +714,7 @@
{
MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::CommandHandleForeground()"));
- if ( !iVideoPlaybackCtlr->IsActivePhoneCall() )
+ if ( ! iVideoPlaybackCtlr->IsActivePhoneCall() )
{
iVideoPlaybackCtlr->iAllowAutoPlay = ETrue;
}
@@ -979,20 +1004,20 @@
if ( aError == KErrNone )
{
iVideoPlaybackCtlr->iPlaybackMode->HandleOpenComplete();
-
+
//
- // call setposition with converted value saved in openfile
+ // call setposition with converted value saved in openfile
//
- if ( iVideoPlaybackCtlr->iSavedPosition > 0 )
- {
+ if ( iVideoPlaybackCtlr->iSavedPosition > 0 )
+ {
MPX_DEBUG(_L("CMPXInitialisingState::HandleOpenComplete() iSavedPosition %d"), iVideoPlaybackCtlr->iSavedPosition );
-
+
TInt64 pos( iVideoPlaybackCtlr->iSavedPosition );
pos *= KPbMilliMultiplier;
-
+
MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->SetPositionL( pos ) );
}
-
+
MPX_DEBUG(_L("CMPXInitialisingState::HandleOpenComplete() Sending Prepare()"));
iVideoPlaybackCtlr->iPlayer->Prepare();
@@ -1713,17 +1738,32 @@
}
// ------------------------------------------------------------------------------------------------
-// CMPXBufferingState::HandleLoadingStarted()
-//
-// We transition to Buffering state after Play command is issued initially
-//
-// No state transitions necessary here as we are already in Buffering state
+// CMPXBufferingState::HandleLoadingStarted()
// ------------------------------------------------------------------------------------------------
void CMPXBufferingState::HandleLoadingStarted()
{
MPX_DEBUG(_L("CMPXBufferingState::HandleLoadingStarted()"));
- // no need to send any events - we are already in buffering state
+ TInt loadingPercentage = RetrieveBufferingPercentage();
+
+ if ( loadingPercentage < 100 )
+ {
+ MPX_TRAPD( err,
+ {
+ CMPXMessage* message = CMPXMessage::NewL();
+ CleanupStack::PushL( message );
+
+ message->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId,
+ KMPXMediaIdVideoPlayback );
+
+ message->SetTObjectValueL<TMPXVideoPlaybackCommand>( KMPXMediaVideoPlaybackCommand,
+ EPbCmdLoadingStarted );
+
+ iVideoPlaybackCtlr->iMPXPluginObs->HandlePlaybackMessage( message, KErrNone );
+
+ CleanupStack::PopAndDestroy( message );
+ } );
+ }
}
// ------------------------------------------------------------------------------------------------
@@ -1747,8 +1787,9 @@
}
else
{
- // delayed pause :
- // background event was received while we were in buffering state
+ //
+ // Delayed pause, background event was received while we were in buffering state
+ //
iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
}
}
@@ -1775,14 +1816,11 @@
}
// ------------------------------------------------------------------------------------------------
-// CMPXBufferingState::HandleBackground()
+// CMPXBufferingState::HandleBackground()
// ------------------------------------------------------------------------------------------------
void CMPXBufferingState::HandleBackground()
{
MPX_DEBUG(_L("CMPXBufferingState::HandleBackground()"));
-
- // we are in buffering state and received a background event
- // we cannot pause now but need to pause when buffering is complete
iVideoPlaybackCtlr->iPlaybackMode->HandleBackground();
}
@@ -1793,8 +1831,10 @@
{
MPX_DEBUG(_L("CMPXBufferingState::HandleForeground()"));
- // we are in buffering state and received a background event
- // we cannot pause now but need to pause when buffering is complete
+ //
+ // We are in buffering state and received a background and foreground event
+ // playback will continue when buffering is complete
+ //
}
// ------------------------------------------------------------------------------------------------
@@ -1888,7 +1928,8 @@
// ------------------------------------------------------------------------------------------------
void CMPXSeekingState::HandleBackground()
{
- MPX_DEBUG(_L("CMPXSeekingState::HandleBackground()"));
+ MPX_ENTER_EXIT(_L("CMPXSeekingState::HandleBackground()"));
+
MPX_TRAPD( err, HandleStopSeekL() );
iVideoPlaybackCtlr->iPlaybackMode->HandleBackground();
}
@@ -1898,7 +1939,8 @@
// ------------------------------------------------------------------------------------------------
void CMPXSeekingState::HandlePause()
{
- MPX_DEBUG(_L("CMPXSeekingState::HandlePause()"));
+ MPX_ENTER_EXIT(_L("CMPXSeekingState::HandlePause()"));
+
MPX_TRAPD( err, HandleStopSeekL() );
iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
}
--- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,8 @@
*
*/
-// Version : %version: e003sa33#19 %
+
+// Version : %version: 20 %
#include <AudioPreference.h>
@@ -79,11 +80,7 @@
iControllerEventMonitor = NULL;
}
- if ( ! iSurfaceId.IsNull() )
- {
- MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoRemoveDisplayWindow ) );
- iSurfaceId = TSurfaceId::CreateNullId();
- }
+ iSurfaceId = TSurfaceId::CreateNullId();
iController.Close();
iDirectScreenAccessAbort = EFalse;
@@ -280,21 +277,6 @@
}
}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerUtility::SurfaceRemovedFromView()
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerUtility::SurfaceRemovedFromView()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SurfaceRemovedFromView()"));
-
- if ( ! iSurfaceId.IsNull() )
- {
- iSurfaceId = TSurfaceId::CreateNullId();
- }
-}
-
TBool CMpxVideoPlayerUtility::AudioEnabledL() const
{
TBool enabled;
@@ -498,40 +480,35 @@
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::VideoSurfaceCreated()"));
- TSurfaceId oldSurfaceId( iSurfaceId );
- TBool replaceSurface = ! ( iSurfaceId.IsNull() );
-
- TSurfaceId surfaceId;
- TRect cropRect;
- TVideoAspectRatio aspectRatio;
+ TInt error = KErrNone;
- TInt error =
- iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId,
- cropRect,
- aspectRatio );
-
- if ( error == KErrNone )
+ if ( iSurfaceId.IsNull() )
{
- //
- // Send data to the display handler to remove old surface and add new surface
- //
- MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
- surfaceId,
- cropRect,
- aspectRatio ) );
+ TSurfaceId surfaceId;
+ TRect cropRect;
+ TVideoAspectRatio aspectRatio;
- iSurfaceId = surfaceId;
+ error = iVideoPlaySurfaceSupportCustomCommands.GetSurfaceParameters( surfaceId,
+ cropRect,
+ aspectRatio );
- //
- // if surface already existed tell video adaptation it is no longer in use.
- // Video adaptation will remove the surface when it receives this call therefore
- // the following code must be done at the end of this function.
- //
- if ( replaceSurface )
+ if ( error == KErrNone )
{
- error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( oldSurfaceId );
+ //
+ // Send data to the display handler to remove old surface and add new surface
+ //
+ MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceCreated,
+ surfaceId,
+ cropRect,
+ aspectRatio ) );
+
+ iSurfaceId = surfaceId;
}
}
+ else
+ {
+ error = KErrAlreadyExists;
+ }
return error;
}
@@ -619,10 +596,10 @@
CMPXMessage* msg = CMPXMessage::NewL();
CleanupStack::PushL( msg );
- msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplaySyncMessage );
+ msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage );
msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
- iVideoPlaybackController->iMPXPluginObs->HandlePlaybackSyncMessage( *msg );
+ iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( *msg );
CleanupStack::PopAndDestroy( msg );
}
@@ -645,13 +622,13 @@
CMPXMessage* msg = CMPXMessage::NewL();
CleanupStack::PushL( msg );
- msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplaySyncMessage );
+ msg->SetTObjectValueL<TInt>( KMPXMessageGeneralId, KMPXMediaIdVideoDisplayMessage );
msg->SetTObjectValueL<TInt>( KMPXMediaVideoDisplayCommand, aCmd );
msg->SetTObjectValueL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId, aSurfaceId );
msg->SetTObjectValueL<TRect>( KMPXMediaVideoDisplayCropRect, aCropRect );
msg->SetTObjectValueL<TVideoAspectRatio>( KMPXMediaVideoDisplayAspectRatio, aAspectRatio );
- iVideoPlaybackController->iMPXPluginObs->HandlePlaybackSyncMessage( *msg );
+ iVideoPlaybackController->iMPXPluginObs->HandlePlaybackMessage( *msg );
CleanupStack::PopAndDestroy( msg );
}
--- a/videoplayback/videohelix/src/mpxvideoseeker.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/src/mpxvideoseeker.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
// INCLUDE FILES
@@ -31,7 +31,7 @@
const TInt KDefaultPlaySpeed(100); // 1x
const TInt KDefaultTrickPlaySpeed(400); // 4x
#else
-const TInt KTrickPlayTimeout(5000000); // 5 sec
+const TInt KTrickPlayTimeout(2000000); // 2 sec
const TInt KSpeedInterval(125000); // 125 msec
const TInt KDurationA(90000000); // 90 sec
const TInt KDurationB(180000000); // 180 sec
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Mon May 03 12:32:50 2010 +0300
@@ -821,22 +821,7 @@
[Endtest]
[Test]
-title 54. HDMI Tv-Out - Unprotected Content
-create videohelixtest test
-test Initialize 60000 10 vhpp_test.3gp KErrNone KErrNone KErrNone
-waittestclass test
-pause 100
-test ConnectHDMITvOut
-waittestclass test
-test DisconnectHDMITvOut
-waittestclass test
-delete test
-pause 1000
-[Endtest]
-
-
-[Test]
-title 55. InitialiseWithPositionL with file missing
+title 54. InitialiseWithPositionL with file missing
create videohelixtest test
test InitializeWithPositionL 0 10 6575 vhpp_nofile.3gp KErrNotFound KErrNone KErrNone
waittestclass test
@@ -847,7 +832,7 @@
[Endtest]
[Test]
-title 56. InitialiseL with 32-bit file handle
+title 55. InitialiseL with 32-bit file handle
create videohelixtest test
test InitializeHandleWithPositionL ERFile 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -856,7 +841,7 @@
[Endtest]
[Test]
-title 57. Initialise with rtsp link & AP
+title 56. Initialise with rtsp link & AP
create videohelixtest test
test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -865,7 +850,7 @@
[Endtest]
[Test]
-title 58. Play rtsp link (forces buffering state)
+title 57. Play rtsp link (forces buffering state)
create videohelixtest test
test InitializeLinkWithPositionL 0 10 6575 rtsp:\/\/link.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -876,7 +861,7 @@
[Endtest]
[Test]
-title 59. Initialise with SDP file via 32-bit file handle
+title 58. 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
@@ -885,7 +870,7 @@
[Endtest]
[Test]
-title 60. InitialiseL with 64-bit file handle
+title 59. InitialiseL with 64-bit file handle
create videohelixtest test
test InitializeHandleWithPositionL ERFile64 60000 10 6575 vhpp_test.3gp KErrNone KErrNone KErrNone
waittestclass test
@@ -894,7 +879,7 @@
[Endtest]
[Test]
-title 61. Initialise with SDP file via 64-bit file handle
+title 60. 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
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoaccessoryobserver_stub.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoaccessoryobserver_stub.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 5 %
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 11 %
+// Version : %version: 12 %
#ifndef __MPXVIDEOPLAYERUTILITY__
@@ -170,6 +170,8 @@
TInt iAudioBitRate;
TInt iVideoBitRate;
TInt iVolume;
+ TInt iCreationTime;
+ TInt iModificationTime;
TBool iAudioEnabled;
TBool iSeekable;
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 12 %
+// Version : %version: 13 %
#ifndef __VHPPTESTCASE_H__
@@ -170,9 +170,6 @@
virtual TInt SetDrmProtectedL( CStifItemParser& aItem );
virtual TInt IssueSeekedToEndCommandL( CStifItemParser& aItem );
virtual TInt HandleVolumeL( CStifItemParser& aItem );
- virtual TInt ConnectHDMITvOutL();
- virtual TInt DisconnectHDMITvOutL();
- virtual TInt SetHDMITvOutConnectedL();
virtual TInt InitializeWithPositionL( CStifItemParser& aItem );
virtual TInt InitializeLinkWithPositionL( CStifItemParser& aItem );
virtual TInt InitializeHandleWithPositionL( CStifItemParser& aItem );
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoaccessoryobserver_stub.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoaccessoryobserver_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 5 %
//
// INCLUDE FILES
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 15 %
#include <audiopreference.h>
#include <mmf/server/mmffile.h>
@@ -695,6 +695,16 @@
iKeywords = value.AllocL();
}
+ else if ( ! aItem.Compare(_L8("CreationTime")) )
+ {
+ TLex8 lex(value);
+ lex.Val( iCreationTime );
+ }
+ else if ( ! aItem.Compare(_L8("ModificationTime")) )
+ {
+ TLex8 lex(value);
+ lex.Val( iModificationTime );
+ }
HBufC* name = HBufC::NewL( aItem.Length() );
TPtr namePtr( name->Des() );
@@ -743,10 +753,6 @@
return KErrNone;
}
-void CMpxVideoPlayerUtility::SurfaceRemovedFromView()
-{
-}
-
#endif
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
--- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 18 %
+// Version : %version: 19 %
// [INCLUDE FILES] - do not remove
@@ -116,9 +116,6 @@
ENTRY( "SetDrmProtected", CVHPPTestClass::SetDrmProtectedL ),
ENTRY( "IssueSeekedToEndCommand", CVHPPTestClass::IssueSeekedToEndCommandL),
ENTRY( "HandleVolume", CVHPPTestClass::HandleVolumeL ),
- ENTRY( "ConnectHDMITvOut", CVHPPTestClass::ConnectHDMITvOutL ),
- ENTRY( "DisconnectHDMITvOut", CVHPPTestClass::DisconnectHDMITvOutL ),
- ENTRY( "SetHDMITvOutConnected", CVHPPTestClass::SetHDMITvOutConnectedL ),
ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL),
ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL),
@@ -2171,66 +2168,6 @@
return err;
}
-TInt
-CVHPPTestClass::ConnectHDMITvOutL( )
-{
- MPX_ENTER_EXIT(_L("CVHPPTestClass::ConnectHDMITvOutL()"));
- iLog->Log(_L("CVHPPTestClass::ConnectHDMITvOutL()"));
-
- // Connect HDMI TV Out
- iAccObserver->SetTvOutHDMI( ETrue );
-
- //
- // Add event for callback
- //
- TCallbackEvent* event = new TCallbackEvent;
-
- event->iEvent = EPbCmdTvOutEvent;
- event->iData = ETrue;
- event->iError = ETrue;
-
- AddExpectedEvent( event );
-
- iAccObserver->UpdateTvOutStatusL( ETrue );
-
- return KErrNone;
-}
-
-TInt
-CVHPPTestClass::DisconnectHDMITvOutL()
-{
- MPX_ENTER_EXIT(_L("CVHPPTestClass::DisconnectHDMITvOutL()"));
- iLog->Log(_L("CVHPPTestClass::DisconnectHDMITvOutL()"));
-
- // Connect HDMI TV Out
- iAccObserver->SetTvOutHDMI( EFalse );
-
- //
- // Add event for callback
- //
- TCallbackEvent* event = new TCallbackEvent;
-
- event->iEvent = EPbCmdTvOutEvent;
- event->iData = EFalse;
- event->iError = ETrue;
-
- AddExpectedEvent( event );
-
- iAccObserver->UpdateTvOutStatusL( EFalse );
-
- return KErrNone;
-}
-
-TInt
-CVHPPTestClass::SetHDMITvOutConnectedL()
-{
- MPX_ENTER_EXIT(_L("CVHPPTestClass::SetHDMITvOutConnectedL()"));
- iLog->Log(_L("CVHPPTestClass::SetHDMITvOutConnectedL()"));
-
- iAccObserver->SetTvOutHDMI( ETrue );
-
- return KErrNone;
-}
TInt
CVHPPTestClass::InitializeWithPositionL( CStifItemParser& aItem )
--- a/videoplayerapp/bwins/videoplayerengineu.def Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/bwins/videoplayerengineu.def Mon May 03 12:32:50 2010 +0300
@@ -34,7 +34,7 @@
?contextTitle@VideoServices@@QBE?AVQString@@XZ @ 33 NONAME ; class QString VideoServices::contextTitle(void) const
?initialize@QVideoPlayerEngine@@QAEXXZ @ 34 NONAME ; void QVideoPlayerEngine::initialize(void)
?trUtf8@QVideoPlayerEngine@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString QVideoPlayerEngine::trUtf8(char const *, char const *)
- ?loadPlugin@QVideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 36 NONAME ; void QVideoPlayerEngine::loadPlugin(enum MpxHbVideoCommon::MpxHbVideoViewType)
+ ?loadPluginAndCreateView@QVideoPlayerEngine@@AAEXW4MpxHbVideoViewType@MpxHbVideoCommon@@@Z @ 36 NONAME ; void QVideoPlayerEngine::loadPluginAndCreateView(enum MpxHbVideoCommon::MpxHbVideoViewType)
?currentService@VideoServices@@QAE?AW4TVideoService@1@XZ @ 37 NONAME ; enum VideoServices::TVideoService VideoServices::currentService(void)
?qt_metacall@VideoServices@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 38 NONAME ; int VideoServices::qt_metacall(enum QMetaObject::Call, int, void * *)
?mInstance@VideoServices@@0PAV1@A @ 39 NONAME ; class VideoServices * VideoServices::mInstance
@@ -44,4 +44,9 @@
?instance@VideoServices@@SAPAV1@PAVQVideoPlayerEngine@@@Z @ 43 NONAME ; class VideoServices * VideoServices::instance(class QVideoPlayerEngine *)
??_EQVideoPlayerEngine@@UAE@I@Z @ 44 NONAME ; QVideoPlayerEngine::~QVideoPlayerEngine(unsigned int)
?doDelayedLoad@QVideoPlayerEngine@@AAEXXZ @ 45 NONAME ; void QVideoPlayerEngine::doDelayedLoad(void)
+ ?playMedia@QVideoPlayerEngine@@QAEXVRFile@@@Z @ 46 NONAME ; void QVideoPlayerEngine::playMedia(class RFile)
+ ?getBrowseCategory@VideoServices@@QBEHXZ @ 47 NONAME ; int VideoServices::getBrowseCategory(void) const
+ ?browsingEnded@VideoServices@@QAEXXZ @ 48 NONAME ; void VideoServices::browsingEnded(void)
+ ?createPlayAndDetailsViews@QVideoPlayerEngine@@AAEXXZ @ 49 NONAME ; void QVideoPlayerEngine::createPlayAndDetailsViews(void)
+ ?setCurrentView@QVideoPlayerEngine@@AAEXXZ @ 50 NONAME ; void QVideoPlayerEngine::setCurrentView(void)
--- a/videoplayerapp/eabi/videoplayerengineu.def Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/eabi/videoplayerengineu.def Mon May 03 12:32:50 2010 +0300
@@ -20,7 +20,7 @@
_ZN13VideoServicesD2Ev @ 19 NONAME
_ZN18QVideoPlayerEngine10handleQuitEv @ 20 NONAME
_ZN18QVideoPlayerEngine10initializeEv @ 21 NONAME
- _ZN18QVideoPlayerEngine10loadPluginEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 22 NONAME
+ _ZN18QVideoPlayerEngine23loadPluginAndCreateViewEN16MpxHbVideoCommon18MpxHbVideoViewTypeE @ 22 NONAME
_ZN18QVideoPlayerEngine11connectViewEv @ 23 NONAME
_ZN18QVideoPlayerEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME
_ZN18QVideoPlayerEngine11qt_metacastEPKc @ 25 NONAME
@@ -44,4 +44,9 @@
_ZTV13VideoServices @ 43 NONAME
_ZTV18QVideoPlayerEngine @ 44 NONAME
_ZN18QVideoPlayerEngine13doDelayedLoadEv @ 45 NONAME
+ _ZN18QVideoPlayerEngine9playMediaE5RFile @ 46 NONAME
+ _ZN13VideoServices13browsingEndedEv @ 47 NONAME
+ _ZNK13VideoServices17getBrowseCategoryEv @ 48 NONAME
+ _ZN18QVideoPlayerEngine25createPlayAndDetailsViewsEv @ 49 NONAME
+ _ZN18QVideoPlayerEngine14setCurrentViewEv @ 50 NONAME
--- a/videoplayerapp/hbvideoplayer/hbvideoplayer.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/hbvideoplayer/hbvideoplayer.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: 15 %
+# Version : %version: da1mmcf#16 %
TARGET = videoplayer
@@ -50,4 +50,29 @@
VPATH += src
SOURCES += main.cpp
-
+
+RSS_RULES += \
+" datatype_list = " \
+" { " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/avi\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/msvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-msvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-pn-realvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/vnd.rn-realvideo\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/vnd.rn-realmedia\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"application/x-pn-realmedia\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"audio/x-pn-realaudio-plugin\"; }, " \
+" DATATYPE { priority=EDataTypePrioritySystem; type=\"video/x-matroska\"; }, " \
+" 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\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp2\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/3gpp\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mp4\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/x-m4v\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"video/mpeg4\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/ram\"; }, " \
+" DATATYPE { priority=EDataTypePriorityHigh; type=\"application/sdp\"; } " \
+" }; " \
--- a/videoplayerapp/hbvideoplayer/resources/service_conf.xml Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/hbvideoplayer/resources/service_conf.xml Mon May 03 12:32:50 2010 +0300
@@ -12,5 +12,15 @@
<name>IVideoView</name>
<version>1.0</version>
<description>Interface to play a video</description>
- </interface>
+ </interface>
+ <interface>
+ <name>com.nokia.symbian.IFileView</name>
+ <version>1.0</version>
+ <description>Interface for playing video given a QFile</description>
+ </interface>
+ <interface>
+ <name>IVideoBrowse</name>
+ <version>1.0</version>
+ <description>Interface to browse categorized video content</description>
+ </interface>
</service>
Binary file videoplayerapp/hbvideoplayer/sis/Nokia_RnDCert_02.der has changed
--- a/videoplayerapp/hbvideoplayer/sis/Nokia_RnDCert_02.key Fri Apr 16 14:59:52 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-----
--- a/videoplayerapp/hbvideoplayer/sis/videoplayer_stub.pkg Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/hbvideoplayer/sis/videoplayer_stub.pkg Mon May 03 12:32:50 2010 +0300
@@ -31,8 +31,6 @@
;
"" - "z:\sys\bin\vcxmyvideoscollectionplugin.dll"
"" - "z:\resource\plugins\vcxmyvideoscollectionplugin.r*"
-"" - "z:\sys\bin\vcxconnectionutility.dll"
-"" - "z:\sys\bin\vcxconnutilpsworker.exe"
;
; Playback Plugin
--- a/videoplayerapp/hbvideoplayer/sis/videoplayer_udeb.pkg Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/hbvideoplayer/sis/videoplayer_udeb.pkg Mon May 03 12:32:50 2010 +0300
@@ -39,9 +39,6 @@
"/epoc32/release/armv5/udeb/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
-"/epoc32/release/armv5/udeb/vcxconnectionutility.dll" - "!:/sys/bin/vcxconnectionutility.dll"
-"/epoc32/release/armv5/udeb/vcxconnutilpsworker.exe" - "!:/sys/bin/vcxconnutilpsworker.exe"
-
;
; Playback Plugin
;
--- a/videoplayerapp/hbvideoplayer/sis/videoplayer_urel.pkg Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/hbvideoplayer/sis/videoplayer_urel.pkg Mon May 03 12:32:50 2010 +0300
@@ -39,9 +39,6 @@
"/epoc32/release/armv5/urel/vcxmyvideoscollectionplugin.dll" - "!:/sys/bin/vcxmyvideoscollectionplugin.dll"
"/epoc32/data/z/resource/plugins/vcxmyvideoscollectionplugin.rsc" - "!:/resource/plugins/vcxmyvideoscollectionplugin.rsc"
-"/epoc32/release/armv5/urel/vcxconnectionutility.dll" - "!:/sys/bin/vcxconnectionutility.dll"
-"/epoc32/release/armv5/urel/vcxconnutilpsworker.exe" - "!:/sys/bin/vcxconnutilpsworker.exe"
-
;
; Playback Plugin
;
--- a/videoplayerapp/inc/videoplayerappexport.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: DLL export macro for videoplayer app.
-*
-*/
-
-#ifndef _VIDEOPLAYERAPPEXPORT_H
-#define _VIDEOPLAYERAPPEXPORT_H
-
-// System includes
-#include <qglobal.h>
-
-#ifdef BUILD_VIDEOPLAYERAPP_DLL
- #define VIDEOPLAYERAPP_DLL_EXPORT Q_DECL_EXPORT
-#else
- #define VIDEOPLAYERAPP_DLL_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // _VIDEOPLAYERAPPEXPORT_H
-
-// End of file.
--- a/videoplayerapp/inc/videoplayerengine.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/inc/videoplayerengine.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: ou1cpsw#10 %
+// Version : %version: 12 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
@@ -23,6 +23,8 @@
#include <qobject.h>
#include <mpxviewpluginqt.h>
+#include <f32file.h>
+
#include "mpxhbvideocommondefs.h"
#include "videoplayerappexport.h"
@@ -54,6 +56,7 @@
public:
void initialize();
void playMedia( QString filePath );
+ void playMedia( RFile file );
void setEmbedded();
public slots:
@@ -70,9 +73,13 @@
void switchView();
- void loadPlugin( MpxHbVideoCommon::MpxHbVideoViewType viewType );
+ void loadPluginAndCreateView( MpxHbVideoCommon::MpxHbVideoViewType viewType );
void doDelayedLoad();
+
+ void createPlayAndDetailsViews();
+
+ void setCurrentView();
private:
bool mIsService;
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoembeddedpdlhandler.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Handles Embbeded PDL playback
- *
-*/
-
-// Version : %version: 2 %
-
-
-
-#ifndef __CMPXVIDEOEMBEDDEDPDLHANDLER_H__
-#define __CMPXVIDEOEMBEDDEDPDLHANDLER_H__
-
-//
-// INCLUDES
-//
-#include <e32base.h>
-
-#include <mpxplaybackframeworkdefs.h>
-#include <mpxplaybackcommanddefs.h>
-
-//
-// FORWARD DECLARATIONS
-//
-class CMpxVideoPlayerAppUiEngine;
-
-//
-// CLASS DECLARATION
-//
-
-/*
- * Process PDL commands passed in by other applications.
- *
- * @lib mpxvideo.exe
- * @since 9.2 time box
- */
-class CMpxVideoEmbeddedPdlHandler : public CBase
-{
- public: // Constructors and destructor
-
- /*
- * Two-phased constructor.
- *
- * @since 9.2
- * @param aPlaybackUtility Playback utility to use.
- * @return Pointer to newly created object.
- */
- static CMpxVideoEmbeddedPdlHandler* NewL( CMpxVideoPlayerAppUiEngine* aAppUiEngine );
-
- /*
- * Destructor.
- */
- virtual ~CMpxVideoEmbeddedPdlHandler();
-
- public:
-
- void ConnectToEmbeddedDownloadL( TInt aDlId, TDesC& aFileName );
- void ConnectToCollectionDownloadL( TInt aDlId, TDesC& aFileName );
-
- void ActivatePdlPlaybackViewL();
-
- private:
-
- /*
- * C++ Constructor
- */
- CMpxVideoEmbeddedPdlHandler( CMpxVideoPlayerAppUiEngine* aAppUiEngine );
-
- /*
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
- private: // New functions
-
- void SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd, TInt aData );
-
- void StartNewDownloadL( TInt aDlId, TDesC& aFileName );
-
- private:
-
- CMpxVideoPlayerAppUiEngine* iAppUiEngine;
-
- TInt iDownloadId;
- HBufC* iDownloadFileName;
-};
-
-#endif // __CMPXVIDEOEMBEDDEDPDLHANDLER_H__
-
-// End of File
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoplaybackwrapper.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/mpxvideoplaybackwrapper.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
@@ -25,7 +25,7 @@
#include <QObject>
#include <QString>
#include <QFile>
-
+#include <f32file.h>
#include "mpxhbvideocommondefs.h"
class CMpxVideoPlayerAppUiEngine;
@@ -39,11 +39,13 @@
virtual ~QMpxVideoPlaybackWrapper();
int playMedia( QString aFileName );
+ int playMedia( RFile aFile );
void openPlaybackView() ;
- void lateInit();
+ void lateInit();
private:
void initializePlugins();
+ int openFileWithNativePath(const TDesC& aFileName);
signals:
void handlePlaybackView( int viewId );
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
@@ -34,10 +34,8 @@
#include <mpxcollectionobserver.h>
#include <mpxcollectionuihelperobserver.h>
-class CMpxVideoEmbeddedPdlHandler;
class CMPXCommonUiHelper;
class MMPXCollectionUiHelper;
-class CAiwGenericParamList;
class CVideoPlaylistUtility;
class QMpxVideoPlaybackWrapper;
@@ -71,16 +69,15 @@
* Opens the specified file in response to a corresponding message.
*
* @param aFile File to be opened.
- * @param aParams aiw generic parameters for the file
*/
- void OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams );
-
+ void OpenFileL( const TDesC& aFileName );
+
/**
* Opens the specified file in response to a corresponding message.
*
* @param aFile File to be opened.
- */
- void OpenFileL( const TDesC& aFileName );
+ */
+ void OpenFileL( RFile& aFile );
/**
* Opens the specified mpx media object.
@@ -107,32 +104,10 @@
void PrepareCloseMpxL();
/**
- * Sets AppUiEngine in stand alone "mode"
- */
- void StartStandAloneL();
-
- /**
* Handle media properties.
*/
void DoHandelCollectionMediaL( const CMPXMedia& aMedia );
- /**
- * Steps one level up in collection path
- */
- void StepBackCollectionPathL();
-
- /**
- * Initialize the playback engine with a collection path
- * @param aPath The collection path to create the playlist from
- */
- void InitPlaybackEngineL( CMPXCollectionPath& aPath );
-
- /**
- * Process activation message.
- * @param aMsg reference to activation message
- */
- void ProcessActivationMessageL( const TDesC8 &aMsg );
-
/*
* Handle embedded playback message
* @param aMessageUid message identification uid
@@ -218,34 +193,7 @@
* @param aCategory Type of item to be opened.
*/
void HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory aCategory );
-
- void CreateEmbeddedPdlPlaybackUtilityMemberVariablesL();
-
- /*
- * Handles the "back" button.
- */
- void HandleSoftKeyBackL();
-
- /*
- * Processes shell commands.
- * @param aCommand
- * @param aDocumentName
- * @param aTail
- * @return ETrue if document name exists
- */
- TBool ProcessCommandParametersL( TApaCommand aCommand,
- TFileName& aDocumentName,
- const TDesC8& aTail );
-
- /*
- * Provides the static function for the callback to exit the application
- * Called by CIdle iIdle
- * @since 9.2
- * @param aPtr Pointer to callback class
- * @return KErrNone
- */
- static TInt ExitApplicationL( TAny* aPtr );
-
+
/*
* Late initializatoin of members that can be delayed
* to help improve startup time
@@ -282,38 +230,17 @@
*/
void HandleUrlDesL(const TDesC& aUrl);
- TPtrC GetLinkLC( const TDesC& aFileName,
- CMediaRecognizer::TMediaType aMediaType,
- TBool aUseFileHandle = EFalse );
-
- TInt HandleAiwGenericParamListL( const CAiwGenericParamList* aParams );
-
- /**
- * Handle collection message
- *
- * @param aMessage collection message
- */
+ /**
+ * Handle collection message
+ *
+ * @param aMessage collection message
+ */
void DoHandleCollectionMessageL( CMPXMessage* aMessage );
- void CreatePlaybackUtilityMemberVariablesL();
+ void CreatePlaybackUtilityL();
void CreateCollectionUtilityMemberVariablesL();
-
- void CreateRemoteControlListenerL();
-
- /*
- * Activates an active object to exit the application
- * @since 5.0
- */
- void ActivateExitActiveObject();
-
- /*
- * Called to stop and exit the application
- * @since 9.2
- * @return void
- */
- virtual void DoExitApplicationL();
-
+
/*
* used to send media info to plugin
*/
@@ -327,15 +254,12 @@
// Owned Utilities
//
MMPXPlaybackUtility* iPlaybackUtility;
- //Do we need this? MMPXViewUtility* iViewUtility;
MMPXCollectionUtility* iCollectionUtility;
MMPXCollectionUiHelper* iCollectionUiHelper; // own
TUid iVideoCollectionId;
- CIdle* iExitAo;
CMediaRecognizer* iRecognizer; // own
- CMpxVideoEmbeddedPdlHandler* iPdlHandler; // own
TInt iAccessPointId;
TBool iMultilinkPlaylist;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/inc/videoservicebrowse.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: VideoServiceBrowse class definition
+*
+*/
+
+// Version : %version: %
+
+#ifndef VIDEOSERVICEBROWSE_H
+#define VIDEOSERVICEBROWSE_H
+
+//INCLUDES
+#include <xqserviceprovider.h>
+
+// FORWARD DECLARATIONS
+class VideoServices;
+
+class VideoServiceBrowse : public XQServiceProvider
+{
+ Q_OBJECT
+
+public:
+ VideoServiceBrowse( VideoServices *parent = 0 );
+ ~VideoServiceBrowse();
+
+public:
+
+ /**
+ * Complete pending service request
+ *
+ * @param None
+ * @return None
+ */
+ void complete();
+
+ /**
+ * Get current browsing category
+ *
+ * @param None
+ * @return VideoServices::TVideoCategory
+ */
+ int getBrowseCategory() const;
+
+ /**
+ * Return context title of videos application
+ *
+ * @param None
+ * @return QString
+ */
+ QString contextTitle() const;
+
+public slots:
+
+ /**
+ * Browse video
+ *
+ * @param title, Title of the embedded Videos application
+ * @param category, Category which type of videos are browsed
+ * @return None
+ */
+ void browseVideos( const QString &title, int category );
+
+private:
+ /** request index of the service */
+ int mRequestIndex;
+
+ /** reference to VideoServices instance */
+ VideoServices *mServiceApp;
+
+ /** current browsing category */
+ int mCategory;
+
+ /** title of the service client, if not set "Videos" is used */
+ QString mTitle;
+};
+
+#endif//VIDEOSERVICEBROWSE_H
--- a/videoplayerapp/videoplayerengine/inc/videoservices.h Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: VideoServices class definition
-*
-*/
-
-#ifndef __VIDEOSERVICES_H__
-#define __VIDEOSERVICES_H__
-
-#include <QStringList>
-#include "videoplayerappexport.h"
-
-//FORWARD CLASS DECLARATION
-class VideoServiceUriFetch;
-class VideoServicePlay;
-class QVideoPlayerEngine;
-
-class VIDEOPLAYERAPP_DLL_EXPORT VideoServices : public QObject
-{
- Q_OBJECT
-
-public:
-
- /**
- * Returns singleton instance for this class.
- *
- * WARNING! Not safe to call this from destructor of another function scope static object!
- *
- * @return The singleton instance.
- */
- static VideoServices *instance(QVideoPlayerEngine* engine = 0);
-
- /**
- * Decreases the reference count, when count reaches zero cleanup is done.
- *
- */
- void decreaseReferenceCount();
-
- /**
- * Returns the context title set by service requestee
- *
- * @return QString the title
- *
- */
- QString contextTitle() const;
-
- /*
- * Enum reflecting the services provided
- */
- enum TVideoService
- {
- ENoService,
- EUriFetcher,
- EPlayback
- };
-
- /**
- * Returns service active status
- *
- * @return bool true if active, false if not active
- *
- */
- VideoServices::TVideoService currentService();
-
-public slots:
- void itemSelected(const QString& item);
-
-signals:
- /*
- * Emitted when service user has set the title
- */
- void titleReady(const QString& title);
-
- /*
- * Emitted to acticate requested plugin
- */
- void activated(int command);
-
-private:
-
- /**
- * Constructor
- */
- VideoServices();
-
- /**
- * Constructor
- */
- VideoServices(QVideoPlayerEngine* engine);
-
- /**
- * Destructor.
- */
- virtual ~VideoServices();
-
- void setEngine(QVideoPlayerEngine* engine);
-
- /**
- * Sets the active service
- *
- * @param service
- *
- */
- void setCurrentService(VideoServices::TVideoService service);
-
- /**
- * Returns the current engine
- *
- * @return engine
- *
- */
- QVideoPlayerEngine* engine();
-
- Q_DISABLE_COPY(VideoServices)
-
-private:
-
- /**
- * Reference count.
- */
- int mReferenceCount;
-
- /**
- * Singleton instance.
- */
- static VideoServices* mInstance;
-
- /**
- * VideoServiceUriFetch service instance.
- */
- VideoServiceUriFetch* mServiceUriFetch;
-
- /**
- * VideoServicePlay service instance.
- */
- VideoServicePlay* mServicePlay;
-
- /**
- * Pointer of QVideoPlayerEngine.
- */
- QVideoPlayerEngine* mEngine;
-
- /*
- * Current service
- */
- VideoServices::TVideoService mCurrentService;
-
- friend class VideoServiceUriFetch;
-
- friend class VideoServicePlay;
- };
-
-#endif //__VIDEOSERVICES_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/inc/videoserviceview.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Declaration of VideoServiceView
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOSERVICEVIEW_H__
+#define __VIDEOSERVICEVIEW_H__
+
+#include <xqserviceprovider.h>
+#include <QObject>
+#include <xqsharablefile.h>
+
+// FORWARD DECLARATIONS
+class VideoServices;
+class QVideoPlayerEngine;
+class QFile;
+
+class VideoServiceView : public XQServiceProvider
+ {
+
+ Q_OBJECT
+
+ public:
+ VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine );
+ virtual ~VideoServiceView();
+
+ void setEngine( QVideoPlayerEngine* engine );
+
+ public slots:
+ bool view( QString file );
+ bool view (XQSharableFile file);
+
+ private:
+ QVideoPlayerEngine* mEngine;
+ VideoServices* mServiceApp;
+
+
+ };
+
+#endif //__VIDEOSERVICEVIEW_H__
+
--- a/videoplayerapp/videoplayerengine/src/mpxvideoembeddedpdlhandler.cpp Fri Apr 16 14:59:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Handles PDL commands passed in by other appilcations
- *
-*/
-
-// Version : %version: 2 %
-
-
-
-#include <mpxcommand.h>
-#include <mpxcommandgeneraldefs.h>
-#include <mpxmessagegeneraldefs.h>
-#include <mpxplaybackmessage.h>
-#include <mpxplaybackutility.h>
-#include <mpxmediageneraldefs.h>
-
-#include <mpxviewutility.h>
-#include <mpxviewpluginmanager.h>
-#include <mpxviewplugin.h>
-#include <mpxvideoplaybackdefs.h>
-
-#include "mpxvideoembeddedpdlhandler.h"
-#include "mpxvideoplayerappuiengine.h"
-#include "mpxvideoplayerconstants.h"
-#include "mpxvideo_debug.h"
-
-CMpxVideoEmbeddedPdlHandler*
-CMpxVideoEmbeddedPdlHandler::NewL( CMpxVideoPlayerAppUiEngine* aAppUiEngine )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::NewL()"));
-
- CMpxVideoEmbeddedPdlHandler* self = new ( ELeave ) CMpxVideoEmbeddedPdlHandler( aAppUiEngine );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
-}
-
-// -------------------------------------------------------------------------------------------------
-// C++ constructor can NOT contain any code that might leave.
-// -------------------------------------------------------------------------------------------------
-//
-CMpxVideoEmbeddedPdlHandler::CMpxVideoEmbeddedPdlHandler( CMpxVideoPlayerAppUiEngine* aAppUiEngine )
- : iAppUiEngine( aAppUiEngine )
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// Destructor.
-// -------------------------------------------------------------------------------------------------
-//
-CMpxVideoEmbeddedPdlHandler::~CMpxVideoEmbeddedPdlHandler()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::~CMpxVideoEmbeddedPdlHandler()"));
-
- if ( iDownloadFileName )
- {
- delete iDownloadFileName;
- iDownloadFileName = NULL;
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// Symbian 2nd phase constructor can leave.
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoEmbeddedPdlHandler::ConstructL()
-{
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL( TInt aDlId, TDesC& aFileName )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ConnectToEmbeddedDownloadL()"),
- _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName );
-
- if ( iDownloadFileName )
- {
- //
- // Check if this is the same download that is loaded
- // If it is, issue a play command to resume playback
-
- if ( ( aDlId == iDownloadId ) && ( ! aFileName.Compare( *iDownloadFileName ) ) )
- {
- iAppUiEngine->PlaybackUtility()->CommandL( EPbCmdPlay );
- }
- else
- {
- //
- // New download received, close old playback plugin
- //
- iAppUiEngine->PlaybackUtility()->CommandL( EPbCmdClose );
-
- StartNewDownloadL( aDlId, aFileName );
- }
- }
- else
- {
- StartNewDownloadL( aDlId, aFileName );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL( TInt aDlId, TDesC& aFileName )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::ConnectToCollectionDownloadL()"),
- _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName );
-
- //
- // The playback plugin will not be loaded for collection downloads
- //
- StartNewDownloadL( aDlId, aFileName );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoEmbeddedPdlHandler::StartNewDownloadL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoEmbeddedPdlHandler::StartNewDownloadL( TInt aDlId, TDesC& aFileName )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::StartNewDownloadL()"),
- _L("aDlId = %d, aFileName = %S"), aDlId, &aFileName );
-
- //
- // Save the download parameters
- //
- iDownloadId = aDlId;
- delete iDownloadFileName;
- iDownloadFileName = NULL;
- iDownloadFileName = aFileName.AllocL();
-
- //
- // Create the Playback Utility
- //
- iAppUiEngine->CreateEmbeddedPdlPlaybackUtilityMemberVariablesL();
-
- SendPdlCustomCommandL( EPbCmdStartPd, iDownloadId );
-
- iAppUiEngine->PlaybackUtility()->InitL( *iDownloadFileName );
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL()
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL( TMPXPlaybackPdCommand aCustomCmd,
- TInt aData )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoEmbeddedPdlHandler::SendPdlCustomCommandL"),
- _L("aCustomCmd = %d, aData = %d"), aCustomCmd, aData );
-
- CMPXCommand* cmd = CMPXCommand::NewL();
- CleanupStack::PushL( cmd );
-
- cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
- cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackPD );
- cmd->SetTObjectValueL<TMPXPlaybackPdCommand>( KMPXCommandPlaybackGeneralType, aCustomCmd );
- cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackPDTransactionID, aData );
- cmd->SetTextValueL( KMPXMediaVideoPlaybackFileName, *iDownloadFileName );
- cmd->SetTObjectValueL<TInt>( KMPXMediaVideoMovePdlFile, ETrue );
-
- iAppUiEngine->PlaybackUtility()->CommandL( *cmd );
-
- CleanupStack::PopAndDestroy( cmd );
-}
-
-// EOF
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplaybackwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
#include "mpxvideo_debug.h"
@@ -67,10 +67,25 @@
//
int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
{
- MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playMedia"));
+ MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playMedia"));
+
+ TBuf<KMaxFileName> filename( aFileName.utf16() );
+ int error = openFileWithNativePath( filename );
+
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia err = %d"), error);
+
+ return error;
+}
- TBuf<KMaxFileName> filename( aFileName.utf16() );
- TRAPD( error, mUiEngine->OpenFileL( filename ) );
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int QMpxVideoPlaybackWrapper::playMedia( RFile aFile )
+{
+ MPX_ENTER_EXIT(_L("QMpxVideoPlaybackWrapper::playMedia"));
+
+ TRAPD( error, mUiEngine->OpenFileL( aFile ) );
MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia err = %d"), error);
@@ -99,4 +114,56 @@
TRAP_IGNORE( mUiEngine->LateInitL() );
}
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::openFileWithNativePath()
+// -------------------------------------------------------------------------------------------------
+//
+int QMpxVideoPlaybackWrapper::openFileWithNativePath(const TDesC& aFileName)
+{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::openFileWithNativePath()"));
+
+ int err = KErrNone;
+
+ int fwdSlashPos = aFileName.LocateF('/');
+
+ if( fwdSlashPos == KErrNotFound )
+ {
+ // no fwd slashes found => filepath is already in
+ // preferred format eg. c:\\data\\videos\\test.3gp
+ //
+ TRAP( err, mUiEngine->OpenFileL( aFileName ) );
+ }
+ else
+ {
+ HBufC* fileName = NULL;
+
+ TRAP( err, fileName = aFileName.AllocL() );
+
+ if ( err == KErrNone )
+ {
+ int count( fileName->Des().Length() );
+
+ for ( int j = fwdSlashPos ; j < count; ++j )
+ {
+ if ( fileName->Des()[j]== '/' )
+ {
+ fileName->Des()[j]='\\';
+ }
+ }
+
+ }
+
+ TRAP( err, mUiEngine->OpenFileL( fileName->Des() ) );
+
+ if ( fileName )
+ {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+
+ return err;
+}
+
+
// End of File
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 5 %
+// Version : %version: 7 %
@@ -30,21 +30,18 @@
#include <vcxmyvideosdefs.h>
#include <mpxcollectionpath.h>
#include <videoplayeractivationmessage.h>
-#include <AiwGenericParam.h>
#include <mpxcollectionuihelper.h>
#include <mpxcollectionhelperfactory.h>
#include <mpxcollectionplugin.hrh>
#include <mpxmediageneralextdefs.h>
#include <mmf/common/mmfcontrollerframeworkbase.h>
-#include <streaminglinkmodel.h>
#include <coeutils.h>
#include <videoplaylistutility.h>
#include <mpxvideoplaybackdefs.h>
#include "mpxvideoplayerappuiengine.h"
#include "mpxvideoplayerconstants.h"
-#include "mpxvideoembeddedpdlhandler.h"
#include "mpxvideoplaybackwrapper.h"
#include "mpxhbvideocommondefs.h"
@@ -57,7 +54,6 @@
CMpxVideoPlayerAppUiEngine::CMpxVideoPlayerAppUiEngine( QMpxVideoPlaybackWrapper* aWrapper )
: iPlaybackUtility( NULL ),
iCollectionUtility( NULL ),
- iExitAo( NULL ),
iRecognizer( NULL ),
iAccessPointId( KUseDefaultIap ),
iMultilinkPlaylist( EFalse ),
@@ -100,11 +96,9 @@
//
void CMpxVideoPlayerAppUiEngine::LateInitL()
{
- CreatePlaybackUtilityMemberVariablesL();
+ CreatePlaybackUtilityL();
- iRecognizer = CMediaRecognizer::NewL();
-
- iExitAo = CIdle::NewL( CActive::EPriorityStandard );
+ iRecognizer = CMediaRecognizer::NewL();
}
// -------------------------------------------------------------------------------------------------
@@ -128,12 +122,12 @@
}
// -------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerAppUiEngine::CreatePlaybackUtilityMemberVariablesL
+// CMpxVideoPlayerAppUiEngine::CreatePlaybackUtilityL
// -------------------------------------------------------------------------------------------------
//
-void CMpxVideoPlayerAppUiEngine::CreatePlaybackUtilityMemberVariablesL()
+void CMpxVideoPlayerAppUiEngine::CreatePlaybackUtilityL()
{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::CreatePlaybackUtilityMemberVariablesL()"));
+ MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::CreatePlaybackUtilityL()"));
if ( ! iPlaybackUtility )
{
@@ -149,17 +143,6 @@
}
// -------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerAppUiEngine::CreateEmbeddedPdlPlaybackUtilityMemberVariablesL
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerAppUiEngine::CreateEmbeddedPdlPlaybackUtilityMemberVariablesL()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::CreateEmbeddedPdlPlaybackUtilityMemberVariablesL()"));
-
- CreatePlaybackUtilityMemberVariablesL();
-}
-
-// -------------------------------------------------------------------------------------------------
// CMpxVideoPlayerAppUiEngine::~CMpxVideoPlayerAppUiEngine
// -------------------------------------------------------------------------------------------------
//
@@ -167,24 +150,12 @@
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::~CMpxVideoPlayerAppUiEngine()"));
- if ( iExitAo )
- {
- delete iExitAo;
- iExitAo = NULL;
- }
-
if ( iRecognizer )
{
delete iRecognizer;
iRecognizer = NULL;
}
- if ( iPdlHandler )
- {
- delete iPdlHandler;
- iPdlHandler = NULL;
- }
-
if ( iCollectionUtility )
{
iCollectionUtility->Close();
@@ -228,145 +199,39 @@
{
}
-// ---------------------------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL()
-// ---------------------------------------------------------------------------------------------------------------------
-//
-TInt CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL( const CAiwGenericParamList* aParams )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL()"));
-
- TInt retVal = KErrNone;
-
- TInt index = 0;
-
- //
- // Check if there is a terminate message. If it exists, exit the application.
- //
- TInt32 terminateID = 0;
-
- const TAiwGenericParam* paramTerminate =
- aParams->FindFirst( index, EGenericParamTerminate, EVariantTypeTInt32 );
-
- if ( paramTerminate )
- {
- paramTerminate->Value().Get( terminateID );
- }
-
- if ( terminateID )
- {
- MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::HandleAiwGenericParamListL() Terminate message received"));
-
- //
- // Embedded app is being closed
- //
-
- //
- // Workaround. Will handle it once AIW gets supported
- //
- //iAppUi->HandleCommandL( EEikCmdExit );
-
- retVal = KErrCancel;
- }
- else
- {
- //
- // Determine if these parameters are for PDL
- //
- index = 0;
- TInt32 dlId = KErrNotFound;
-
- const TAiwGenericParam* genParamDlId =
- aParams->FindFirst( index, EGenericParamDownloadId, EVariantTypeTInt32 );
-
- if ( genParamDlId )
- {
- genParamDlId->Value().Get( dlId );
-
- index = 0;
-
- const TAiwGenericParam* paramFileName =
- aParams->FindFirst( index, EGenericParamFile, EVariantTypeDesC );
-
- TPtrC fileName;
-
- //
- // Set the filename. The LWPlayerAppUi checks for the
- // filename and exits if it doesn't exist
- //
- fileName.Set( paramFileName->Value().AsDes() );
-
- if ( ! iPdlHandler )
- {
- iPdlHandler = CMpxVideoEmbeddedPdlHandler::NewL( this );
- }
-
- iPdlHandler->ConnectToEmbeddedDownloadL( dlId, fileName );
- }
- else
- {
- //
- // Check Access Point
- //
- index = 0;
-
- const TAiwGenericParam* genParamAccessPoint =
- aParams->FindFirst( index, EGenericParamAccessPoint, EVariantTypeTInt32 );
-
- if ( index >= 0 && genParamAccessPoint )
- {
- TInt32 apId = KErrUnknown;
- genParamAccessPoint->Value().Get( apId );
- iAccessPointId = apId;
- }
- }
- }
-
- return retVal;
-}
-
// -------------------------------------------------------------------------------------------------
// CMpxVideoPlayerAppUiEngine::OpenFileL
// -------------------------------------------------------------------------------------------------
//
-void CMpxVideoPlayerAppUiEngine::OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams )
+void CMpxVideoPlayerAppUiEngine::OpenFileL( RFile& aFile )
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::OpenFileL(RFile)"));
- TInt err = KErrNone;
-
- if ( aParams )
- {
- err = HandleAiwGenericParamListL( aParams );
- }
+ TFileName filename;
+ aFile.FullName(filename);
- if ( KErrNone == err && ! iPdlHandler )
- {
- TFileName filename;
- aFile.FullName(filename);
-
- CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL( filename, aFile );
+ CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL( filename, aFile );
- if ( mediaType == CMediaRecognizer::ELocalRamFile ||
- mediaType == CMediaRecognizer::ELocalAsxFile )
- {
- HandleMultiLinksFileL( aFile, mediaType );
- }
- else if ( mediaType == CMediaRecognizer::ELocalSdpFile )
- {
- iPlaybackUtility->InitStreamingL( aFile, iAccessPointId );
- }
- else
- {
- iPlaybackUtility->InitL( aFile );
- }
+ if ( mediaType == CMediaRecognizer::ELocalRamFile ||
+ mediaType == CMediaRecognizer::ELocalAsxFile )
+ {
+ HandleMultiLinksFileL( aFile, mediaType );
}
+ else if ( mediaType == CMediaRecognizer::ELocalSdpFile )
+ {
+ iPlaybackUtility->InitStreamingL( aFile, iAccessPointId );
+ }
+ else
+ {
+ iPlaybackUtility->InitL( aFile );
+ }
iRecognizer->FreeFilehandle();
aFile.Close();
}
+
// -------------------------------------------------------------------------------------------------
// CMpxVideoPlayerAppUiEngine::OpenFileL
// -------------------------------------------------------------------------------------------------
@@ -374,8 +239,8 @@
void CMpxVideoPlayerAppUiEngine::OpenFileL( const TDesC& aFileName )
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::OpenFileL()"),
- _L("aFileName = %S"), &aFileName);
-
+ _L("aFileName = %S"), &aFileName);
+
CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL(aFileName);
if ( mediaType == CMediaRecognizer::ELocalVideoFile )
@@ -519,35 +384,6 @@
}
// -------------------------------------------------------------------------------------------------
-// Sets AppUiEngine in stand alone "mode"
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerAppUiEngine::StartStandAloneL()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::StartStandAloneL()"));
-
- //
- // Create the utilities for the stand alone player
- //
- CreatePlaybackUtilityMemberVariablesL();
-
- // Fetch the video collection UID
- RArray<TUid> uid;
- CleanupClosePushL( uid );
-
- uid.AppendL( TUid::Uid( KVcxMediaIdMyVideos ) );
-
- iVideoCollectionId = iCollectionUtility->CollectionIDL( uid.Array() );
-
- CleanupStack::PopAndDestroy( &uid );
-
- //
- // Workaround. Don't use mpx view utility yet
- //
- // iViewUtility->SetAsDefaultViewL( KUidMyVideosViewType );
-}
-
-// -------------------------------------------------------------------------------------------------
// Handle collection message
// -------------------------------------------------------------------------------------------------
//
@@ -590,10 +426,6 @@
attribs.Append( KVcxMediaMyVideosDownloadId );
iCollectionUtility->Collection().MediaL( *cPath, attribs.Array() );
- // Create the playlist
- // Create proper playlist
- // InitPlaybackEngineL( *cPath );
-
CleanupStack::PopAndDestroy( &attribs );
}
@@ -645,81 +477,20 @@
MPX_DEBUG(_L("Video URI: %S"), &fileUri );
- if ( aMedia.IsSupported( KVcxMediaMyVideosDownloadId ) &&
- aMedia.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId ) != 0 )
- {
- TUint32 dlId = aMedia.ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId );
+ //OpenMediaL( aMedia ); // Initialize and initiate playback of a single video
- if ( ! iPdlHandler )
- {
- iPdlHandler = CMpxVideoEmbeddedPdlHandler::NewL( this );
- }
-
- iPdlHandler->ConnectToCollectionDownloadL( dlId, const_cast<TDesC&>( fileUri ) );
- }
+ TPtrC mediaFile( aMedia.ValueText( KMPXMediaGeneralUri ) );
+ CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL(mediaFile);
+
+ if ( mediaType == CMediaRecognizer::ELocalRamFile ||
+ mediaType == CMediaRecognizer::ELocalAsxFile )
+ {
+ HandleMultiLinksFileL( mediaFile, mediaType );
+ }
else
{
- //OpenMediaL( aMedia ); // Initialize and initiate playback of a single video
-
- TPtrC mediaFile( aMedia.ValueText( KMPXMediaGeneralUri ) );
- CMediaRecognizer::TMediaType mediaType = iRecognizer->IdentifyMediaTypeL(mediaFile);
-
- if ( mediaType == CMediaRecognizer::ELocalRamFile ||
- mediaType == CMediaRecognizer::ELocalAsxFile )
- {
- HandleMultiLinksFileL( mediaFile, mediaType );
- }
- else
- {
- OpenMediaL( aMedia ); // Initialize and initiate playback of a single video
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// Steps back one level back in collection path. Will activate previous view if level exists
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerAppUiEngine::StepBackCollectionPathL()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::StepBackCollectionPathL()"));
-
- // Back the collection path one level...
-
- CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL();
- CleanupStack::PushL( cPath );
-
- // Don't back up if there are no more levels or will panic
- if ( cPath->Levels() > 1 )
- {
- cPath->Back();
- iCollectionUtility->Collection().OpenL( *cPath );
-
- //
- // Workaround. Don't use mpx view utility yet
- //
- // iViewUtility->ActivatePreviousViewL();
- }
-
- CleanupStack::PopAndDestroy( cPath );
-}
-
-// -------------------------------------------------------------------------------------------------
-// Initialize the playback engine with a collection path
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerAppUiEngine::InitPlaybackEngineL( CMPXCollectionPath& aPath )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::InitPlaybackEngineL()"));
-
- // Create a playlist with the current collection path
- CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL( aPath );
- CleanupStack::PushL( playlist );
-
- playlist->SetSingleItemPlaylist();
- iPlaybackUtility->InitL( *playlist, ETrue );
-
- CleanupStack::PopAndDestroy( playlist );
+ OpenMediaL( aMedia ); // Initialize and initiate playback of a single video
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -841,95 +612,16 @@
}
// -------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerAppUiEngine::ProcessActivationMessageL
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerAppUiEngine::ProcessActivationMessageL( const TDesC8 &aMsg )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ProcessActivationMessageL()"));
-
- if ( aMsg.Length() < KVideoPlayerActivationMessageMinLength )
- {
- User::Leave( KErrNotSupported );
- }
-
- TVideoPlayerActivationMessage msgHandler;
- TPckg<TVideoPlayerActivationMessage> paramsPckg( msgHandler );
- paramsPckg.Copy( aMsg );
-
- if ( msgHandler.iMsgType == TVideoPlayerActivationMessage::ELaunchVideoToPlayer )
- {
- // Launch video to player, it can be either local video or stream.
-
- // If there's path and mpx id,
- // clip can be played directly.
- if ( msgHandler.iServiceId &&
- msgHandler.iFullPath.Length() > 0 )
- {
- if ( iRecognizer->IdentifyMediaTypeL( msgHandler.iFullPath )
- == CMediaRecognizer::ELocalVideoFile )
- {
- TMPXItemId id;
- id.iId1 = msgHandler.iServiceId;
- CMPXMedia* media = CMPXMedia::NewL();
- CleanupStack::PushL( media );
- media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, id );
- OpenMediaL( *media );
- CleanupStack::PopAndDestroy( media );
- }
- else
- {
- // Most likely the clip has been deleted
- User::Leave( KErrNotFound );
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------------------------------
// CMpxVideoPlayerAppUiEngine::HandleMessageL()
// -------------------------------------------------------------------------------------------------
//
-TBool CMpxVideoPlayerAppUiEngine::HandleMessageL( TUid aMessageUid,
- const TDesC8& aMessageParameters )
+TBool CMpxVideoPlayerAppUiEngine::HandleMessageL( TUid /* aMessageUid */,
+ const TDesC8& /* aMessageParameters */ )
{
MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleMessageL()"));
TBool msgHandled = EFalse;
- switch ( aMessageUid.iUid )
- {
- // TVideoPlayerActivationMessage received.
- case KVideoPlayerVodStartPlayer:
- {
- ProcessActivationMessageL( aMessageParameters );
- msgHandled = ETrue;
- break;
- }
- case KVideoPlayerStartPDlPlayer:
- {
- // Start the PDl
- if ( iPdlHandler )
- {
- CBufFlat* paramBuf = CBufFlat::NewL( 1 );
- CleanupStack::PushL( paramBuf );
- paramBuf->InsertL( 0, aMessageParameters );
- RBufReadStream readStream( *paramBuf );
-
- CAiwGenericParamList* genParamList = CAiwGenericParamList::NewLC( readStream );
-
- HandleAiwGenericParamListL( genParamList );
-
- CleanupStack::PopAndDestroy( genParamList );
- CleanupStack::PopAndDestroy( paramBuf );
-
- msgHandled = ETrue;
- }
-
- break;
- }
- }
-
return msgHandled;
}
@@ -1010,131 +702,14 @@
}
}
-
-
// -------------------------------------------------------------------------------------------------
// From MMPXCHelperEmbeddedOpenObserver
// Handles OpenL from that occured in embedded mode
// -------------------------------------------------------------------------------------------------
//
-void CMpxVideoPlayerAppUiEngine::HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory /*aCategory*/ )
+void CMpxVideoPlayerAppUiEngine::HandleEmbeddedOpenL( TInt /*aErr*/, TMPXGeneralCategory /*aCategory*/ )
{
MPX_DEBUG(_L("CMPXVideoAppUi::HandleEmbeddedOpenL()"));
-
- if ( aErr != KErrNone )
- {
-
- // Kill MPX
- //RunAppShutter();
- }
- else // No error, set the launch mode
- {
- iPlaybackUtility->CommandL( EPbCmdDisableEffect );
- }
-}
-
-
-void CMpxVideoPlayerAppUiEngine::HandleSoftKeyBackL()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::HandleSoftKeyBackL()"));
-
- //
- // if we're in top level of our local view stack,
- // back command exits the app. otherwise activate
- // the previous view in our local view stack
- //
-
- //
- // Workaround. Don't use mpx view utility yet
- //
- // if ( iViewUtility->ViewHistoryDepth() <= 1 )
- if ( ETrue )
- {
- ActivateExitActiveObject();
- }
- else
- {
- StepBackCollectionPathL();
- }
-}
-
-TBool CMpxVideoPlayerAppUiEngine::ProcessCommandParametersL( TApaCommand aCommand,
- TFileName& aDocumentName,
- const TDesC8& aTail )
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ProcessCommandParametersL()"));
-
- TBool retVal = EFalse;
-
- //
- // If command line has tail, this is probably a message from Matrix, Live TV
- // reminder, Video Center soft notification, or other VC component.
- //
- if ( aTail.Length() > 0 )
- {
- ProcessActivationMessageL( aTail );
- }
- else
- {
- //
- // If we are embedded or the command is to open a document
- //
-
- //
- // Workaround. Embedded doesn't work yet
- //
- // if ( iAppUi->IsEmbedded() || aCommand != EApaCommandRun )
- if ( aCommand != EApaCommandRun )
- {
- if ( iRecognizer->IsValidStreamingPrefix( aDocumentName ) )
- {
- retVal = ETrue;
- }
- else
- {
- retVal = ConeUtils::FileExists( aDocumentName );
- }
- }
- else
- {
- StartStandAloneL();
- }
- }
-
- return retVal;
-}
-
-void CMpxVideoPlayerAppUiEngine::ActivateExitActiveObject()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::ActivateExitActiveObject()"));
-
- if ( ! iExitAo->IsActive() )
- {
- iExitAo->Start( TCallBack( CMpxVideoPlayerAppUiEngine::ExitApplicationL, this ) );
- }
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerAppUiEngine::ExitApplicationL
-// -------------------------------------------------------------------------------------------------
-//
-TInt CMpxVideoPlayerAppUiEngine::ExitApplicationL( TAny* aPtr )
-{
- MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ExitApplicationL()"));
-
- static_cast<CMpxVideoPlayerAppUiEngine*>(aPtr)->DoExitApplicationL();
- return KErrNone;
-}
-
-// -------------------------------------------------------------------------------------------------
-// CMpxVideoPlayerAppUiEngine::DoExitApplicationL
-// -------------------------------------------------------------------------------------------------
-//
-void CMpxVideoPlayerAppUiEngine::DoExitApplicationL()
-{
- MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoExitApplicationL()"));
-
- /*iAppUi->HandleCommandL( EEikCmdExit );*/
}
// -------------------------------------------------------------------------------------------------
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 23 %
+// Version : %version: da1mmcf#25 %
#include <QApplication>
@@ -35,17 +35,18 @@
// QVideoPlayerEngine()
// -------------------------------------------------------------------------------------------------
//
-QVideoPlayerEngine::QVideoPlayerEngine(bool isService)
+QVideoPlayerEngine::QVideoPlayerEngine( bool isService )
: mIsService( isService )
- , mEmbedded(false)
- , mDelayedLoadDone(false)
+ , mEmbedded( false )
+ , mDelayedLoadDone( false )
, mCurrentViewPlugin( 0 )
, mPlaybackViewPlugin( 0 )
, mCollectionViewPlugin( 0 )
, mFileDetailsViewPlugin( 0 )
, mPlaybackWrapper( 0 )
- , mVideoServices(0)
+ , mVideoServices( 0 )
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::QVideoPlayerEngine()"));
}
// -------------------------------------------------------------------------------------------------
@@ -90,6 +91,7 @@
void QVideoPlayerEngine::initialize()
{
MPX_ENTER_EXIT(_L("QVideoPlayerEngine::initialize()"));
+
//
// Clean up QVideoPlayerEngine when qApp try to quit
//
@@ -120,29 +122,27 @@
XQPluginLoader::listImplementations("org.nokia.mmdt.MpxViewPlugin/1.0", impls);
//
- // Pre-load collectionview and playbackview plugins
+ // Pre-load collection plugin and create collection view
//
- loadPlugin( MpxHbVideoCommon::CollectionView );
-
- if ( mCollectionViewPlugin )
- {
- mCollectionViewPlugin->createView();
- hbInstance->allMainWindows().value(0)->addView( mCollectionViewPlugin->getView() );
- }
+ loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
//
- // default view in the app is the collection view.
+ // if app is opened via serviceFW create remaining views
+ // otherwise activate default view i.e. the collection view.
//
- if(!mIsService)
+ if( mIsService )
{
+ createPlayAndDetailsViews();
+ }
+ else
+ {
activateView( MpxHbVideoCommon::CollectionView );
- }
-
+ }
+
// delayed initialization of some uiengine member variables
// to help application startup time & improve playback start time
//
- mPlaybackWrapper->lateInit();
-
+ mPlaybackWrapper->lateInit();
}
// -------------------------------------------------------------------------------------------------
@@ -151,8 +151,9 @@
//
void QVideoPlayerEngine::handleCommand( int commandCode )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleCommand()"));
-
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleCommand()"),
+ _L("commandCode = %d"), commandCode );
+
switch ( commandCode )
{
case MpxHbVideoCommon::ActivateCollectionView:
@@ -201,40 +202,43 @@
//
void QVideoPlayerEngine::doDelayedLoad()
{
- if ( !mPlaybackViewPlugin )
- {
- loadPlugin( MpxHbVideoCommon::PlaybackView );
-
- if ( mPlaybackViewPlugin )
- {
- mPlaybackViewPlugin->createView();
- hbInstance->allMainWindows().value(0)->addView( mPlaybackViewPlugin->getView() );
- }
- }
-
- if ( !mFileDetailsViewPlugin )
- {
- loadPlugin( MpxHbVideoCommon::VideoDetailsView );
-
- if ( mFileDetailsViewPlugin )
- {
- mFileDetailsViewPlugin->createView();
- hbInstance->allMainWindows().value(0)->addView( mFileDetailsViewPlugin->getView() );
- }
- }
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::doDelayedLoad()"));
+
+ createPlayAndDetailsViews();
mDelayedLoadDone = true;
}
// -------------------------------------------------------------------------------------------------
+// createPlayAndDetailsViews()
+// -------------------------------------------------------------------------------------------------
+//
+void QVideoPlayerEngine::createPlayAndDetailsViews()
+{
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::createPlayAndDetailsViews()"));
+
+ if ( ! mPlaybackViewPlugin )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+ }
+
+ if ( ! mFileDetailsViewPlugin )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
+ }
+}
+
+
+// -------------------------------------------------------------------------------------------------
// activateView()
// activate view based on view type.
// -------------------------------------------------------------------------------------------------
//
void QVideoPlayerEngine::activateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::activateView()"));
-
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::activateView() "),
+ _L("viewType = %d"), viewType );
+
disconnectView();
if ( mCurrentViewPlugin )
@@ -245,69 +249,49 @@
if ( viewType == MpxHbVideoCommon::CollectionView && mCollectionViewPlugin )
{
- if ( mIsService && (VideoServices::EPlayback == mVideoServices->currentService()) )
- {
- qApp->quit();
- XQServiceUtil::toBackground(false);
- return;
- }
- else
- {
- mCurrentViewPlugin = mCollectionViewPlugin;
- }
+ if ( mIsService &&
+ ( mVideoServices->currentService() == VideoServices::EPlayback ||
+ mVideoServices->currentService() == VideoServices::EView ) )
+ {
+ qApp->quit();
+ XQServiceUtil::toBackground( false );
+ }
+ else
+ {
+ mCurrentViewPlugin = mCollectionViewPlugin;
+ setCurrentView();
+ }
}
else if ( viewType == MpxHbVideoCommon::PlaybackView )
{
- if(!mPlaybackViewPlugin)
+ if( ! mPlaybackViewPlugin )
{
- loadPlugin( MpxHbVideoCommon::PlaybackView );
- if ( mPlaybackViewPlugin )
- {
- mPlaybackViewPlugin->createView();
- hbInstance->allMainWindows().value(0)->addView( mPlaybackViewPlugin->getView() );
- }
- else
- {
- return;
- }
- }
+ loadPluginAndCreateView( MpxHbVideoCommon::PlaybackView );
+ }
+
mCurrentViewPlugin = mPlaybackViewPlugin;
+ setCurrentView();
}
else if ( viewType == MpxHbVideoCommon::VideoDetailsView )
{
- if(!mFileDetailsViewPlugin)
+ if( ! mFileDetailsViewPlugin )
{
- loadPlugin( MpxHbVideoCommon::VideoDetailsView );
- if ( mFileDetailsViewPlugin )
- {
- mFileDetailsViewPlugin->createView();
- hbInstance->allMainWindows().value(0)->addView( mFileDetailsViewPlugin->getView() );
- }
- else
- {
- return;
- }
+ loadPluginAndCreateView( MpxHbVideoCommon::VideoDetailsView );
}
+
mCurrentViewPlugin = mFileDetailsViewPlugin;
+ setCurrentView();
}
- else
- {
- // invalid plugin activation request, do nothing
- return;
- }
-
- hbInstance->allMainWindows().value(0)->setCurrentView( static_cast<HbView*>( mCurrentViewPlugin->getView() ), false );
- connectView();
- mCurrentViewPlugin->activateView();
}
// -------------------------------------------------------------------------------------------------
-// loadPlugin()
+// loadPluginAndCreateView()
// -------------------------------------------------------------------------------------------------
//
-void QVideoPlayerEngine::loadPlugin( MpxHbVideoCommon::MpxHbVideoViewType viewType )
+void QVideoPlayerEngine::loadPluginAndCreateView( MpxHbVideoCommon::MpxHbVideoViewType viewType )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::loadPlugin()"));
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::loadPluginAndCreateView() "),
+ _L("viewType = %d"), viewType );
int viewTypeUid( 0 );
@@ -326,24 +310,59 @@
if ( viewTypeUid )
{
- // activate the collection view
+ //
+ // load corresponding plug-in
+ //
XQPluginLoader pluginLoader( viewTypeUid );
QObject* instance = pluginLoader.instance();
if ( instance )
{
+ MpxViewPlugin *currentViewPlugin = NULL;
+
if ( viewType == MpxHbVideoCommon::CollectionView )
{
mCollectionViewPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin();
+ currentViewPlugin = mCollectionViewPlugin;
}
else if ( viewType == MpxHbVideoCommon::PlaybackView )
{
mPlaybackViewPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin();
+ currentViewPlugin = mPlaybackViewPlugin;
}
else if ( viewType == MpxHbVideoCommon::VideoDetailsView )
{
mFileDetailsViewPlugin = qobject_cast<MpxViewPlugin*>( instance )->viewPlugin();
+ currentViewPlugin = mFileDetailsViewPlugin;
}
+ else
+ {
+ MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : plugin not FOUND ! "));
+ }
+
+ //
+ // create corresponding view
+ //
+ if ( currentViewPlugin )
+ {
+ QGraphicsWidget *view = currentViewPlugin->getView();
+
+ if ( ! view )
+ {
+ MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : create view "));
+
+ currentViewPlugin->createView();
+ hbInstance->allMainWindows().value(0)->addView( currentViewPlugin->getView() );
+ }
+ else
+ {
+ MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : view has already been created! "));
+ }
+ }
+ else
+ {
+ MPX_DEBUG(_L("QVideoPlayerEngine::loadPluginAndCreateView() : currentViewPlugin is NULL ! "));
+ }
}
}
}
@@ -355,7 +374,7 @@
//
void QVideoPlayerEngine::connectView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::connectView()"));
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::connectView()"));
connect( mCurrentViewPlugin,
SIGNAL( command( int ) ),
@@ -370,7 +389,7 @@
//
void QVideoPlayerEngine::disconnectView()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::disconnectView()"));
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::disconnectView()"));
if ( mCurrentViewPlugin )
{
@@ -387,7 +406,7 @@
//
void QVideoPlayerEngine::handleQuit()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleQuit()"));
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::handleQuit()"));
delete this;
}
@@ -399,20 +418,61 @@
//
void QVideoPlayerEngine::playMedia( QString filePath )
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia()"));
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia()"),
+ _L("filePath = %s"), filePath.data() );
mPlaybackWrapper->playMedia( filePath );
}
// -------------------------------------------------------------------------------------------------
+// playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+void QVideoPlayerEngine::playMedia( RFile file )
+{
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::playMedia( RFile )"));
+
+ mPlaybackWrapper->playMedia( file );
+}
+
+// -------------------------------------------------------------------------------------------------
// setEmbedded()
// -------------------------------------------------------------------------------------------------
//
void QVideoPlayerEngine::setEmbedded()
{
- MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setEmbedded()"));
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setEmbedded()"));
mEmbedded = true;
}
+// -------------------------------------------------------------------------------------------------
+// setCurrentView()
+// -------------------------------------------------------------------------------------------------
+//
+void QVideoPlayerEngine::setCurrentView()
+{
+ MPX_ENTER_EXIT(_L("QVideoPlayerEngine::setCurrentView()"));
+
+ if ( mCurrentViewPlugin )
+ {
+ //
+ // set current view
+ //
+ hbInstance->allMainWindows().value(0)->setCurrentView(
+ qobject_cast<HbView*>( mCurrentViewPlugin->getView() ), false );
+
+ //
+ // connect view
+ //
+ connectView();
+
+ //
+ // activate view
+ //
+ mCurrentViewPlugin->activateView();
+ }
+}
+
+
// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoservicebrowse.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of VideoServiceUriFetch
+*
+*/
+
+// Version : %version: %
+
+#include <hbapplication.h>
+
+#include "videoservices.h"
+#include "videoservicebrowse.h"
+#include "mpxhbvideocommondefs.h"
+#include "mpxvideo_debug.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoServiceBrowse()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceBrowse::VideoServiceBrowse( VideoServices* parent )
+ : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoBrowse"), parent )
+ , mRequestIndex( 0 )
+ , mServiceApp( parent )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceBrowse::VideoServiceBrowse()"));
+
+ publishAll();
+}
+
+// -------------------------------------------------------------------------------------------------
+// ~VideoServiceBrowse()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceBrowse::~VideoServiceBrowse()
+{
+ MPX_DEBUG(_L("VideoServiceBrowse::~VideoServiceBrowse()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// complete()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoServiceBrowse::complete()
+{
+ MPX_ENTER_EXIT(_L("VideoServiceBrowse::complete()"));
+
+ if ( mRequestIndex )
+ {
+ QStringList filesList;
+ connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
+ bool ok = completeRequest(mRequestIndex, filesList);
+ mRequestIndex = 0;
+
+ //
+ // double check that request was completed succesfully, otherwise
+ // videos application cannot be exited at all
+ //
+ if ( ! ok )
+ {
+ MPX_DEBUG(_L("VideoServiceBrowse::complete() : completeRequest FAILED !"));
+ qApp->quit();
+ }
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+// getBrowseCategory()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoServiceBrowse::getBrowseCategory() const
+{
+ MPX_DEBUG(_L("VideoServiceBrowse::getBrowseCategory() ret %d"), mCategory);
+ return mCategory;
+}
+
+// -------------------------------------------------------------------------------------------------
+// contextTitle()
+// -------------------------------------------------------------------------------------------------
+//
+QString VideoServiceBrowse::contextTitle() const
+{
+ MPX_DEBUG(_L("VideoServiceBrowse::contextTitle() ret %s"), mTitle.data() );
+ return mTitle;
+}
+
+// -------------------------------------------------------------------------------------------------
+// browseVideos()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoServiceBrowse::browseVideos(const QString &title, int category)
+{
+ MPX_ENTER_EXIT(_L("VideoServiceBrowse::browseVideos()"));
+
+ // set application title
+ QString appTitle(title);
+ if (appTitle.isEmpty())
+ {
+ appTitle = hbTrId("txt_videos_title_videos");
+ }
+
+ mTitle = appTitle;
+ mCategory = category;
+
+ // 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 );
+}
+
+// End of file
--- a/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoserviceplay.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,43 +15,79 @@
*
*/
+// Version : %version: %
-#include <videoservices.h>
+#include "videoservices.h"
#include "videoserviceplay.h"
#include "videoplayerengine.h"
+#include "mpxvideo_debug.h"
+// -------------------------------------------------------------------------------------------------
+// VideoServicePlay()
+// -------------------------------------------------------------------------------------------------
+//
VideoServicePlay::VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine )
-: XQServiceProvider(QLatin1String("com.nokia.Videos.IVideoView"), parent),
- mEngine(engine),
- mServiceApp(parent)
+ : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoView"), parent )
+ , mEngine( engine )
+ , mServiceApp( parent )
{
+ MPX_ENTER_EXIT(_L("VideoServicePlay::VideoServicePlay()"));
publishAll();
}
+// -------------------------------------------------------------------------------------------------
+// ~VideoServicePlay()
+// -------------------------------------------------------------------------------------------------
+//
VideoServicePlay::~VideoServicePlay()
{
+ MPX_DEBUG(_L("VideoServicePlay::~VideoServicePlay()"));
}
+// -------------------------------------------------------------------------------------------------
+// setEngine()
+// -------------------------------------------------------------------------------------------------
+//
void VideoServicePlay::setEngine( QVideoPlayerEngine* engine )
{
- mEngine = engine;
+ MPX_DEBUG(_L("VideoServicePlay::setEngine()"));
+ mEngine = engine;
}
+// -------------------------------------------------------------------------------------------------
+// playMedia()
+// -------------------------------------------------------------------------------------------------
+//
void VideoServicePlay::playMedia( QString filePath )
{
- if(mEngine)
+ MPX_ENTER_EXIT(_L("VideoServicePlay::playMedia()"),
+ _L("filePath = %s"), filePath.data() );
+
+ if ( mEngine )
{
- mServiceApp->setCurrentService(VideoServices::EPlayback);
+ mServiceApp->setCurrentService( VideoServices::EPlayback );
mEngine->playMedia( filePath );
}
}
+// -------------------------------------------------------------------------------------------------
+// playPDLMedia()
+// -------------------------------------------------------------------------------------------------
+//
void VideoServicePlay::playPDLMedia( QString filePath, int downloadID )
{
+ MPX_DEBUG(_L("VideoServicePlay::playPDLMedia()"));
+ Q_UNUSED( filePath );
+ Q_UNUSED( downloadID );
}
+// -------------------------------------------------------------------------------------------------
+// closePlayer()
+// -------------------------------------------------------------------------------------------------
+//
void VideoServicePlay::closePlayer()
{
+ MPX_DEBUG(_L("VideoServicePlay::closePlayer()"));
}
--- a/videoplayerapp/videoplayerengine/src/videoservices.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoservices.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,10 +15,15 @@
*
*/
-#include <videoplayerengine.h>
-#include <videoservices.h>
-#include <videoserviceurifetch.h>
-#include <videoserviceplay.h>
+// Version : %version: %
+
+#include "videoplayerengine.h"
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "videoserviceplay.h"
+#include "videoserviceview.h"
+#include "videoservicebrowse.h"
+#include "mpxvideo_debug.h"
VideoServices *VideoServices::mInstance = 0;
@@ -28,11 +33,13 @@
//
VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
{
- if(!mInstance)
+ MPX_ENTER_EXIT(_L("VideoServices::instance()"));
+
+ if ( ! mInstance )
{
mInstance = new VideoServices(engine);
}
- else if(engine && !mInstance->engine())
+ else if ( engine && ! mInstance->engine() )
{
mInstance->setEngine(engine);
}
@@ -46,9 +53,11 @@
//
void VideoServices::decreaseReferenceCount()
{
- if(mInstance)
+ MPX_ENTER_EXIT(_L("VideoServices::decreaseReferenceCount()"));
+
+ if ( mInstance )
{
- if(--mInstance->mReferenceCount == 0)
+ if( --mInstance->mReferenceCount == 0 )
{
delete mInstance;
mInstance = NULL;
@@ -62,11 +71,20 @@
//
void VideoServices::setEngine(QVideoPlayerEngine* engine)
{
- if (mServicePlay)
+ MPX_ENTER_EXIT(_L("VideoServices::setEngine()"));
+
+ if ( mServicePlay )
{
mEngine = engine;
mServicePlay->setEngine(engine);
}
+
+ if ( mServiceView )
+ {
+ mEngine = engine;
+ mServiceView->setEngine(engine);
+ }
+
}
// ----------------------------------------------------------------------------
@@ -75,6 +93,8 @@
//
QVideoPlayerEngine* VideoServices::engine()
{
+ MPX_DEBUG(_L("VideoServices::engine"));
+
return mEngine;
}
@@ -82,13 +102,17 @@
// VideoServices()
// ----------------------------------------------------------------------------
//
-VideoServices::VideoServices(QVideoPlayerEngine* engine) :
-mReferenceCount(0),
-mEngine(engine),
-mCurrentService(VideoServices::ENoService)
+VideoServices::VideoServices( QVideoPlayerEngine* engine )
+ : mReferenceCount( 0 )
+ , mEngine( engine )
+ , mCurrentService( VideoServices::ENoService )
{
+ MPX_ENTER_EXIT(_L("VideoServices::VideoServices()"));
+
mServiceUriFetch = new VideoServiceUriFetch(this);
mServicePlay = new VideoServicePlay(this, engine);
+ mServiceView = new VideoServiceView(this, engine);
+ mServiceBrowse = new VideoServiceBrowse(this);
}
// ----------------------------------------------------------------------------
@@ -97,8 +121,12 @@
//
VideoServices::~VideoServices()
{
+ MPX_ENTER_EXIT(_L("VideoServices::~VideoServices()"));
+
delete mServiceUriFetch;
delete mServicePlay;
+ delete mServiceView;
+ delete mServiceBrowse;
}
// ----------------------------------------------------------------------------
@@ -107,24 +135,60 @@
//
VideoServices::TVideoService VideoServices::currentService()
{
+ MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService );
+
return mCurrentService;
}
// ----------------------------------------------------------------------------
+// getBrowseCategory()
+// ----------------------------------------------------------------------------
+//
+int VideoServices::getBrowseCategory() const
+{
+ MPX_DEBUG(_L("VideoServices::getBrowseCategory()"));
+
+ int category = 0;
+
+ if ( mServiceBrowse )
+ {
+ category = mServiceBrowse->getBrowseCategory();
+ }
+
+ return category;
+}
+
+// ----------------------------------------------------------------------------
// setCurrentService()
// ----------------------------------------------------------------------------
//
void VideoServices::setCurrentService(VideoServices::TVideoService service)
{
- mCurrentService = service;
+ MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service );
+
+ mCurrentService = service;
}
+
// ----------------------------------------------------------------------------
// contextTitle()
// ----------------------------------------------------------------------------
//
QString VideoServices::contextTitle() const
{
- return mServiceUriFetch->contextTitle();
+ MPX_DEBUG(_L("VideoServices::contextTitle()") );
+
+ QString title;
+
+ if ( mCurrentService == VideoServices::EUriFetcher )
+ {
+ title = mServiceUriFetch->contextTitle();
+ }
+ else if ( mCurrentService == VideoServices::EBrowse )
+ {
+ title = mServiceBrowse->contextTitle();
+ }
+
+ return title;
}
// ----------------------------------------------------------------------------
@@ -133,8 +197,26 @@
//
void VideoServices::itemSelected(const QString& item)
{
+ MPX_ENTER_EXIT(_L("VideoServices::itemSelected()"),
+ _L("item = %s"), item.data() );
+
QStringList list;
- list.append(item);
- mServiceUriFetch->complete(list);
+ list.append( item );
+ mServiceUriFetch->complete( list );
}
+// ----------------------------------------------------------------------------
+// browsingEnded()
+// ----------------------------------------------------------------------------
+//
+void VideoServices::browsingEnded()
+{
+ MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()"));
+
+ if ( mServiceBrowse )
+ {
+ mServiceBrowse->complete();
+ }
+}
+
+// End of file
--- a/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoserviceurifetch.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,11 +15,14 @@
*
*/
+// Version : %version: %
+
#include <hbapplication.h>
-#include <videoservices.h>
-#include <videoserviceurifetch.h>
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
#include "mpxhbvideocommondefs.h"
+#include "mpxvideo_debug.h"
// ----------------------------------------------------------------------------
@@ -27,10 +30,11 @@
// ----------------------------------------------------------------------------
//
VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent)
-: XQServiceProvider(QLatin1String("com.nokia.Videos.IVideoFetch"),parent),
- mRequestIndex(0),
- mServiceApp(parent)
+ : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoFetch"), parent )
+ , mRequestIndex( 0 )
+ , mServiceApp( parent )
{
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
publishAll();
}
@@ -40,7 +44,7 @@
//
VideoServiceUriFetch::~VideoServiceUriFetch()
{
-
+ MPX_DEBUG(_L("VideoServiceUriFetch::~VideoServiceUriFetch()"));
}
// ----------------------------------------------------------------------------
@@ -49,9 +53,12 @@
//
void VideoServiceUriFetch::fetchFailed( int errorCode )
{
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetchFailed()"),
+ _L("errorCode = %d"), errorCode );
+
QStringList filesList;
- filesList.insert(0, QString::number( errorCode ));//result
- doComplete(filesList);
+ filesList.insert( 0, QString::number( errorCode ) ); //result
+ doComplete( filesList );
}
// ----------------------------------------------------------------------------
@@ -60,7 +67,9 @@
//
void VideoServiceUriFetch::complete( QStringList filesList )
{
- doComplete(filesList);
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::complete()"));
+
+ doComplete( filesList );
}
// ----------------------------------------------------------------------------
@@ -69,11 +78,24 @@
//
void VideoServiceUriFetch::doComplete( QStringList filesList)
{
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::doComplete()"));
+
if ( isActive() )
{
connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
- completeRequest(mRequestIndex, filesList);
+ bool ok = completeRequest(mRequestIndex, filesList);
mRequestIndex = 0;
+
+ //
+ // double check that request was completed succesfully, otherwise
+ // videos application cannot be exited at all
+ //
+ if ( ! ok )
+ {
+ MPX_DEBUG(_L("VideoServiceUriFetch::doComplete() : completeRequest FAILED !"));
+
+ qApp->quit();
+ }
}
}
@@ -83,6 +105,8 @@
//
bool VideoServiceUriFetch::isActive()
{
+ MPX_DEBUG(_L("VideoServiceUriFetch::isActive() ret %d"), mRequestIndex );
+
return (mRequestIndex > 0);
}
@@ -92,6 +116,8 @@
//
QString VideoServiceUriFetch::contextTitle() const
{
+ MPX_DEBUG(_L("VideoServiceUriFetch::contextTitle() ret %s"), mTitle.data() );
+
return mTitle;
}
@@ -101,6 +127,9 @@
//
void VideoServiceUriFetch::fetch(const QString& title)
{
+ MPX_ENTER_EXIT(_L("VideoServiceUriFetch::fetch()"),
+ _L("title = %s"), title.data() );
+
mTitle = title;
emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView);
emit mServiceApp->titleReady(title);
@@ -108,5 +137,6 @@
mServiceApp->setCurrentService(VideoServices::EUriFetcher);
mRequestIndex = setCurrentRequestAsync();
+ MPX_DEBUG(_L("VideoServiceUriFetch::fetch() : mRequestIndex(%d)"), mRequestIndex );
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/src/videoserviceview.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of VideoServiceView
+*
+*/
+
+// Version : %version: 3 %
+
+#include "videoservices.h"
+#include "videoserviceview.h"
+#include "videoplayerengine.h"
+#include "mpxvideo_debug.h"
+
+// -------------------------------------------------------------------------------------------------
+// VideoServiceView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceView::VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine )
+ : XQServiceProvider( QLatin1String("com.nokia.Videos.com.nokia.symbian.IFileView"), parent )
+ , mEngine( engine )
+ , mServiceApp( parent )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceView::VideoServiceView()"));
+ publishAll();
+}
+
+// -------------------------------------------------------------------------------------------------
+// ~VideoServiceView()
+// -------------------------------------------------------------------------------------------------
+//
+VideoServiceView::~VideoServiceView()
+{
+ MPX_ENTER_EXIT(_L("VideoServiceView::~VideoServiceView()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// setEngine()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoServiceView::setEngine( QVideoPlayerEngine* engine )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceView::setEngine()"));
+ mEngine = engine;
+}
+
+// -------------------------------------------------------------------------------------------------
+// view( QString )
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoServiceView::view( QString file )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceView::view( QString ) "),
+ _L("file = %s"), file.data() );
+
+ if(mEngine)
+ {
+ mServiceApp->setCurrentService(VideoServices::EView);
+ mEngine->playMedia( file );
+ }
+
+ return true;
+}
+
+// -------------------------------------------------------------------------------------------------
+// view( XQSharableFile )
+// -------------------------------------------------------------------------------------------------
+//
+bool VideoServiceView::view( XQSharableFile file )
+{
+ MPX_ENTER_EXIT(_L("VideoServiceView::view( XQSharableFile )"));
+
+ RFile rFile;
+ bool handleOK = file.getHandle( rFile );
+
+ mServiceApp->setCurrentService(VideoServices::EView);
+
+ if ( mEngine)
+ {
+ if ( handleOK )
+ {
+ mEngine->playMedia( rFile );
+ }
+ else
+ {
+ mEngine->playMedia( file.fileName() );
+ }
+ }
+
+ return true;
+}
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/inc/testvideoappuiengine.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: videoappuiengine test class declaration.
+*
+*/
+
+// TODO: at the moment we are not able to get access to all private methods
+// to the class under test. We need to declare some own framework in order
+// to declare testclasses into friends of classes under test etc.
+//
+// missing test functions:
+// - how to setup construction to fail for testing purposes
+
+
+#ifndef __TESTVIDEOAPPUIENGINE_H__
+#define __TESTVIDEOAPPUIENGINE_H__
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+#include <e32base.h>
+#include <e32def.h>
+#include <mpxmessage2.h>
+
+//typedef struct
+//{
+// TInt iEvent;
+// TInt iData;
+// TInt iError;
+//} TCallbackEvent;
+
+enum TActivationCommands
+{
+ EProcessTail,
+ EProcessFile,
+ EProcessStandAlone
+};
+
+enum TStifFileTypes
+{
+ ELocalFile,
+ ESdpFile,
+ ERamFile,
+ EUrl,
+ EAsxFile,
+ EMultiLinkFile
+};
+
+enum TMpxUtilityEvents
+{
+ EViewUtilityPreLoadView,
+ EViewUtilityActivateView,
+ EViewUtilityActivateViewUid,
+ EViewUtilityActivatePdlView,
+ EViewUtilitySetAsDefaultView,
+ EViewUtilityActivatePreviousView,
+ EPlaybackUtilityInitFileHandle,
+ EPlaybackUtilityInitFileName,
+ EPlaybackUtilityInitStreamingUrl,
+ EPlaybackUtilityInitStreamingFileHandle,
+ EPlaybackUtilityInitPlaylist,
+ EPlaybackUtilityStartPdl,
+ EPlaybackUtilityPlayCmd,
+ EPlaybackUtilityPdlInstance,
+ EPlaybackUtilityClose,
+ ECollectionUtilityMedia,
+ ECollectionUtilityOpen,
+ EAppUiCmdExit,
+ EPlaybackUtilityOpenPlaylist,
+ EAsxAttributeSeekUpdate,
+ EFunctionLeave
+};
+
+typedef struct
+{
+ TMpxUtilityEvents iEvent;
+ TUid iUid;
+ TFileName iFileName;
+ TInt iDownloadId;
+ TInt iApId;
+ TInt iExtra;
+} TCallbackEvent;
+
+typedef CArrayPtrFlat<TCallbackEvent> CCallbackEventArray;
+
+_LIT(KTestLocalFilename, "c:\\data\\videos\\test.3gp" );
+_LIT(KTestRamFilename, "c:\\data\\videos\\test.ram" );
+_LIT(KTestRtspUrl, "rtsp://testserver/test.3gp");
+
+
+class MAppUiEngineUnitTestObserver
+{
+ public:
+ virtual void HandleUtilityEvent( TCallbackEvent* aEvent ) = 0;
+};
+
+
+class QMpxVideoPlaybackWrapper;
+class CMpxVideoPlayerAppUiEngine;
+class MMPXPlaybackUtility;
+class CMPXCollectionUtility;
+
+class TestVideoAppUiEngine : public QObject,
+ public MAppUiEngineUnitTestObserver
+ {
+
+ Q_OBJECT
+
+public: // Constructor / destructor
+
+ /**
+ * Contructor.
+ *
+ */
+ TestVideoAppUiEngine();
+
+ /**
+ * Destructor.
+ *
+ */
+ virtual ~TestVideoAppUiEngine();
+
+ //
+ // MAppUiEngineStifTestObserver Implementation
+ //
+ void HandleUtilityEvent( TCallbackEvent* aEvent );
+
+ CMPXMessage* CreateMpxMessageLC( int aEvent, int aType, int aData );
+
+
+private slots:
+
+ void init();
+ void cleanup();
+
+ void testPlaybackUtility();
+ void testOpenFile();
+ void testOpenMedia();
+ void testDoHandlePlaybackMessage();
+ void testPrepareCloseMpx();
+ void testDoHandleCollectionMedia();
+ void testHandlePlaybackMessage();
+ void testHandleCollectionMessage();
+ void testHandleCollectionMedia();
+
+ // called after last test case executed
+ void cleanupTestCase();
+
+signals:
+
+ void aboutToQuit();
+
+private:
+
+ CMpxVideoPlayerAppUiEngine* mTestObject;
+
+ QMpxVideoPlaybackWrapper* mPlaybackWrapper;
+
+ //CCallbackEventArray* mExpectedEventArray;
+
+ int mError;
+
+ TCallbackEvent* mExpectedEvent;
+
+ bool mTestResult;
+
+ MMPXPlaybackUtility* mPlaybackUtility;
+ CMPXCollectionUtility* mCollectionUtility;
+
+};
+
+#endif // __TESTVIDEOAPPUIENGINE_H__
+
+// End of file
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/src/testvideoappuiengine.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,378 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Videoplayerengine test class implementation.
+*
+*/
+
+// Version : %version: %
+
+// INCLUDES
+#include <QtTest/QtTest>
+#include <qdebug.h>
+
+#include <hbapplication.h>
+#include <f32file.h>
+#include <bautils.h>
+#include <mpxmessagegeneraldefs.h>
+#include <mpxplaybackmessage.h>
+
+#include "stub/inc/testutilities.h"
+
+#include "mpxplaybackutilityimp_stub.h"
+#include "mpxcollectionutilityimp_stub.h"
+
+#include "stub/inc/hbinstance.h"
+#include "mpxhbvideocommondefs.h"
+#include "testvideoappuiengine.h"
+#include "../stub/inc/mpxvideoplaybackwrapper.h"
+#define private public
+#include "mpxvideoplayerappuiengine.h"
+#undef private
+#include "mpxvideo_debug.h"
+
+
+
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+{
+ HbApplication app(argc, argv);
+
+ TestVideoAppUiEngine tc;
+
+ char *pass[3];
+ pass[0] = argv[0];
+ pass[1] = "-o";
+ pass[2] = "c:\\data\\TestVideoAppUiEngine.txt";
+
+ return QTest::qExec(&tc, 3, pass);
+}
+
+
+TestVideoAppUiEngine::TestVideoAppUiEngine()
+ : mTestObject(0)
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::TestVideoAppUiEngine()"));
+}
+
+TestVideoAppUiEngine::~TestVideoAppUiEngine()
+{
+ MPX_ENTER_EXIT(_L("TestVideoAppUiEngine::~TestVideoAppUiEngine()"));
+
+ delete mTestObject;
+ mTestObject = 0;
+
+ delete mPlaybackWrapper;
+ mPlaybackWrapper = 0;
+
+
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+ utility->iPlaybackUtility->RemoveTestObserverL();
+
+}
+
+
+void TestVideoAppUiEngine::init()
+{
+ MPX_ENTER_EXIT(_L("TestVideoAppUiEngine::init()"));
+
+ mTestResult = false;
+
+ mPlaybackWrapper = new QMpxVideoPlaybackWrapper();
+
+ TRAPD( createErr, mTestObject = CMpxVideoPlayerAppUiEngine::NewL( mPlaybackWrapper ) );
+
+ QVERIFY( !createErr );
+
+ QVERIFY( mTestObject->iCollectionUtility );
+
+ TRAPD( initErr, mTestObject->LateInitL() );
+
+ QVERIFY( !initErr );
+
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+
+ TRAP_IGNORE( utility->iPlaybackUtility->AddTestObserverL( this ) );
+}
+
+void TestVideoAppUiEngine::cleanup()
+{
+ MPX_ENTER_EXIT(_L("TestVideoAppUiEngine::cleanup()"));
+
+ delete mTestObject;
+ mTestObject = 0;
+
+ delete mPlaybackWrapper;
+ mPlaybackWrapper = 0;
+
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+ if ( utility )
+ {
+ utility->iPlaybackUtility->RemoveTestObserverL();
+ }
+
+}
+
+void TestVideoAppUiEngine::cleanupTestCase()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::cleanupTestCase()"));
+ // all common cleanup here
+}
+
+void TestVideoAppUiEngine::testPlaybackUtility()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testPlaybackUtility()"));
+
+ init();
+
+ QVERIFY( mTestObject->PlaybackUtility() );
+
+}
+
+void TestVideoAppUiEngine::testOpenFile()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testOpenFile()"));
+
+ // Test for local file
+ init();
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitFileName;
+ TRAPD( openFileErr, mTestObject->OpenFileL( KTestLocalFilename ) );
+ QVERIFY( !openFileErr );
+ QVERIFY( mTestResult );
+
+ // Test for streaming link
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitStreamingUrl;
+ TRAPD( openRamFileErr, mTestObject->OpenFileL( KTestRamFilename ) );
+ QVERIFY( !openRamFileErr );
+ QVERIFY( mTestResult );
+
+ // Test for a url
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitStreamingUrl;
+ TRAPD( openUrlErr, mTestObject->OpenFileL( KTestRtspUrl ) );
+ QVERIFY( !openUrlErr );
+ QVERIFY( mTestResult );
+
+}
+
+void TestVideoAppUiEngine::testOpenMedia()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testOpenMedia()"));
+
+ init();
+
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL( media );
+ media->SetTextValueL( KMPXMediaGeneralUri, KTestLocalFilename );
+ media->SetTObjectValueL( KMPXMediaGeneralId, TMPXItemId( 1, 2 ) );
+
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
+
+ TRAPD( err, mTestObject->OpenMediaL( *media ) );
+ QVERIFY( !err );
+ QVERIFY( mTestResult );
+
+}
+
+void TestVideoAppUiEngine::testDoHandlePlaybackMessage()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testDoHandlePlaybackMessage()"));
+
+ init();
+
+ QSignalSpy spy( mPlaybackWrapper, SIGNAL(handlePlaybackView(int)) );
+ QCOMPARE(spy.count(), 0);
+
+ CMPXMessage* msg = CreateMpxMessageLC(TMPXPlaybackMessage::EPlayerChanged, 0, 0);
+ TRAPD(err, mTestObject->DoHandlePlaybackMessageL( *msg ));
+ QVERIFY( !err );
+
+ QCOMPARE(spy.count(), 1);
+ spy.clear();
+
+}
+
+void TestVideoAppUiEngine::testPrepareCloseMpx()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testPrepareCloseMpx()"));
+
+ init();
+
+ TRAPD( err, mTestObject->PrepareCloseMpxL() );
+
+ QVERIFY( !err );
+
+}
+
+void TestVideoAppUiEngine::testDoHandleCollectionMedia()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testDoHandleCollectionMedia()"));
+
+ init();
+
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL( media );
+ media->SetTextValueL( KMPXMediaGeneralUri, KTestLocalFilename );
+ media->SetTObjectValueL( KMPXMediaGeneralId, TMPXItemId( 1, 2 ) );
+
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
+
+ TRAPD( err, mTestObject->DoHandelCollectionMediaL( *media ) );
+ QVERIFY( !err );
+ QVERIFY( mTestResult );
+
+}
+
+void TestVideoAppUiEngine::testHandlePlaybackMessage()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testHandlePlaybackMessage()"));
+
+ init();
+
+ QSignalSpy spy( mPlaybackWrapper, SIGNAL(handlePlaybackView(int)) );
+ QCOMPARE(spy.count(), 0);
+
+ mTestObject->iUpdateSeekInfo = ETrue;
+
+ CMPXMessage* msg = CreateMpxMessageLC(TMPXPlaybackMessage::EPlayerChanged, 0, 0);
+ mTestObject->HandlePlaybackMessage( msg, KErrNone );
+
+ QCOMPARE(spy.count(), 1);
+ spy.clear();
+
+ QVERIFY( ! mTestObject->iUpdateSeekInfo );
+}
+
+void TestVideoAppUiEngine::testHandleCollectionMessage()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testHandleCollectionMessage()"));
+
+ init();
+
+ // Test for EMcItemOpened
+ //
+ CMPXMessage* msg = CreateMpxMessageLC(4, EMcPathChangedByOpen, EMcItemOpened); // EPathChanged => 4
+ mTestObject->HandleCollectionMessage( msg, KErrNone );
+ QVERIFY( mTestObject->iCollectionUtility );
+
+ // Test for EMcContainerOpened
+ //
+ mTestObject->iMultilinkPlaylist = ETrue;
+
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
+
+ delete msg;
+ msg = NULL;
+ msg = CreateMpxMessageLC(4, EMcPathChangedByOpen, EMcContainerOpened);
+ mTestObject->HandleCollectionMessage( msg, KErrNone );
+
+ QVERIFY( mTestResult );
+
+}
+
+void TestVideoAppUiEngine::testHandleCollectionMedia()
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::testHandleCollectionMedia()"));
+
+ init();
+
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL( media );
+ media->SetTextValueL( KMPXMediaGeneralUri, KTestLocalFilename );
+ media->SetTObjectValueL( KMPXMediaGeneralId, TMPXItemId( 1, 2 ) );
+
+ mExpectedEvent = new (ELeave) TCallbackEvent;
+ mExpectedEvent->iEvent = EPlaybackUtilityInitPlaylist;
+
+ TRAPD( err, mTestObject->HandleCollectionMediaL( *media, KErrNone ) );
+ QVERIFY( !err );
+ QVERIFY( mTestResult );
+
+}
+
+void TestVideoAppUiEngine::HandleUtilityEvent( TCallbackEvent* aEvent )
+{
+ MPX_DEBUG(_L("TestVideoAppUiEngine::HandleUtilityEvent()"));
+
+ if ( mExpectedEvent->iEvent == aEvent->iEvent )
+ {
+ switch ( aEvent->iEvent )
+ {
+ case EPlaybackUtilityInitFileName:
+ {
+ if ( aEvent->iFileName == KTestLocalFilename )
+ {
+ mTestResult = true;
+ }
+ break;
+ }
+ case EPlaybackUtilityInitStreamingUrl:
+ {
+ if ( aEvent->iFileName == KTestRamFilename )
+ {
+ mTestResult = true;
+ }
+ break;
+ }
+ case EPlaybackUtilityInitPlaylist:
+ {
+ mTestResult = true;
+ break;
+ }
+ case EAsxAttributeSeekUpdate:
+ {
+ mTestResult = true;
+ break;
+ }
+
+ }
+
+ }
+
+ delete aEvent;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayer_AppUiEngineTester::CreateMpxMessageLC
+// -------------------------------------------------------------------------------------------------
+//
+CMPXMessage*
+TestVideoAppUiEngine::CreateMpxMessageLC( int aEvent, int aType, int aData )
+{
+ MPX_ENTER_EXIT(_L("TestVideoAppUiEngine::CreateMpxMessageLC()"));
+
+ CMPXMessage* pbMessage = CMPXMessage::NewL();
+ CleanupStack::PushL( pbMessage );
+
+ pbMessage->SetTObjectValueL<TMPXMessageId>( KMPXMessageGeneralId, KMPXMessageGeneral );
+ pbMessage->SetTObjectValueL<TInt>( KMPXMessageGeneralEvent, aEvent );
+ pbMessage->SetTObjectValueL<TInt>( KMPXMessageGeneralType, aType );
+ pbMessage->SetTObjectValueL<TInt>( KMPXMessageGeneralData, aData );
+
+ return pbMessage;
+}
+
+
+// End of file
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/hbinstance.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: hbInstance stub class definition
+*
+*/
+
+#ifndef _HBINSTANCE_H
+#define _HBINSTANCE_H
+
+#include <QList>
+
+// Get stubs included before they are searched from /epoc32/include/mw
+#include "stub/inc/hbview.h"
+
+#define hbInstance (HbInstance::instance())
+
+class QGraphicsWidget;
+
+class HbInstance
+{
+public:
+ static HbInstance *instance();
+
+ HbInstance* primaryWindow() const;
+
+ QList<HbInstance *> allMainWindows() const;
+
+ void removeView( QGraphicsWidget* y );
+
+ void addView( QGraphicsWidget* x );
+
+ void setCurrentView( HbView* x , bool animation );
+
+private:
+ HbInstance();
+ ~HbInstance();
+};
+
+#endif // STUBHBINSTANCE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/hbview.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* 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: stub hbview
+*
+*/
+
+
+#ifndef HBVIEW_H
+#define HBVIEW_H
+
+#include <QGraphicsWidget>
+
+class HbView : public QGraphicsWidget
+{
+ Q_OBJECT
+
+
+public:
+
+ HbView(QGraphicsItem *parent = 0)
+ {
+ Q_UNUSED(parent);
+ }
+ virtual ~HbView(){}
+
+
+};
+
+#endif // HBVIEW_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/mpxcollectionplaylist.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx collection playlist class stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef MPXCOLLECTIONPLAYLIST_H_
+#define MPXCOLLECTIONPLAYLIST_H_
+
+#include <e32base.h>
+
+class CMPXCollectionPath;
+//class MMPXCollectionPlaylistObserver;
+
+class CMPXCollectionPlaylist : public CBase
+{
+ public:
+ CMPXCollectionPlaylist();
+ ~CMPXCollectionPlaylist();
+
+ //CMPXCollectionPlaylist* NewL(const CMPXCollectionPath& aPath,
+ // MMPXCollectionPlaylistObserver* aPlObs = NULL);
+
+ static CMPXCollectionPlaylist* NewL(const CMPXCollectionPath& aPath);
+
+ void SetSingleItemPlaylist();
+
+ void SetToFirst();
+
+ void SetAutoPlay(TBool aAutoPlay);
+
+ void SetPreInitPlugin(TBool aPreInit);
+
+};
+#endif /*MPXCOLLECTIONPLAYLIST_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/mpxcollectionutilityimp_stub.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx collection utility stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef MPXCOLLECTIONUTILITYIMP_STUB_H_
+#define MPXCOLLECTIONUTILITYIMP_STUB_H_
+
+#include <mpxcollectionutility.h>
+#include <mpxcollectionobserver.h>
+#include <mpxmessageobserver.h>
+
+NONSHARABLE_CLASS( CMPXCollectionUtility ) : public MMPXCollectionUtility,
+ public MMPXMessageObserver,
+ public MMPXCollection
+
+{
+ public:
+ /**
+ * Two-phased constructor
+ *
+ * @param aObs observer
+ * @param aModeId collection mode id
+ * @return object of constructed
+ */
+ static CMPXCollectionUtility* NewL( const TUid& aModeId, MMPXCollectionObserver* aObs );
+
+ /**
+ * Destructor
+ */
+ ~CMPXCollectionUtility();
+
+ void AddRefCount();
+
+ //void AddTestObserverL( MAppUiEngineUnitTestObserver* aObserver );
+ //void RemoveTestObserverL();
+
+ private:
+ /**
+ * C++ constructor
+ */
+ CMPXCollectionUtility( MMPXCollectionObserver* aObs );
+
+ /**
+ * Second phase constructor
+ *
+ * @param aModeId collection mode id
+ */
+ void ConstructL( const TUid& aModeId );
+
+ public:
+
+ //------------------------------------------------------------------------------------------
+ // MMPXCollectionUtility Implementation
+ //------------------------------------------------------------------------------------------
+ MMPXCollection& Collection();
+ TUid CollectionIDL( const TArray<TUid>& aUids );
+ void Close();
+
+ //------------------------------------------------------------------------------------------
+ // MMPXCollection Implementation
+ //------------------------------------------------------------------------------------------
+ void OpenL( TMPXOpenMode aMode = EMPXOpenDefault );
+ void OpenL( TInt aIndex, TMPXOpenMode aMode = EMPXOpenDefault );
+ void OpenL( const CMPXCollectionPath& aPath, TMPXOpenMode aMode = EMPXOpenDefault );
+ void OpenL( TInt aIndex,
+ const TArray<TMPXAttribute>& aAttrs,
+ TMPXOpenMode aMode = EMPXOpenDefault );
+ void OpenL( const CMPXCollectionPath& aPath,
+ const TArray<TMPXAttribute>& aAttrs,
+ TMPXOpenMode aMode = EMPXOpenDefault );
+ void OpenL( const TArray<TUid>& aUids, TMPXOpenMode aMode = EMPXOpenDefault );
+ void OpenL( const TUid& aUid, TMPXOpenMode aMode = EMPXOpenDefault );
+ void SetFilterL( CMPXFilter* aFilter );
+ CMPXFilter* FilterL();
+ TUid UidL() const;
+ CMPXCollectionPath* PathL();
+ void BackL();
+ TBool IsRemote( const CMPXCollectionPath& aPath );
+ void CancelRequest();
+ void AddL( const CMPXMedia& aNewProperties );
+ void RemoveL( const CMPXCollectionPath& aPath, MMPXCollectionRemoveObserver* aObs = NULL );
+ void RemoveL( const CMPXMedia& aProperties );
+ void SetSyncL( const CMPXMedia& aMedia );
+ void SetL( const CMPXMedia& aMedia );
+ void FindAllL( const CMPXMedia& aMedia,
+ const TArray<TMPXAttribute>& aAttrs,
+ MMPXCollectionFindObserver& aObs );
+ CMPXMedia* FindAllL( const CMPXMedia& aMedia, const TArray<TMPXAttribute>& aAttrs );
+ void MediaL( const CMPXCollectionPath& aPath,
+ const TArray<TMPXAttribute>& aAttrs,
+ CMPXAttributeSpecs* aSpecs = NULL,
+ CMPXFilter* aFilter = NULL );
+ void NotifyL( TMPXCollectionBroadCastMsg aMsg, TInt aData );
+ void CommandL( TMPXCollectionCommand aCmd, TInt aData = 0 );
+ void CommandL( CMPXCommand& aCmd );
+ void GetSupportedTypesL( RPointerArray<CMPXCollectionType>& aArray );
+ void GetSupportedCapabilitiesL( TCollectionCapability& aCapability );
+ TUid CollectionIDL( TUid& aCollection );
+ void AddSubscriptionL( const CMPXSubscription& aSubscription );
+ void RemoveSubscriptionL( const CMPXSubscription& aSubscription );
+ void ClearSubscriptionsL();
+
+ //------------------------------------------------------------------------------------------
+ // MMPXMessageObserver Implementation
+ //------------------------------------------------------------------------------------------
+ void MessageReceived( TInt aMsgData, TInt aError );
+
+ private:
+ MMPXCollectionObserver* iObserver;
+ CMPXCollectionPath* iCollectionPath;
+ //MAppUiEngineUnitTestObserver* iTestObserver;
+
+ TInt iRefCount;
+};
+
+#endif /*MPXCOLLECTIONUTILITYIMP_STUB_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/mpxplaybackutilityimp_stub.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx playback utility stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef MPXPLAYBACKUTILITYIMP_STUB_H_
+#define MPXPLAYBACKUTILITYIMP_STUB_H_
+
+#include <mpxplaybackutility.h>
+
+#include "testvideoappuiengine.h"
+
+
+NONSHARABLE_CLASS( CMPXPlaybackUtility ) : public CBase,
+ public MMPXPlaybackUtility,
+ public MMPXPlayer,
+ public MMPXPlayerManager,
+ public MMPXSource
+{
+ public:
+
+ static MMPXPlaybackUtility* UtilityL();
+
+ CMPXPlaybackUtility();
+
+ void AddRefCount();
+
+ public:
+
+ ~CMPXPlaybackUtility();
+
+ void AddTestObserverL( MAppUiEngineUnitTestObserver* aObserver );
+ void RemoveTestObserverL();
+ void StartPdlPlaybackUtility();
+
+ //
+ // MMPXPlaybackUtility Implementation
+ //
+ void AddObserverL( MMPXPlaybackObserver& aObs );
+ void RemoveObserverL( MMPXPlaybackObserver& aObs );
+ void GetClientsL( RArray<TProcessId>& aClients );
+ void UpdatePlaylistL(const CMPXCollectionPlaylist& aPlaylist);
+ void InitL( const CMPXCollectionPlaylist& aPlaylist, TBool aPlay=ETrue );
+ void InitL( const TDesC& aUri, const TDesC8* aType = NULL );
+ void InitL( RFile& aShareableFile );
+ void Close();
+ void CancelRequest();
+ void CommandL( TMPXPlaybackCommand aCmd, TInt aData = 0 );
+ void CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* aCallback = NULL );
+ TMPXPlaybackState StateL() const;
+ MMPXSource* Source();
+ MMPXPlayerManager& PlayerManager();
+ void SetL( TMPXPlaybackProperty aProperty, TInt aValue );
+ void ValueL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty );
+ void PropertyL( MMPXPlaybackCallback& aCallback, TMPXPlaybackProperty aProperty );
+ CDesCArray* SupportedMimeTypes();
+ CDesCArray* SupportedExtensions();
+ CDesCArray* SupportedSchemas();
+ void SetPriority( TInt aPriority );
+ void AddSubscriptionL( const CMPXSubscription& aSubscription );
+ void RemoveSubscriptionL( const CMPXSubscription& aSubscription );
+ void ClearSubscriptionsL();
+ void InitStreamingL( const TDesC& aUri, const TDesC8* aType, const TInt aAccessPoint );
+ void InitStreamingL( RFile& aShareableFile, const TInt aAccessPoint );
+
+
+ //
+ // MMPXPlayerManager Implementation
+ //
+ void GetPlayerTypesL( RArray<TMPXPlaybackPlayerType>& aTypes );
+ HBufC* PlayerTypeDisplayNameL( TMPXPlaybackPlayerType aType );
+ void GetPlayerListL( RArray<TUid>& aPlayers );
+ void GetPlayerListL( RArray<TUid>& aPlayers, TMPXPlaybackPlayerType aType );
+ void SubPlayerNamesL( MMPXPlaybackCallback& aCallback, TUid aPlayer );
+ void SelectPlayersL( TMPXPlaybackPlayerType aType );
+ void SelectSubPlayerL( TUid aPlayer, TInt aSubPlayerIndex );
+ void SelectPlayerL( TUid aPlayer );
+ void ClearSelectPlayersL();
+ void GetSelectionL( TMPXPlaybackPlayerType& aType,
+ TUid& aPlayer,
+ TInt& aSubPlayerIndex,
+ HBufC*& aSubPlayerName );
+ MMPXPlayer* CurrentPlayer();
+
+ //
+ // MMPXPlayer Implementation
+ //
+ TMPXPlaybackPlayerType TypeL();
+ HBufC* TypeNameL();
+ void SubPlayerNamesL( MMPXPlaybackCallback& aCallback );
+ TInt SubPlayerL() const;
+ TUid UidL() const;
+
+ //
+ // MPXSource Implementation
+ //
+ CMPXCollectionPlaylist* PlaylistL();
+ RFile* FileL();
+ HBufC* UriL();
+ void MediaL( const TArray<TMPXAttribute>& aAttrs, MMPXPlaybackCallback& aCallback );
+ void MediaL( const TArray<TMPXAttribute>& aAttrs,
+ MMPXPlaybackCallback& aCallback,
+ CMPXAttributeSpecs* aSpecs );
+
+ private:
+
+ RArray<MMPXPlaybackObserver*> iObservers;
+ MAppUiEngineUnitTestObserver* iTestObserver;
+ TInt iRefCount;
+};
+
+#endif /*MPXPLAYBACKUTILITYIMP_STUB_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/mpxvideoplaybackwrapper.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 QMpxVideoPlaybackWrapper
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef MPXVIDEOPLAYBACKWRAPPER_H_
+#define MPXVIDEOPLAYBACKWRAPPER_H_
+
+#include <qobject>
+#include <qstring>
+#include <qfile>
+
+#include <mpxhbvideocommondefs.h>
+
+class QMpxVideoPlaybackWrapper : public QObject
+{
+ Q_OBJECT
+
+ public:
+ QMpxVideoPlaybackWrapper();
+ virtual ~QMpxVideoPlaybackWrapper();
+ int playMedia( QString aFileName );
+
+ public:
+ void openPlaybackView() ;
+ static int GetInstanceCount();
+ void lateInit();
+
+ signals:
+ void handlePlaybackView( int viewId );
+
+ private:
+ static void Increment();
+ static void Decrement();
+};
+
+#endif /* STUBMPXVIDEOPLAYBACKWRAPPER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/testutilities.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx collection playlist class stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef TESTUTILITIES_H_
+#define TESTUTILITIES_H_
+
+#include "mpxcollectionutilityimp_stub.h"
+#include "mpxcollectionutilityimp_stub.h"
+#include "mpxplaybackutilityimp_stub.h"
+
+class TestUtilities : public CBase
+{
+ public:
+
+ void DeleteCollectionUtility();
+ void DeletePlaybackUtility();
+
+ void CloseUtility();
+
+ CMPXCollectionUtility* iCollectionUtility;
+ CMPXPlaybackUtility* iPlaybackUtility;
+};
+#endif /*TESTUTILITIES_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/inc/videoplaylistutility.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: video playlist utility class stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef __VIDEOPLAYLISTUTILITY_H
+#define __VIDEOPLAYLISTUTILITY_H
+
+class CMPXMedia;
+
+#include <e32base.h>
+#include <mediarecognizer.h>
+
+class CVideoPlaylistUtility : public CBase
+{
+ public:
+ CVideoPlaylistUtility();
+ ~CVideoPlaylistUtility();
+
+ static CVideoPlaylistUtility* NewL();
+
+ void GetFileInfoL( RFile& aFile,
+ CMediaRecognizer::TMediaType aMediaType,
+ TBool& aSingleLink, TBool& aLocalFile );
+
+ void GetFileInfoL( const TDesC& aFileName,
+ CMediaRecognizer::TMediaType aMediaType,
+ TBool& aSingleLink,
+ TBool& aLocalFile);
+
+ TPtrC GetLinkLC();
+
+ TBool IsSeekable();
+
+ CMPXMedia* GetPlayListL( TInt aAccessPointId );
+
+
+};
+#endif /*__VIDEOPLAYLISTUTILITY_H*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/coneutils_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: cone utilities stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#include <f32file.h>
+#include <coeutils.h>
+
+TBool ConeUtils::FileExists(const TDesC& aFileName)
+{
+ TBool retVal = EFalse;
+
+ RFs fs;
+ RFile file;
+
+ TInt error = fs.Connect();
+
+ if ( error == KErrNone )
+ {
+ fs.ShareProtected();
+
+ error = file.Open( fs, aFileName, EFileRead );
+
+ if ( error == KErrNone )
+ {
+ retVal = ETrue;
+
+ file.Close();
+ }
+
+ fs.Close();
+ }
+
+ return retVal;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/hbinstance.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HbInstance
+*
+*/
+
+#include "stub/inc/hbinstance.h"
+#include <hbmainwindow.h>
+
+bool initialised = false;
+HbInstance* mInstance = 0;
+QList<HbInstance *> mInstances;
+
+HbInstance::HbInstance()
+{
+}
+
+HbInstance::~HbInstance()
+{
+}
+
+HbInstance* HbInstance::instance()
+{
+ if (!initialised)
+ {
+ mInstance = new HbInstance();
+ initialised = true;
+ mInstances.append(mInstance);
+ }
+ return mInstance;
+}
+
+HbInstance* HbInstance::primaryWindow() const
+{
+ return mInstance;
+}
+
+QList<HbInstance *> HbInstance::allMainWindows() const
+{
+ return mInstances;
+}
+
+void HbInstance::removeView( QGraphicsWidget* )
+{
+}
+
+void HbInstance::addView( QGraphicsWidget* )
+{
+}
+
+void HbInstance::setCurrentView( HbView*, bool animation )
+{
+}
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mediarecognizer_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,335 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CMediaRecognizer Stub
+*
+*/
+
+// Version : %version: 1 %
+
+
+// INCLUDE FILES
+#include <utf.h>
+#include <mediarecognizer.h>
+
+#include "testvideoappuiengine.h"
+
+#include "mpxvideo_debug.h"
+
+// CONSTANTS
+
+
+#ifdef __WINDOWS_MEDIA
+_LIT(KRtspTcpPrefix,"rtspt://");
+_LIT(KRtspUdpPrefix,"rtspu://");
+_LIT(KHttpPrefix,"http://");
+_LIT(KHttpTcpPrefix,"httpt://");
+_LIT(KMmsPrefix,"mms://");
+_LIT(KMmstPrefix,"mmst://");
+#endif // __WINDOWS_MEDIA
+
+_LIT(KRtspPrefix,"rtsp://");
+_LIT(KFilePrefix,"file://");
+
+const TInt KMinPrefixLength = 6;
+
+
+// ============================ MEMBER FUNCTIONS ===================================================
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::CMediaRecognizer
+// C++ default constructor can NOT contain any code, that might leave.
+// -------------------------------------------------------------------------------------------------
+//
+CMediaRecognizer::CMediaRecognizer()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -------------------------------------------------------------------------------------------------
+//
+void CMediaRecognizer::ConstructL()
+{
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::NewL
+// Two-phased constructor.
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer* CMediaRecognizer::NewL()
+{
+ MPX_DEBUG(_L("CMediaRecognizer::NewL()"));
+
+ CMediaRecognizer* self = new( ELeave ) CMediaRecognizer;
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::~CMediaRecognizer
+// Destructor
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::~CMediaRecognizer()
+{
+ MPX_DEBUG(_L("CMediaRecognizer::~CMediaRecognizer()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::IdentifyMediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::TMediaType
+CMediaRecognizer::IdentifyMediaTypeL( const TDesC& aMediaName, TBool /*aIncludeUrls*/ )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL()"));
+
+ TMediaType ret = EUnidentified;
+
+ if ( aMediaName == KTestLocalFilename )
+ {
+ ret = ELocalVideoFile;
+ }
+ else if ( aMediaName == KTestRamFilename )
+ {
+ ret = ELocalRamFile;
+ }
+
+ return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::IdentifyMediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::TMediaType
+CMediaRecognizer::IdentifyMediaTypeL( const TDesC& aMediaName, RFile& aFile, TBool /*aIncludeUrls*/ )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL()"));
+
+ TMediaType ret = EUnidentified;
+
+ if ( aFile.SubSessionHandle() )
+ {
+ ret = MediaTypeL( aMediaName );
+ }
+ else
+ {
+ ret = EUrl;
+ }
+
+ return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+CMediaRecognizer::TMediaType CMediaRecognizer::MediaTypeL( const TDesC& aMediaName )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL()"));
+
+ TMediaType ret = EUnidentified;
+
+ _LIT(KSdpExt,".sdp");
+ _LIT(K3gpExt,".3gp");
+
+ if ( aMediaName.Right(KSdpExt.iTypeLength).CompareF(KSdpExt) == 0 )
+ {
+ ret = ELocalSdpFile;
+ }
+ else if ( aMediaName.Right(K3gpExt.iTypeLength).CompareF(K3gpExt) == 0 )
+ {
+ ret = ELocalVideoFile;
+ }
+
+ return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MimeTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBuf<KMaxDataTypeLength> CMediaRecognizer::MimeTypeL( const TDesC& /*aLocalFile*/ )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::MimeTypeL()"));
+
+ TPtrC mimeType( KNullDesC );
+
+ return mimeType;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::FreeFilehandle
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C void CMediaRecognizer::FreeFilehandle()
+{
+ MPX_DEBUG(_L("CMediaRecognizer::FreeFilehandle()"));
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MimeTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBuf<KMaxDataTypeLength> CMediaRecognizer::MimeTypeL( RFile& /*aFile*/ )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::MimeTypeL()"));
+
+ TPtrC mimeType( KNullDesC );
+
+ return mimeType;
+}
+
+//--------------------------------------------------------------------------------------------------
+// CMediaRecognizer::IsValidStreamingPrefix
+// Check for a valid streaming prefix given a URL
+//--------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaRecognizer::IsValidStreamingPrefix( const TDesC& aUrl )
+{
+ TBool retVal = EFalse;
+
+ if ( aUrl.Length() >= KMinPrefixLength )
+ {
+ MPX_DEBUG(_L("CMediaRecognizer::IsValidStreamingPrefix(%S)"), &aUrl);
+
+#ifdef __WINDOWS_MEDIA
+ if ( ( ! aUrl.Left(KRtspPrefix().Length()).CompareF(KRtspPrefix) ) ||
+ ( ! aUrl.Left(KHttpPrefix().Length()).CompareF(KHttpPrefix) ) ||
+ ( ! aUrl.Left(KMmsPrefix().Length()).CompareF(KMmsPrefix) ) ||
+ ( ! aUrl.Left(KMmstPrefix().Length()).CompareF(KMmstPrefix) ) ||
+ ( ! aUrl.Left(KHttpTcpPrefix().Length()).CompareF(KHttpTcpPrefix) ) ||
+ ( ! aUrl.Left(KRtspTcpPrefix().Length()).CompareF(KRtspTcpPrefix) ) ||
+ ( ! aUrl.Left(KRtspUdpPrefix().Length()).CompareF(KRtspUdpPrefix) ) )
+#else
+ if ( ! aUrl.Left( KRtspPrefix().Length() ).CompareF( KRtspPrefix ) )
+#endif
+ {
+ retVal = ETrue;
+ }
+ }
+
+ MPX_DEBUG(_L("CMediaRecognizer::IsValidStreamingPrefix() ret %d"), retVal);
+
+ return retVal;
+}
+
+//--------------------------------------------------------------------------------------------------
+// CMediaRecognizer::IsValidUrlPrefix
+// Check for a valid prefix given a URL
+//--------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaRecognizer::IsValidUrlPrefix( const TDesC& aUrl )
+{
+ TBool retVal = EFalse;
+
+ if ( aUrl.Length() >= KMinPrefixLength )
+ {
+ MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix(%S)"), &aUrl);
+
+ if ( ( ! aUrl.Left(KFilePrefix().Length()).CompareF(KFilePrefix) ) ||
+#ifdef __WINDOWS_MEDIA
+ ( ! aUrl.Left(KHttpPrefix().Length()).CompareF(KHttpPrefix) ) ||
+ ( ! aUrl.Left(KMmsPrefix().Length()).CompareF(KMmsPrefix) ) ||
+ ( ! aUrl.Left(KMmstPrefix().Length()).CompareF(KMmstPrefix) ) ||
+ ( ! aUrl.Left(KHttpTcpPrefix().Length()).CompareF(KHttpTcpPrefix) ) ||
+ ( ! aUrl.Left(KRtspTcpPrefix().Length()).CompareF(KRtspTcpPrefix) ) ||
+ ( ! aUrl.Left(KRtspUdpPrefix().Length()).CompareF(KRtspUdpPrefix) ) ||
+#endif
+ ( ! aUrl.Left(KRtspPrefix().Length()).CompareF(KRtspPrefix) ) )
+ {
+ retVal = ETrue;
+ }
+ }
+
+ MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix() ret %d"), retVal);
+
+ return retVal;
+}
+
+//--------------------------------------------------------------------------------------------------
+// CMediaRecognizer::IsValidUrlPrefix
+// Check for a valid prefix given a URL
+//--------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBool CMediaRecognizer::IsValidUrlPrefix( const TDesC8& aUrl )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix(TDesC8)"));
+
+ TBool retVal = EFalse;
+
+ if ( aUrl.Length() >= KMinPrefixLength )
+ {
+ HBufC16* buf16 = NULL;
+
+ TRAPD( err, buf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aUrl); );
+
+ if ( ! err )
+ {
+ retVal = IsValidUrlPrefix( buf16->Des() );
+ delete buf16;
+ }
+ }
+
+ MPX_DEBUG(_L("CMediaRecognizer::IsValidUrlPrefix(TDesC8) ret %d"), retVal);
+
+ return retVal;
+}
+
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::IdentifyMediaTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C CMediaRecognizer::TMediaType
+CMediaRecognizer::IdentifyMediaTypeL( const TDesC& aMediaName, RFile64& aFile, TBool /*aIncludeUrls*/ )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::IdentifyMediaTypeL( RFile64 )"));
+
+ TMediaType ret = EUnidentified;
+
+ if ( aFile.SubSessionHandle() )
+ {
+ ret = MediaTypeL( aMediaName );
+ }
+ else
+ {
+ ret = EUrl;
+ }
+
+ return ret;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMediaRecognizer::MimeTypeL
+// -------------------------------------------------------------------------------------------------
+//
+EXPORT_C TBuf<KMaxDataTypeLength> CMediaRecognizer::MimeTypeL( RFile64& /*aFile*/ )
+{
+ MPX_DEBUG(_L("CMediaRecognizer::MimeTypeL( RFile64 )"));
+
+ TPtrC mimeType( KNullDesC );
+
+ return mimeType;
+}
+
+#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mpxcollectionplaylist.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx collection playlist class stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#include "mpxcollectionplaylist.h"
+
+CMPXCollectionPlaylist::CMPXCollectionPlaylist()
+{
+}
+
+CMPXCollectionPlaylist::~CMPXCollectionPlaylist()
+{
+}
+
+CMPXCollectionPlaylist* CMPXCollectionPlaylist::NewL(const CMPXCollectionPath& /*aPath*/)
+{
+ CMPXCollectionPlaylist* p = new CMPXCollectionPlaylist();
+ return p;
+}
+
+void CMPXCollectionPlaylist::SetSingleItemPlaylist()
+{
+}
+
+void CMPXCollectionPlaylist::SetToFirst()
+{
+}
+
+void CMPXCollectionPlaylist::SetAutoPlay(TBool /*aAutoPlay*/)
+{
+}
+
+void CMPXCollectionPlaylist::SetPreInitPlugin(TBool /*aPreInit*/)
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mpxcollectionutility_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx collection utility stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#include "mpxcollectionutilityimp_stub.h"
+
+MMPXCollectionUtility*
+MMPXCollectionUtility::NewL( MMPXCollectionObserver* aObs, const TUid& aModeId )
+{
+ return CMPXCollectionUtility::NewL( aModeId, aObs );
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mpxcollectionutilityimp_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,328 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx collection utility stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include <mpxcollectionplaylist.h>
+#include <mpxcollectionpath.h>
+#include <mpxcollectionplaylistobserver.h>
+
+#include "testutilities.h"
+#include "mpxcollectionutilityimp_stub.h"
+#include "mpxvideo_debug.h"
+
+
+CMPXCollectionUtility*
+CMPXCollectionUtility::NewL( const TUid& /*aModeId*/, MMPXCollectionObserver* aObs )
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::NewL()"));
+/*
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( Dll::Tls() );
+
+ if ( ! utility )
+ {
+ utility = new (ELeave) TestUtilities;
+
+ Dll::SetTls( utility );
+ }
+
+ if ( ! utility->iCollectionUtility )
+ {
+ utility->iCollectionUtility = new (ELeave) CMPXCollectionUtility( aObs );
+ }
+
+ utility->iCollectionUtility->AddRefCount();
+
+ return utility->iCollectionUtility;
+*/
+
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+
+ if ( !utility )
+ {
+ utility = new (ELeave) TestUtilities;
+
+ UserSvr::DllSetTls(12345678, utility);
+
+ utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+ }
+
+
+
+
+ if ( ! utility->iCollectionUtility )
+ {
+ utility->iCollectionUtility = new (ELeave) CMPXCollectionUtility( aObs );
+ }
+
+ utility->iCollectionUtility->AddRefCount();
+
+ return utility->iCollectionUtility;
+
+}
+
+CMPXCollectionUtility::~CMPXCollectionUtility()
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::~CMPXCollectionUtility()"));
+
+ if ( iCollectionPath )
+ {
+ delete iCollectionPath;
+ }
+}
+
+CMPXCollectionUtility::CMPXCollectionUtility( MMPXCollectionObserver* aObs )
+ : iObserver( aObs ),
+ iCollectionPath( NULL ),
+ iRefCount(0)
+{
+}
+
+void CMPXCollectionUtility::ConstructL( const TUid& /*aModeId*/ )
+{
+}
+
+/*
+void CMPXCollectionUtility::AddTestObserverL( MAppUiEngineUnitTestObserver* aObserver )
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::AddTestObserverL()"));
+
+ iTestObserver = aObserver;
+}
+
+void CMPXCollectionUtility::RemoveTestObserverL()
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::RemoveTestObserverL()"));
+
+ iTestObserver = NULL;
+}
+*/
+
+MMPXCollection&
+CMPXCollectionUtility::Collection()
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::Collection()"));
+ return *this;
+}
+
+TUid
+CMPXCollectionUtility::CollectionIDL( const TArray<TUid>& /*aUids*/ )
+{
+ return KNullUid;
+}
+
+void CMPXCollectionUtility::AddSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXCollectionUtility::RemoveSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXCollectionUtility::ClearSubscriptionsL()
+{
+}
+
+void CMPXCollectionUtility::AddRefCount()
+{
+ iRefCount++;
+}
+
+void CMPXCollectionUtility::Close()
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::Close()"),
+ _L("iRefCount = %d"), iRefCount );
+
+ if ( --iRefCount == 0 )
+ {
+ //TestUtilities* utility = reinterpret_cast<TestUtilities*>( Dll::Tls() );
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+
+ utility->DeleteCollectionUtility();
+ }
+}
+
+void CMPXCollectionUtility::OpenL( TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( TInt /*aIndex*/, TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const CMPXCollectionPath& /*aPath*/, TMPXOpenMode /*aMode*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::OpenL()"));
+
+/* if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = ECollectionUtilityOpen;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+*/
+}
+
+void CMPXCollectionUtility::OpenL( TInt /*aIndex*/,
+ const TArray<TMPXAttribute>& /*aAttrs*/,
+ TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const CMPXCollectionPath& /*aPath*/,
+ const TArray<TMPXAttribute>& /*aAttrs*/,
+ TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const TArray<TUid>& /*aUids*/, TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::OpenL( const TUid& /*aUid*/, TMPXOpenMode /*aMode*/ )
+{
+}
+
+void CMPXCollectionUtility::SetFilterL( CMPXFilter* /*aFilter*/ )
+{
+}
+
+CMPXFilter* CMPXCollectionUtility::FilterL()
+{
+ return NULL;
+}
+
+TUid
+CMPXCollectionUtility::UidL() const
+{
+ return KNullUid;
+}
+
+CMPXCollectionPath* CMPXCollectionUtility::PathL()
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::PathL()"));
+
+ CMPXCollectionPath* cp = CMPXCollectionPath::NewL();
+
+ TMPXItemId item1;
+ TMPXItemId item2;
+
+ cp->AppendL( item1 );
+ cp->AppendL( item2 );
+
+ return cp;
+}
+
+void CMPXCollectionUtility::BackL()
+{
+}
+
+TBool CMPXCollectionUtility::IsRemote( const CMPXCollectionPath& /*aPath*/ )
+{
+ return EFalse;
+}
+
+void CMPXCollectionUtility::CancelRequest()
+{
+}
+
+void CMPXCollectionUtility::AddL( const CMPXMedia& /*aNewProperties*/ )
+{
+}
+
+void CMPXCollectionUtility::RemoveL( const CMPXCollectionPath& /*aPath*/,
+ MMPXCollectionRemoveObserver* /*aObs*/ )
+{
+}
+
+void CMPXCollectionUtility::RemoveL( const CMPXMedia& /*aProperties*/ )
+{
+}
+
+void CMPXCollectionUtility::SetSyncL( const CMPXMedia& /*aMedia*/ )
+{
+}
+
+void CMPXCollectionUtility::SetL( const CMPXMedia& /*aMedia*/ )
+{
+}
+
+void CMPXCollectionUtility::FindAllL( const CMPXMedia& /*aMedia*/,
+ const TArray<TMPXAttribute>& /*aAttrs*/,
+ MMPXCollectionFindObserver& /*aObs*/ )
+{
+}
+
+// ----------------------------------------------------------------------------
+// Find media sync
+// ----------------------------------------------------------------------------
+//
+CMPXMedia*
+CMPXCollectionUtility::FindAllL( const CMPXMedia& /*aMedia*/,
+ const TArray<TMPXAttribute>& /*aAttrs*/ )
+{
+ return NULL;
+}
+
+void CMPXCollectionUtility::MediaL( const CMPXCollectionPath& /*aPath*/,
+ const TArray<TMPXAttribute>& /*aAttrs*/,
+ CMPXAttributeSpecs* /*aSpecs*/,
+ CMPXFilter* /*aFilter*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXCollectionUtility::MediaL()"));
+
+/* if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = ECollectionUtilityMedia;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+*/
+}
+
+void CMPXCollectionUtility::NotifyL( TMPXCollectionBroadCastMsg /*aMsg*/, TInt /*aData*/ )
+{
+}
+
+void CMPXCollectionUtility::CommandL( TMPXCollectionCommand /*aCmd*/, TInt /*aData*/ )
+{
+}
+
+void CMPXCollectionUtility::CommandL( CMPXCommand& /*aCmd*/ )
+{
+}
+
+void CMPXCollectionUtility::GetSupportedTypesL( RPointerArray<CMPXCollectionType>& /*aArray*/ )
+{
+}
+
+void CMPXCollectionUtility::GetSupportedCapabilitiesL( TCollectionCapability& /*aCapability*/ )
+{
+}
+
+TUid CMPXCollectionUtility::CollectionIDL( TUid& /*aCollection*/ )
+{
+ return KNullUid;
+}
+
+void CMPXCollectionUtility::MessageReceived( TInt /*aMsgData*/, TInt /*aError*/ )
+{
+}
+
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mpxplaybackutilityimp_stub.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,482 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx playback utility stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include <mpxcommandgeneraldefs.h>
+#include <mpxplaybackcommanddefs.h>
+#include <mpxmediageneralextdefs.h>
+
+#include "mpxplaybackutilityimp_stub.h"
+#include "mpxvideoplayerconstants.h"
+#include "testutilities.h"
+#include "testvideoappuiengine.h"
+#include <mpxvideoplaybackdefs.h>
+#include "mpxvideo_debug.h"
+
+
+MMPXPlaybackUtility* MMPXPlaybackUtility::UtilityL( const TMPXCategory aCategory, const TUid& aModeId )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::UtilityL()"));
+
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+
+ if ( !utility )
+ {
+ utility = new (ELeave) TestUtilities;
+
+ UserSvr::DllSetTls(12345678, utility);
+
+ utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+ }
+
+
+ if ( ! utility->iPlaybackUtility )
+ {
+ utility->iPlaybackUtility = new (ELeave) CMPXPlaybackUtility();
+ }
+
+ utility->iPlaybackUtility->AddRefCount();
+
+ return utility->iPlaybackUtility;
+
+
+}
+
+CMPXPlaybackUtility::~CMPXPlaybackUtility()
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::~CMPXPlaybackUtility()"));
+
+ iObservers.Close();
+}
+
+CMPXPlaybackUtility::CMPXPlaybackUtility()
+{
+}
+
+void CMPXPlaybackUtility::AddRefCount()
+{
+ iRefCount++;
+}
+
+void CMPXPlaybackUtility::StartPdlPlaybackUtility()
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::StartPdlPlaybackUtility()"));
+
+/* if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityPdlInstance;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+*/
+}
+
+void CMPXPlaybackUtility::AddTestObserverL( MAppUiEngineUnitTestObserver* aObserver )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::AddTestObserverL()"));
+
+ iTestObserver= aObserver;
+}
+
+void CMPXPlaybackUtility::RemoveTestObserverL()
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::RemoveTestObserverL()"));
+
+ iTestObserver = NULL;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// MMPXPlaybackUtility Implementation
+// -------------------------------------------------------------------------------------------------
+
+void CMPXPlaybackUtility::AddObserverL( MMPXPlaybackObserver& aObs )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::AddObserverL()"));
+ iObservers.AppendL(&aObs);
+}
+
+void CMPXPlaybackUtility::RemoveObserverL( MMPXPlaybackObserver& aObs )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::RemoveObserverL()"));
+
+ TInt i = iObservers.FindL(&aObs);
+ iObservers.Remove(i);
+}
+
+
+void CMPXPlaybackUtility::GetClientsL( RArray<TProcessId>& /*aClients*/ )
+{
+}
+
+void CMPXPlaybackUtility::UpdatePlaylistL( const CMPXCollectionPlaylist& /*aPlaylist*/ )
+{
+}
+
+void CMPXPlaybackUtility::InitL( const CMPXCollectionPlaylist& /*aPlaylist*/, TBool /*aPlay*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitL(CMPXCollectionPlaylist)"));
+
+ if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityInitPlaylist;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+
+}
+
+void CMPXPlaybackUtility::InitL( const TDesC& aUri, const TDesC8* /*aType*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitL()"),
+ _L("aUri = %S"), &aUri );
+
+ if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityInitFileName;
+ event->iFileName = aUri;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+
+}
+
+void CMPXPlaybackUtility::InitL( RFile& aShareableFile )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitL( RFile )"));
+
+/* if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityInitFileHandle;
+ aShareableFile.FullName( event->iFileName );
+ iTestObserver->HandleUtilityEvent( event );
+ }
+*/
+}
+
+void CMPXPlaybackUtility::Close()
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::Close()"),
+ _L("iRefCount = %d"), iRefCount );
+
+ //
+ // When the ref count is 2, it should be the app ui engine closing the utility
+ //
+ if ( iRefCount == 2 )
+ {
+/* if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityClose;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+*/
+ }
+
+ if ( --iRefCount == 0 )
+ {
+ TestUtilities* utility = reinterpret_cast<TestUtilities*>( UserSvr::DllTls(12345678) );
+
+ utility->DeletePlaybackUtility();
+ }
+}
+
+void CMPXPlaybackUtility::CancelRequest()
+{
+}
+
+void CMPXPlaybackUtility::CommandL( TMPXPlaybackCommand aCmd, TInt /*aData*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::CommandL()"),
+ _L("aCmd = %d"), aCmd );
+
+ switch ( aCmd )
+ {
+ case EPbCmdPlay:
+ {
+ if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityPlayCmd;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+
+ break;
+ }
+ }
+}
+
+void CMPXPlaybackUtility::CommandL( CMPXCommand& aCmd, MMPXPlaybackCallback* /*aCallback*/ )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::CommandL( CMPXCommand )"));
+
+ if ( aCmd.IsSupported( KMPXCommandGeneralId ) )
+ {
+ TInt cmdId = *aCmd.Value<TInt>(KMPXCommandGeneralId);
+
+ MPX_DEBUG(_L("CMPXPlaybackUtility::CommandL() id = 0x%08x"), cmdId );
+
+ switch ( cmdId )
+ {
+ case KMPXCommandIdPlaybackGeneral:
+ {
+ break;
+ }
+ case KMPXMediaIdVideoPlayback:
+ {
+ TMPXVideoPlaybackCommand videoCmd =
+ static_cast<TMPXVideoPlaybackCommand>(
+ *aCmd.Value<TInt>(KMPXMediaVideoPlaybackCommand) );
+
+ switch ( videoCmd )
+ {
+ case EPbCmdUpdateSeekable:
+ {
+ TBool seekable = *aCmd.Value<TBool>( KMPXMediaGeneralExtVideoSeekable );
+
+ if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EAsxAttributeSeekUpdate;
+ event->iExtra = seekable;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+
+ break;
+ }
+ }
+
+ break;
+ }
+
+ }
+ }
+}
+
+TMPXPlaybackState CMPXPlaybackUtility::StateL() const
+{
+ return EPbStateNotInitialised;
+}
+
+MMPXSource* CMPXPlaybackUtility::Source()
+{
+ return this;
+}
+
+MMPXPlayerManager& CMPXPlaybackUtility::PlayerManager()
+{
+ return *this;
+}
+
+void CMPXPlaybackUtility::SetL( TMPXPlaybackProperty /*aProperty*/, TInt /*aValue*/ )
+{
+}
+
+void CMPXPlaybackUtility::ValueL( MMPXPlaybackCallback& /*aCallback*/,
+ TMPXPlaybackProperty /*aProperty*/ )
+{
+}
+
+void CMPXPlaybackUtility::PropertyL( MMPXPlaybackCallback& /*aCallback*/,
+ TMPXPlaybackProperty /*aProperty*/ )
+{
+}
+
+CDesCArray* CMPXPlaybackUtility::SupportedMimeTypes()
+{
+ return NULL;
+}
+
+CDesCArray* CMPXPlaybackUtility::SupportedExtensions()
+{
+ return NULL;
+}
+
+CDesCArray* CMPXPlaybackUtility::SupportedSchemas()
+{
+ return NULL;
+}
+
+void CMPXPlaybackUtility::SetPriority( TInt /*aPriority*/ )
+{
+}
+
+void CMPXPlaybackUtility::AddSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXPlaybackUtility::RemoveSubscriptionL( const CMPXSubscription& /*aSubscription*/ )
+{
+}
+
+void CMPXPlaybackUtility::ClearSubscriptionsL()
+{
+}
+
+void CMPXPlaybackUtility::InitStreamingL( const TDesC& aUri,
+ const TDesC8* /*aType*/,
+ const TInt aAccessPoint )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitStreamingL()"),
+ _L("aUri = %S, aAccessPoint = %d"), &aUri, aAccessPoint );
+
+ if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityInitStreamingUrl;
+ event->iFileName = aUri;
+ event->iApId = aAccessPoint;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+
+}
+
+void CMPXPlaybackUtility::InitStreamingL( RFile& aShareableFile, const TInt aAccessPoint )
+{
+ MPX_ENTER_EXIT(_L("CMPXPlaybackUtility::InitStreamingL( RFile )"),
+ _L("aAccessPoint = %d"), aAccessPoint );
+/*
+ if ( iTestObserver )
+ {
+ TCallbackEvent* event = new TCallbackEvent;
+ event->iEvent = EPlaybackUtilityInitStreamingFileHandle;
+ aShareableFile.FullName( event->iFileName );
+ event->iApId = aAccessPoint;
+ iTestObserver->HandleUtilityEvent( event );
+ }
+*/
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// MMPXPlayerManager Implementation
+// -------------------------------------------------------------------------------------------------
+
+void CMPXPlaybackUtility::GetPlayerTypesL( RArray<TMPXPlaybackPlayerType>& /*aTypes*/ )
+{
+}
+
+HBufC* CMPXPlaybackUtility::PlayerTypeDisplayNameL( TMPXPlaybackPlayerType /*aType*/ )
+{
+ return NULL;
+}
+
+void CMPXPlaybackUtility::GetPlayerListL( RArray<TUid>& /*aPlayers*/ )
+{
+}
+
+void CMPXPlaybackUtility::GetPlayerListL( RArray<TUid>& /*aPlayers*/,
+ TMPXPlaybackPlayerType /*aType*/ )
+{
+}
+
+void CMPXPlaybackUtility::SubPlayerNamesL( MMPXPlaybackCallback& /*aCallback*/, TUid /*aPlayer*/ )
+{
+}
+
+void CMPXPlaybackUtility::SelectPlayersL( TMPXPlaybackPlayerType /*aType*/ )
+{
+}
+
+void CMPXPlaybackUtility::SelectSubPlayerL( TUid /*aPlayer*/, TInt /*aSubPlayerIndex*/ )
+{
+}
+
+void CMPXPlaybackUtility::SelectPlayerL( TUid /*aPlayer*/ )
+{
+}
+
+void CMPXPlaybackUtility::ClearSelectPlayersL()
+{
+}
+
+void CMPXPlaybackUtility::GetSelectionL( TMPXPlaybackPlayerType& /*aType*/,
+ TUid& /*aPlayer*/,
+ TInt& /*aSubPlayerIndex*/,
+ HBufC*& /*aSubPlayerName*/ )
+{
+}
+
+MMPXPlayer* CMPXPlaybackUtility::CurrentPlayer()
+{
+ return this;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// MMPXPlayer Implementation
+// -------------------------------------------------------------------------------------------------
+
+TMPXPlaybackPlayerType CMPXPlaybackUtility::TypeL()
+{
+ return EPbUnknown;
+}
+
+HBufC* CMPXPlaybackUtility::TypeNameL()
+{
+ return NULL;
+}
+
+void CMPXPlaybackUtility::SubPlayerNamesL( MMPXPlaybackCallback& /*aCallback*/ )
+{
+}
+
+TInt CMPXPlaybackUtility::SubPlayerL() const
+{
+ return 0;
+}
+
+TUid CMPXPlaybackUtility::UidL() const
+{
+ return KNullUid;
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// MPXSource Implementation
+// -------------------------------------------------------------------------------------------------
+
+CMPXCollectionPlaylist* CMPXPlaybackUtility::PlaylistL()
+{
+ return NULL;
+}
+
+RFile* CMPXPlaybackUtility::FileL()
+{
+ return NULL;
+}
+
+HBufC* CMPXPlaybackUtility::UriL()
+{
+ return NULL;
+}
+
+void CMPXPlaybackUtility::MediaL( const TArray<TMPXAttribute>& /*aAttrs*/,
+ MMPXPlaybackCallback& /*aCallback*/ )
+{
+}
+
+void CMPXPlaybackUtility::MediaL( const TArray<TMPXAttribute>& /*aAttrs*/,
+ MMPXPlaybackCallback& /*aCallback*/,
+ CMPXAttributeSpecs* /*aSpecs*/ )
+{
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/mpxvideoplaybackwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Stub-implementation of QMpxVideoPlaybackWrapper
+*
+*/
+
+// Version : %version: 1 %
+
+
+#include "mpxvideoplaybackwrapper.h"
+
+int mCount = 0;
+
+QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
+{
+ QMpxVideoPlaybackWrapper::Increment();
+}
+
+QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
+{
+ QMpxVideoPlaybackWrapper::Decrement();
+}
+
+void QMpxVideoPlaybackWrapper::openPlaybackView()
+{
+ emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
+}
+
+void QMpxVideoPlaybackWrapper::Increment()
+{
+ ++mCount;
+}
+
+void QMpxVideoPlaybackWrapper::Decrement()
+{
+ if(mCount > 0)
+ {
+ --mCount;
+ }
+}
+
+int QMpxVideoPlaybackWrapper::GetInstanceCount()
+{
+ return mCount;
+}
+
+int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
+{
+ return 0;
+}
+
+void QMpxVideoPlaybackWrapper::lateInit()
+{
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/testutilities.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpx utilities class stub for unit testing
+*
+*/
+
+// Version : %version: 1 %
+
+#include "testutilities.h"
+
+void TestUtilities::DeleteCollectionUtility()
+{
+ delete iCollectionUtility;
+ iCollectionUtility = NULL;
+
+ CloseUtility();
+}
+
+void TestUtilities::DeletePlaybackUtility()
+{
+ delete iPlaybackUtility;
+ iPlaybackUtility = NULL;
+
+ CloseUtility();
+}
+
+void TestUtilities::CloseUtility()
+{
+ if ( iCollectionUtility == NULL && iPlaybackUtility == NULL )
+ {
+ delete this;
+
+ //Dll::SetTls( NULL );
+ UserSvr::DllSetTls(12345678, NULL);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/stub/src/videoplaylistutility.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: video playlist utility class stub for unit testing
+*
+*/
+
+// Version : %version: 2 %
+
+#include <mpxmedia.h>
+
+#include "videoplaylistutility.h"
+#include "mpxvideo_debug.h"
+
+CVideoPlaylistUtility::CVideoPlaylistUtility()
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::CVideoPlaylistUtility()"));
+}
+
+CVideoPlaylistUtility::~CVideoPlaylistUtility()
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::~CVideoPlaylistUtility()"));
+}
+
+CVideoPlaylistUtility* CVideoPlaylistUtility::NewL()
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::NewL()"));
+
+ CVideoPlaylistUtility* p = new CVideoPlaylistUtility();
+ return p;
+}
+
+void CVideoPlaylistUtility::GetFileInfoL( RFile& /* aFile */,
+ CMediaRecognizer::TMediaType /* aMediaType */,
+ TBool& aSingleLink,
+ TBool& aLocalFile)
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::GetFileInfoL( RFile )"));
+
+ aSingleLink = ETrue;
+ aLocalFile = EFalse;
+}
+
+void CVideoPlaylistUtility::GetFileInfoL( const TDesC& /* aFileName */,
+ CMediaRecognizer::TMediaType /* aMediaType */,
+ TBool& aSingleLink,
+ TBool& aLocalFile)
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::GetFileInfoL( aFileName )"));
+
+ aSingleLink = ETrue;
+ aLocalFile = EFalse;
+}
+
+
+
+CMPXMedia* CVideoPlaylistUtility::GetPlayListL( TInt /* aAccessPointId */)
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::GetPlayListL()"));
+
+ CMPXMedia* playlist = NULL;
+ return playlist;
+}
+
+
+TBool CVideoPlaylistUtility::IsSeekable()
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::IsSeekable()"));
+ return ETrue;
+}
+
+
+TPtrC CVideoPlaylistUtility::GetLinkLC()
+{
+ MPX_DEBUG(_L("CVideoPlaylistUtility::GetLinkLC()"));
+
+ _LIT(KTestRtspUrl, "rtsp://testserver/test.3gp");
+
+ TBool localUrl;
+ HBufC* tempBuffer = HBufC::NewLC( 255 );
+
+ TPtr tempurl(tempBuffer->Des());
+
+ tempurl.Append(KTestRtspUrl);
+
+ return tempurl;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoappuiengine/testvideoappuiengine.pro Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Project file for building Videoplayer components
+#
+#
+# Version : %version: 2 %
+
+
+TEMPLATE = app
+TARGET = testvideoappuiengine
+DEFINES += BUILD_VIDEOPLAYERAPP_DLL
+
+INCLUDEPATH += stub/inc \
+ ../../../../inc \
+ $$MW_LAYER_SYSTEMINCLUDE
+
+DEPENDPATH += stub/inc stub/src inc src
+
+CONFIG += qtestlib hb qt
+
+LIBS += -lmpxcollectionhelper.dll \
+ -lmpxcommon.dll \
+ -lefsrv.dll \
+ -lcharconv.dll
+
+# Input
+HEADERS += mpxvideoplaybackwrapper.h \
+ testvideoappuiengine.h \
+ mpxcollectionutilityimp_stub.h \
+ mpxplaybackutilityimp_stub.h \
+ hbinstance.h \
+ hbview.h \
+ testutilities.h \
+ mpxcollectionplaylist.h \
+ videoplaylistutility.h \
+ ../../inc/mpxvideoplayerappuiengine.h
+
+SOURCES += mpxvideoplaybackwrapper.cpp \
+ coneutils_stub.cpp \
+ mpxcollectionutility_stub.cpp \
+ mpxcollectionutilityimp_stub.cpp \
+ testvideoappuiengine.cpp \
+ mpxplaybackutilityimp_stub.cpp \
+ hbinstance.cpp \
+ testutilities.cpp \
+ mediarecognizer_stub.cpp \
+ mpxcollectionplaylist.cpp \
+ videoplaylistutility.cpp \
+ ../../src/mpxvideoplayerappuiengine.cpp
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h Mon May 03 12:32:50 2010 +0300
@@ -23,6 +23,8 @@
// - how to setup construction to fail for testing purposes
+// Version : %version: %
+
#ifndef __TESTVIDEOPLAYERENGINE_H__
#define __TESTVIDEOPLAYERENGINE_H__
@@ -84,7 +86,8 @@
signals:
- void aboutToQuit();
+ void aboutToQuit();
+ void command( int );
private:
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/src/testvideoplayerengine.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
// INCLUDES
#include <QtTest/QtTest>
#include <qdebug.h>
@@ -25,6 +27,9 @@
#include <hbaction.h>
#include <hbapplication.h>
#include <qabstractitemmodel.h>
+#include <xqsharablefile.h>
+#include <f32file.h>
+#include <qfile.h>
#include "mpxhbvideocommondefs.h"
#include "testvideoplayerengine.h"
@@ -32,6 +37,8 @@
#include "stub/inc/videoservices.h"
#include "stub/inc/xqpluginloader.h"
#include "../stub/inc/mpxvideoplaybackwrapper.h"
+#include "mpxvideo_debug.h"
+
#define private public
#include "videoplayerengine.h"
#undef private
@@ -63,10 +70,13 @@
, mCollectionViewPlugin(0)
, mFileDetailsViewPlugin(0)
{
+ MPX_DEBUG(_L("TestVideoPlayerEngine::TestVideoPlayerEngine()"));
}
TestVideoPlayerEngine::~TestVideoPlayerEngine()
{
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::~TestVideoPlayerEngine()"));
+
XQPluginLoader::cleanup();
delete mTestObject;
@@ -74,8 +84,10 @@
}
-void TestVideoPlayerEngine::init(bool isService)
+void TestVideoPlayerEngine::init( bool isService )
{
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::init()"));
+
XQPluginLoader::mFailToLoadPluginUid = -1;
mCurrentViewPlugin = 0;
@@ -89,6 +101,8 @@
void TestVideoPlayerEngine::cleanup()
{
+ MPX_ENTER_EXIT(_L("TestVideoPlayerEngine::cleanup()"));
+
mCurrentViewPlugin = 0;
mPlaybackViewPlugin = 0;
mCollectionViewPlugin = 0;
@@ -102,6 +116,8 @@
void TestVideoPlayerEngine::testCreateDelete()
{
+ MPX_DEBUG(_L("TestVideoServices::testCreateDelete()"));
+
//Test object creation and deletion
init();
@@ -124,6 +140,8 @@
void TestVideoPlayerEngine::testCreateDeleteService()
{
+ MPX_DEBUG(_L("TestVideoServices::testCreateDeleteService()"));
+
//Test object creation and deletion
init(true);
@@ -145,6 +163,8 @@
void TestVideoPlayerEngine::testInitialize()
{
+ MPX_DEBUG(_L("TestVideoServices::testInitialize()"));
+
init();
QVERIFY(mTestObject);
@@ -178,6 +198,8 @@
void TestVideoPlayerEngine::testInitializeService()
{
+ MPX_DEBUG(_L("TestVideoServices::testInitializeService()"));
+
init(true);
QVERIFY(mTestObject);
@@ -193,9 +215,9 @@
mTestObject->initialize();
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 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);
@@ -211,6 +233,8 @@
void TestVideoPlayerEngine::testMultipleInitialize()
{
+ MPX_DEBUG(_L("TestVideoServices::testMultipleInitialize()"));
+
init();
QVERIFY(mTestObject);
@@ -252,6 +276,8 @@
void TestVideoPlayerEngine::testMultipleInitializeService()
{
+ MPX_DEBUG(_L("TestVideoServices::testMultipleInitializeService()"));
+
init(true);
QVERIFY(mTestObject);
@@ -266,9 +292,9 @@
mTestObject->initialize();
QVERIFY(mTestObject->mCurrentViewPlugin == 0);
- QVERIFY(mTestObject->mPlaybackViewPlugin == 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);
@@ -296,6 +322,8 @@
void TestVideoPlayerEngine::testHandleCommandPreInit()
{
+ MPX_DEBUG(_L("TestVideoServices::testHandleCommandPreInit()"));
+
init();
QVERIFY(mTestObject);
@@ -325,6 +353,8 @@
void TestVideoPlayerEngine::testHandleCommandPostInit()
{
+ MPX_DEBUG(_L("TestVideoServices::testHandleCommandPostInit()"));
+
init();
QVERIFY(mTestObject);
@@ -405,6 +435,8 @@
void TestVideoPlayerEngine::testHandleCommandPreAndPostInit()
{
+ MPX_DEBUG(_L("TestVideoServices::testHandleCommandPreAndPostInit()"));
+
init();
QVERIFY(mTestObject);
@@ -495,6 +527,8 @@
void TestVideoPlayerEngine::testHandleCommandPluginFail()
{
+ MPX_DEBUG(_L("TestVideoServices::testHandleCommandPluginFail()"));
+
init();
QVERIFY(mTestObject);
@@ -584,6 +618,8 @@
void TestVideoPlayerEngine::testHandleCommandPluginFail1()
{
+ MPX_DEBUG(_L("TestVideoServices::testHandleCommandPluginFail1()"));
+
init();
QVERIFY(mTestObject);
@@ -680,6 +716,8 @@
void TestVideoPlayerEngine::testHandleCommandPluginFail2()
{
+ MPX_DEBUG(_L("TestVideoServices::testHandleCommandPluginFail2()"));
+
init();
QVERIFY(mTestObject);
@@ -771,14 +809,45 @@
void TestVideoPlayerEngine::testPlayMedia()
{
+ MPX_DEBUG(_L("TestVideoServices::testPlayMedia()"));
+
+ // 1. test with a string
init();
mTestObject->playMedia( QString("c:\\data\\videos\\test.3gp"));
QVERIFY(mTestObject);
cleanup();
+
+ // 2. test with a file handle
+ init();
+ XQSharableFile sf;
+ if ( sf.open("C:\\data\\videos\\test.3gp") )
+ {
+ RFile rFile;
+ bool handleOK = sf.getHandle( rFile );
+ if ( handleOK )
+ {
+ mTestObject->playMedia( rFile );
+ }
+
+ QVERIFY(mTestObject);
+
+ sf.close();
+ }
+ cleanup();
+
+ // 3. test with a filename
+ init();
+ QFile qfile("C:\\data\\videos\\test.3gp");
+ mTestObject->playMedia( qfile.fileName() );
+ QVERIFY(mTestObject);
+ cleanup();
+
}
void TestVideoPlayerEngine::testSetEmbedded()
{
+ MPX_DEBUG(_L("TestVideoServices::testSetEmbedded()"));
+
init();
QVERIFY(mTestObject);
mTestObject->setEmbedded();
@@ -788,6 +857,7 @@
void TestVideoPlayerEngine::cleanupTestCase()
{
+ MPX_DEBUG(_L("TestVideoServices::cleanupTestCase()"));
// all common cleanup here
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/mpxvideoplaybackwrapper.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/mpxvideoplaybackwrapper.h Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#4 %
+// Version : %version: da1mmcf#5 %
@@ -25,6 +25,7 @@
#include <qobject>
#include <qstring>
#include <qfile>
+#include <f32file.h>
#include <mpxhbvideocommondefs.h>
@@ -36,6 +37,7 @@
QMpxVideoPlaybackWrapper();
virtual ~QMpxVideoPlaybackWrapper();
int playMedia( QString aFileName );
+ int playMedia( RFile aFile );
public:
void openPlaybackView() ;
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/testviewplugin.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/testviewplugin.h Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
#include "stub/inc/mpxviewpluginqt.h"
class TestViewPlugin : public MpxViewPlugin
@@ -90,22 +92,6 @@
* framework (eg. to switch to previous view).
*/
virtual void back();
-
-signals:
-
- /**
- * Command is the only way to notify from plugin to application
- * about action needed to be executed.
- *
- * @param aCommand enumeration of command type.
- * Currently supported are: ViewBack, CloseApp, GoToNowPlaying, GoToCollectionView.
- * NOTE: It should be specified how to determine between broadly supported operations
- * (back, close etc.) and application/plugin specific (go to collection, go to now playing etc.)
- *
- * There is also one major issue here, that there is no guaranted order of command delivery,
- * so there is second option to use common observer pattern. Should be discussed.
- */
- void command(int aCommand);
private:
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h Mon May 03 12:32:50 2010 +0300
@@ -11,10 +11,12 @@
*
* Contributors:
*
-* Description: ?Description
+* Description: Declaration of VideoServices Stub
*
*/
+// Version : %version: %
+
#ifndef __VIDEOSERVICES_H__
#define __VIDEOSERVICES_H__
@@ -24,6 +26,7 @@
//FORWARD CLASS DECLARATION
class VideoServiceUriFetch;
class VideoServicePlay;
+class VideoServiceView;
class QVideoPlayerEngine;
class VideoServices : public QObject
@@ -51,7 +54,8 @@
{
ENoService,
EUriFetcher,
- EPlayback
+ EPlayback,
+ EView
};
/**
@@ -83,6 +87,9 @@
Q_DISABLE_COPY(VideoServices)
+signals:
+ void activated( int command );
+
private:
/**
@@ -93,12 +100,16 @@
VideoServiceUriFetch* mServiceUriFetch;
VideoServicePlay* mServicePlay;
+
+ VideoServiceView* mServiceView;
VideoServices::TVideoService mCurrentService;
friend class VideoServiceUriFetch;
friend class VideoServicePlay;
+
+ friend class VideoServiceView;
public:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoserviceview.h Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Declaration of VideoServiceView
+*
+*/
+
+// Version : %version: 1 %
+
+#ifndef VIDEOSERVICEVIEW_H
+#define VIDEOSERVICEVIEW_H
+
+#include <QObject>
+
+#include "videoplayerengine.h"
+
+// FORWARD DECLARATIONS
+class VideoServices;
+
+class VideoServiceView : public QObject
+ {
+
+ Q_OBJECT
+
+ public:
+ VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine );
+ virtual ~VideoServiceView();
+
+ public slots:
+ void view( QString filePath );
+
+ private:
+ QVideoPlayerEngine* mEngine;
+ VideoServices* mServiceApp;
+ };
+
+ #endif
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/hbinstance.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/hbinstance.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,8 +15,12 @@
*
*/
+// Version : %version: %
+
+#include <hbmainwindow.h>
+
#include "stub/inc/hbinstance.h"
-#include <hbmainwindow.h>
+#include "mpxvideo_debug.h"
bool initialised = false;
HbInstance* mInstance = 0;
@@ -24,14 +28,18 @@
HbInstance::HbInstance()
{
+ MPX_DEBUG(_L("HbInstance::HbInstance()"));
}
HbInstance::~HbInstance()
{
+ MPX_DEBUG(_L("HbInstance::~HbInstance()"));
}
HbInstance* HbInstance::instance()
{
+ MPX_ENTER_EXIT(_L("TestVideoServices::instance()"));
+
if (!initialised)
{
mInstance = new HbInstance();
@@ -43,23 +51,28 @@
HbInstance* HbInstance::primaryWindow() const
{
+ MPX_DEBUG(_L("HbInstance::primaryWindow()"));
return mInstance;
}
QList<HbInstance *> HbInstance::allMainWindows() const
{
+ MPX_DEBUG(_L("HbInstance::allMainWindows()"));
return mInstances;
}
void HbInstance::removeView( QGraphicsWidget* )
{
+ MPX_DEBUG(_L("HbInstance::removeView()"));
}
void HbInstance::addView( QGraphicsWidget* )
{
+ MPX_DEBUG(_L("HbInstance::addView()"));
}
void HbInstance::setCurrentView( HbView*, bool animation )
{
+ MPX_DEBUG(_L("HbInstance::setCurrentView()"));
}
\ No newline at end of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/mpxvideoplaybackwrapper.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/mpxvideoplaybackwrapper.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,36 +15,43 @@
*
*/
-// Version : %version: da1mmcf#4 %
+// Version : %version: da1mmcf#6 %
#include "mpxvideoplaybackwrapper.h"
+#include "mpxvideo_debug.h"
int mCount = 0;
QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::QMpxVideoPlaybackWrapper()"));
QMpxVideoPlaybackWrapper::Increment();
}
QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::~QMpxVideoPlaybackWrapper()"));
QMpxVideoPlaybackWrapper::Decrement();
}
void QMpxVideoPlaybackWrapper::openPlaybackView()
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::openPlaybackView()"));
emit handlePlaybackView( MpxHbVideoCommon::ActivatePlaybackView );
}
void QMpxVideoPlaybackWrapper::Increment()
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::Increment()"));
++mCount;
}
void QMpxVideoPlaybackWrapper::Decrement()
{
- if(mCount > 0)
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::Decrement()"));
+
+ if ( mCount > 0 )
{
--mCount;
}
@@ -52,16 +59,29 @@
int QMpxVideoPlaybackWrapper::GetInstanceCount()
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::GetInstanceCount()"));
return mCount;
}
int QMpxVideoPlaybackWrapper::playMedia( QString aFileName )
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia( aFileName )"));
+
+ Q_UNUSED( aFileName );
+ return 0;
+}
+
+int QMpxVideoPlaybackWrapper::playMedia( RFile aFile )
+{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::playMedia( aFile )"));
+
+ Q_UNUSED( aFile );
return 0;
}
void QMpxVideoPlaybackWrapper::lateInit()
{
+ MPX_DEBUG(_L("QMpxVideoPlaybackWrapper::lateInit()"));
}
// End of File
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/testviewplugin.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/testviewplugin.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,16 +15,20 @@
*
*/
+// Version : %version: %
+
// INCLUDE FILES
#include "testviewplugin.h"
+#include "mpxvideo_debug.h"
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
TestViewPlugin::TestViewPlugin()
- : mActive(false)
+ : mActive(false)
{
+ MPX_DEBUG(_L("TestViewPlugin::TestViewPlugin()"));
}
// ---------------------------------------------------------------------------
@@ -33,6 +37,7 @@
//
TestViewPlugin::~TestViewPlugin()
{
+ MPX_DEBUG(_L("TestViewPlugin::~TestViewPlugin()"));
}
// ---------------------------------------------------------------------------
@@ -41,6 +46,7 @@
//
void TestViewPlugin::createView()
{
+ MPX_DEBUG(_L("TestViewPlugin::createView()"));
}
// ---------------------------------------------------------------------------
@@ -49,6 +55,7 @@
//
void TestViewPlugin::destroyView()
{
+ MPX_DEBUG(_L("TestViewPlugin::destroyView()"));
}
// ---------------------------------------------------------------------------
@@ -57,6 +64,7 @@
//
void TestViewPlugin::activateView()
{
+ MPX_DEBUG(_L("TestViewPlugin::activateView()"));
mActive = true;
}
@@ -66,6 +74,7 @@
//
bool TestViewPlugin::activated()
{
+ MPX_DEBUG(_L("TestViewPlugin::activateView() ret %d"), mActive);
return mActive;
}
@@ -75,6 +84,7 @@
//
void TestViewPlugin::deactivateView()
{
+ MPX_DEBUG(_L("TestViewPlugin::deactivateView()"));
mActive = false;
}
@@ -84,6 +94,7 @@
//
QGraphicsWidget* TestViewPlugin::getView()
{
+ MPX_DEBUG(_L("TestViewPlugin::getView()"));
return 0;
}
@@ -93,6 +104,7 @@
//
MpxViewPlugin* TestViewPlugin::viewPlugin()
{
+ MPX_DEBUG(_L("TestViewPlugin::viewPlugin()"));
return this;
}
@@ -102,6 +114,8 @@
//
void TestViewPlugin::orientationChange( Qt::Orientation orientation )
{
+ MPX_DEBUG(_L("TestViewPlugin::orientationChange()"));
+ Q_UNUSED( orientation );
}
// ---------------------------------------------------------------------------
@@ -110,6 +124,7 @@
//
void TestViewPlugin::back()
{
+ MPX_DEBUG(_L("TestViewPlugin::back()"));
}
// end of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceplay.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceplay.cpp Mon May 03 12:32:50 2010 +0300
@@ -11,28 +11,36 @@
*
* Contributors:
*
-* Description: Implementation of QVideoPlayerEngine
+* Description: Implementation of VideoServicePlay
*
*/
-// Version : %version: 1 %
+// Version : %version: da1mmcf#2 %
-#include <videoservices.h>
+#include "videoservices.h"
#include "videoserviceplay.h"
#include "videoplayerengine.h"
+#include "mpxvideo_debug.h"
VideoServicePlay::VideoServicePlay( VideoServices* parent, QVideoPlayerEngine* engine )
{
+ MPX_DEBUG(_L("VideoServicePlay::VideoServicePlay()"));
+
+ Q_UNUSED( engine );
mServiceApp = parent;
}
VideoServicePlay::~VideoServicePlay()
{
+ MPX_DEBUG(_L("VideoServicePlay::~VideoServicePlay()"));
}
void VideoServicePlay::playMedia( QString filePath )
{
- mServiceApp->setCurrentService(VideoServices::EPlayback);
+ MPX_DEBUG(_L("VideoServicePlay::playMedia()"));
+
+ Q_UNUSED( filePath );
+ mServiceApp->setCurrentService( VideoServices::EPlayback );
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoservices.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoservices.cpp Mon May 03 12:32:50 2010 +0300
@@ -11,14 +11,18 @@
*
* Contributors:
*
-* Description: ?Description
+* Description: Implementation of VideoServices Stub
*
*/
-#include <videoplayerengine.h>
-#include <videoservices.h>
-#include <videoserviceurifetch.h>
-#include <videoserviceplay.h>
+// Version : %version: %
+
+#include "videoplayerengine.h"
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "videoserviceplay.h"
+#include "videoserviceview.h"
+#include "mpxvideo_debug.h"
VideoServices *VideoServices::mInstance = 0;
@@ -30,9 +34,11 @@
//
VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
{
- if(!mInstance)
+ MPX_ENTER_EXIT(_L("VideoServices::instance()"));
+
+ if ( ! mInstance )
{
- mInstance = new VideoServices(engine);
+ mInstance = new VideoServices( engine );
}
mInstance->mReferenceCount++;
return mInstance;
@@ -44,9 +50,11 @@
//
void VideoServices::decreaseReferenceCount()
{
- if(mInstance)
+ MPX_ENTER_EXIT(_L("VideoServices::decreaseReferenceCount()"));
+
+ if ( mInstance )
{
- if(--mInstance->mReferenceCount == 0)
+ if( --mInstance->mReferenceCount == 0 )
{
delete mInstance;
mInstance = NULL;
@@ -59,11 +67,14 @@
// VideoServices()
// ----------------------------------------------------------------------------
//
-VideoServices::VideoServices(QVideoPlayerEngine* engine) :
-mCurrentService(VideoServices::ENoService)
+VideoServices::VideoServices(QVideoPlayerEngine* engine)
+ : mCurrentService(VideoServices::ENoService)
{
+ MPX_ENTER_EXIT(_L("VideoServices::VideoServices()"));
+
mServiceUriFetch = new VideoServiceUriFetch(this);
- mServicePlay = new VideoServicePlay(this, engine);
+ mServicePlay = new VideoServicePlay(this, engine);
+ mServiceView = new VideoServiceView(this, engine);
}
// ----------------------------------------------------------------------------
@@ -72,8 +83,11 @@
//
VideoServices::~VideoServices()
{
+ MPX_ENTER_EXIT(_L("VideoServices::~VideoServices()"));
+
delete mServiceUriFetch;
delete mServicePlay;
+ delete mServiceView;
}
@@ -83,6 +97,7 @@
//
VideoServices::TVideoService VideoServices::currentService()
{
+ MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService);
return mCurrentService;
}
@@ -91,8 +106,9 @@
// setCurrentService()
// ----------------------------------------------------------------------------
//
-void VideoServices::setCurrentService(VideoServices::TVideoService service)
+void VideoServices::setCurrentService( VideoServices::TVideoService service )
{
+ MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service);
mCurrentService = service;
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceurifetch.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceurifetch.cpp Mon May 03 12:32:50 2010 +0300
@@ -11,20 +11,24 @@
*
* Contributors:
*
-* Description: ?Description
+* Description: Implementation of VideoServiceUriFetch Stub
*
*/
-#include <videoservices.h>
-#include <videoserviceurifetch.h>
+// Version : %version: %
+
+#include "videoservices.h"
+#include "videoserviceurifetch.h"
+#include "mpxvideo_debug.h"
// ----------------------------------------------------------------------------
// VideoServiceUriFetch()
// ----------------------------------------------------------------------------
//
-VideoServiceUriFetch::VideoServiceUriFetch(VideoServices* parent)
+VideoServiceUriFetch::VideoServiceUriFetch( VideoServices* parent )
{
+ MPX_DEBUG(_L("VideoServiceUriFetch::VideoServiceUriFetch()"));
mServiceApp = parent;
}
@@ -34,14 +38,17 @@
//
VideoServiceUriFetch::~VideoServiceUriFetch()
{
-
+ MPX_DEBUG(_L("VideoServiceUriFetch::~VideoServiceUriFetch()"));
}
// ----------------------------------------------------------------------------
// fetch()
// ----------------------------------------------------------------------------
//
-void VideoServiceUriFetch::fetch(const QString& title)
+void VideoServiceUriFetch::fetch( const QString& title )
{
- mServiceApp->setCurrentService(VideoServices::EUriFetcher);
+ MPX_DEBUG(_L("VideoServiceUriFetch::fetch()"));
+
+ Q_UNUSED( title );
+ mServiceApp->setCurrentService( VideoServices::EUriFetcher );
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoserviceview.cpp Mon May 03 12:32:50 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: stub impl for VideoServiceView
+*
+*/
+
+// Version : %version: 2 %
+
+
+#include "videoservices.h"
+#include "videoserviceview.h"
+#include "videoplayerengine.h"
+#include "mpxvideo_debug.h"
+
+
+VideoServiceView::VideoServiceView( VideoServices* parent, QVideoPlayerEngine* engine )
+{
+ MPX_DEBUG(_L("VideoServiceView::VideoServiceView()"));
+
+ Q_UNUSED( engine );
+ mServiceApp = parent;
+}
+
+VideoServiceView::~VideoServiceView()
+{
+ MPX_DEBUG(_L("VideoServiceView::~VideoServiceView()"));
+}
+
+void VideoServiceView::view( QString filePath )
+{
+ MPX_DEBUG(_L("VideoServiceView::view()"));
+
+ Q_UNUSED( filePath );
+ mServiceApp->setCurrentService( VideoServices::EView );
+}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqpluginloader.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqpluginloader.cpp Mon May 03 12:32:50 2010 +0300
@@ -18,34 +18,41 @@
#include "stub/inc/xqpluginloader.h"
#include "stub/inc/xqplugininfo.h"
#include "testviewplugin.h"
+#include "mpxvideo_debug.h"
QHash<int, MpxViewPlugin*> XQPluginLoader::mPluginList;
int XQPluginLoader::mFailToLoadPluginUid = -1;
-XQPluginLoader::XQPluginLoader(int uid, QObject* parent)
+XQPluginLoader::XQPluginLoader( int uid, QObject* parent )
{
+ MPX_DEBUG(_L("XQPluginLoader::XQPluginLoader()"));
+
+ Q_UNUSED( parent );
mUid = uid;
}
XQPluginLoader::~XQPluginLoader()
{
-
+ MPX_DEBUG(_L("XQPluginLoader::~XQPluginLoader()"));
}
-bool XQPluginLoader::listImplementations(const QString &interfaceName,
- QList<XQPluginInfo > &impls)
+bool XQPluginLoader::listImplementations( const QString &interfaceName,
+ QList<XQPluginInfo > &impls )
{
+ MPX_DEBUG(_L("XQPluginLoader::listImplementations()"));
return true;
}
QObject* XQPluginLoader::instance()
{
- if(mUid == mFailToLoadPluginUid)
+ MPX_ENTER_EXIT(_L("XQPluginLoader::instance()"));
+
+ if ( mUid == mFailToLoadPluginUid )
{
return 0;
}
- if(!mPluginList.contains(mUid))
+ if ( ! mPluginList.contains( mUid ) )
{
mPluginList[mUid] = new TestViewPlugin();
}
@@ -55,6 +62,8 @@
void XQPluginLoader::cleanup()
{
+ MPX_ENTER_EXIT(_L("XQPluginLoader::cleanup()"));
+
QHash<int, MpxViewPlugin*>::const_iterator i = mPluginList.constBegin();
while(i != mPluginList.constEnd())
{
@@ -69,7 +78,8 @@
/**
* Sets plugin load to fail.
*/
-void XQPluginLoader::setPluginLoadFailure(int uid)
+void XQPluginLoader::setPluginLoadFailure( int uid )
{
+ MPX_DEBUG(_L("XQPluginLoader::setPluginLoadFailure()"));
mFailToLoadPluginUid = uid;
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/testvideoplayerengine.pro Mon May 03 12:32:50 2010 +0300
@@ -14,54 +14,46 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#9 %
+# Version : %version: da1mmcf#11 %
TEMPLATE = app
TARGET = testvideoplayerengine
DEFINES += BUILD_VIDEOPLAYERAPP_DLL
-DEPENDPATH += . \
- inc \
- src
+DEPENDPATH += inc src stub/src stub/inc
-INCLUDEPATH += . \
- stub/inc \
- /epoc32/include \
- /epoc32/include/stdapis \
- /epoc32/include/stdapis/sys \
- ../../inc \
+INCLUDEPATH +=stub/inc \
+ $$MW_LAYER_SYSTEMINCLUDE \
../../../../inc
CONFIG += qtestlib hb qt
-LIBS += -lestor.dll \
- -lfbscli.dll \
- -lbitgdi.dll \
- -lgdi.dll \
- -lxqserviceutil.dll
+LIBS += -lxqserviceutil.dll
# Input
-HEADERS += stub/inc/mpxvideoplaybackwrapper.h \
- stub/inc/mpxviewpluginqt.h \
- stub/inc/testviewplugin.h \
- stub/inc/xqpluginloader.h \
- stub/inc/xqplugininfo.h \
- stub/inc/hbinstance.h \
- inc/testvideoplayerengine.h \
- stub/inc/videoservices.h \
- stub/inc/videoserviceurifetch.h \
- stub/inc/videoserviceplay.h \
- stub/inc/hbview.h \
+HEADERS += mpxvideoplaybackwrapper.h \
+ mpxviewpluginqt.h \
+ testviewplugin.h \
+ xqpluginloader.h \
+ xqplugininfo.h \
+ hbinstance.h \
+ testvideoplayerengine.h \
+ videoservices.h \
+ videoserviceurifetch.h \
+ videoserviceplay.h \
+ videoserviceview.h \
+ hbview.h \
../../../../inc/videoplayerengine.h
-SOURCES += stub/src/mpxvideoplaybackwrapper.cpp \
- stub/src/testviewplugin.cpp \
- stub/src/xqpluginloader.cpp \
- stub/src/hbinstance.cpp \
- src/testvideoplayerengine.cpp \
- stub/src/videoservices.cpp \
- stub/src/videoserviceurifetch.cpp \
- stub/src/videoserviceplay.cpp \
+SOURCES += mpxvideoplaybackwrapper.cpp \
+ testviewplugin.cpp \
+ xqpluginloader.cpp \
+ hbinstance.cpp \
+ testvideoplayerengine.cpp \
+ videoservices.cpp \
+ videoserviceurifetch.cpp \
+ videoserviceplay.cpp \
+ videoserviceview.cpp \
../../src/videoplayerengine.cpp
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/src/testvideoservices.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,6 +15,8 @@
*
*/
+// Version : %version: %
+
// INCLUDES
#include <QtTest/QtTest>
#include <qdebug.h>
@@ -23,6 +25,7 @@
#include "mpxhbvideocommondefs.h"
#include "videoplayerengine.h"
#include "testvideoservices.h"
+#include "mpxvideo_debug.h"
#define private public
#include "videoservices.h"
@@ -50,13 +53,16 @@
TestVideoServices::TestVideoServices()
- : mTestObject(0),
- mEngine(0)
+ : mTestObject( 0 )
+ , mEngine( 0 )
{
+ MPX_DEBUG(_L("TestVideoServices::TestVideoServices()"));
}
TestVideoServices::~TestVideoServices()
{
+ MPX_ENTER_EXIT(_L("TestVideoServices::~TestVideoServices()"));
+
delete mTestObject;
mTestObject = 0;
}
@@ -64,10 +70,13 @@
void TestVideoServices::init()
{
+ MPX_DEBUG(_L("TestVideoServices::init()"));
}
void TestVideoServices::cleanup()
{
+ MPX_ENTER_EXIT(_L("TestVideoServices::cleanup()"));
+
delete mEngine;
mEngine = 0;
@@ -81,23 +90,29 @@
void TestVideoServices::testCreateDelete()
{
+ MPX_DEBUG(_L("TestVideoServices::testCreateDelete()"));
+
mTestObject = VideoServices::instance();
QVERIFY(mTestObject);
QVERIFY(mTestObject->mServicePlay);
QVERIFY(mTestObject->mServiceUriFetch);
+ QVERIFY(mTestObject->mServiceView);
QVERIFY(mTestObject->mEngine == 0);
QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
}
void TestVideoServices::testCreateDeleteEngine()
{
+ MPX_DEBUG(_L("TestVideoServices::testCreateDeleteEngine()"));
+
mEngine = new QVideoPlayerEngine();
mTestObject = VideoServices::instance(mEngine);
QVERIFY(mTestObject);
QVERIFY(mTestObject->mServicePlay);
QVERIFY(mTestObject->mServiceUriFetch);
+ QVERIFY(mTestObject->mServiceView);
QVERIFY(mTestObject->mEngine == mEngine);
QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
}
@@ -105,11 +120,14 @@
void TestVideoServices::testCurrentService()
{
+ MPX_DEBUG(_L("TestVideoServices::testCurrentService()"));
+
mTestObject = VideoServices::instance();
QVERIFY(mTestObject);
QVERIFY(mTestObject->mServicePlay);
QVERIFY(mTestObject->mServiceUriFetch);
+ QVERIFY(mTestObject->mServiceView);
QVERIFY(mTestObject->mEngine == 0);
QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
@@ -130,6 +148,7 @@
QVERIFY(mTestObject);
QVERIFY(mTestObject->mServicePlay);
QVERIFY(mTestObject->mServiceUriFetch);
+ QVERIFY(mTestObject->mServiceView);
QVERIFY(mTestObject->mEngine == mEngine);
QVERIFY(mTestObject->mCurrentService == VideoServices::ENoService);
@@ -142,6 +161,7 @@
void TestVideoServices::cleanupTestCase()
{
+ MPX_DEBUG(_L("TestVideoServices::cleanupTestCase()"));
// all common cleanup here
}
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/inc/videoplayerengine.h Mon May 03 12:32:50 2010 +0300
@@ -15,12 +15,13 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: da1mmcf#2 %
#ifndef VIDEOPLAYERENGINE_H
#define VIDEOPLAYERENGINE_H
#include <qobject.h>
+#include <f32file.h>
//FORWARD CLASS DECLARATION
@@ -46,6 +47,7 @@
public:
void initialize();
void playMedia( QString filePath );
+ void playMedia( RFile file );
void setEmbedded();
public slots:
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/stub/src/videoplayerengine.cpp Mon May 03 12:32:50 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: da1mmcf#3 %
#include <qapplication>
@@ -27,6 +27,7 @@
#include "videoplayerengine.h"
#include "mpxvideoplaybackwrapper.h"
+#include "mpxvideo_debug.h"
// -------------------------------------------------------------------------------------------------
// QVideoPlayerEngine()
@@ -34,8 +35,9 @@
//
QVideoPlayerEngine::QVideoPlayerEngine(bool isService)
: mIsService( isService )
- , mEmbedded(false)
+ , mEmbedded( false )
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::QVideoPlayerEngine()"));
}
// -------------------------------------------------------------------------------------------------
@@ -44,6 +46,7 @@
//
QVideoPlayerEngine::~QVideoPlayerEngine()
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::~QVideoPlayerEngine()"));
}
// -------------------------------------------------------------------------------------------------
@@ -52,6 +55,7 @@
//
void QVideoPlayerEngine::initialize()
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::initialize()"));
}
// -------------------------------------------------------------------------------------------------
@@ -60,6 +64,8 @@
//
void QVideoPlayerEngine::handleCommand( int commandCode )
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::initialize()"));
+ Q_UNUSED( commandCode );
}
@@ -69,6 +75,7 @@
//
void QVideoPlayerEngine::handleQuit()
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::handleQuit()"));
delete this;
}
@@ -79,6 +86,8 @@
//
void QVideoPlayerEngine::playMedia( QString filePath )
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::playMedia()"));
+ Q_UNUSED( filePath );
}
// -------------------------------------------------------------------------------------------------
@@ -87,7 +96,18 @@
//
void QVideoPlayerEngine::setEmbedded()
{
+ MPX_DEBUG(_L("QVideoPlayerEngine::setEmbedded()"));
mEmbedded = true;
}
+// -------------------------------------------------------------------------------------------------
+// playMedia()
+// -------------------------------------------------------------------------------------------------
+//
+void QVideoPlayerEngine::playMedia( RFile file )
+{
+ MPX_DEBUG(_L("QVideoPlayerEngine::playMedia( file )"));
+ Q_UNUSED( file );
+}
+
// End of file
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoservices/testvideoservices.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoservices/testvideoservices.pro Mon May 03 12:32:50 2010 +0300
@@ -27,32 +27,29 @@
stub/inc \
../../../inc \
../../../../inc \
- /epoc32/include \
- /epoc32/include/stdapis \
- /epoc32/include/stdapis/sys \
-
+ $$MW_LAYER_SYSTEMINCLUDE
CONFIG += qtestlib hb qt
-LIBS += -lestor.dll \
- -lfbscli.dll \
- -lbitgdi.dll \
- -lgdi.dll \
- -lxqservice.dll
+LIBS += -lxqservice.dll \
+ -lxqserviceutil.dll
# Input
HEADERS += stub/inc/videoplayerengine.h \
inc/testvideoservices.h \
- ../../inc/videoservices.h \
+ ../../../../inc/videoservices.h \
../../inc/videoserviceurifetch.h \
../../inc/videoserviceplay.h \
- ../../../inc/videoplayerappexport.h
+ ../../inc/videoserviceview.h \
+ ../../inc/videoservicebrowse.h
SOURCES += stub/src/videoplayerengine.cpp \
#stub/src/xqserviceprovider.cpp \
src/testvideoservices.cpp \
../../src/videoservices.cpp \
../../src/videoserviceurifetch.cpp \
- ../../src/videoserviceplay.cpp
+ ../../src/videoserviceplay.cpp \
+ ../../src/videoserviceview.cpp \
+ ../../src/videoservicebrowse.cpp
--- a/videoplayerapp/videoplayerengine/videoplayerengine.pro Fri Apr 16 14:59:52 2010 +0300
+++ b/videoplayerapp/videoplayerengine/videoplayerengine.pro Mon May 03 12:32:50 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building Videoplayer components
#
#
-# Version : %version: da1mmcf#20 %
+# Version : %version: da1mmcf#24 %
TEMPLATE = lib
@@ -38,35 +38,36 @@
LIBS += -lmpxviewframeworkqt.dll \
-lxqplugins.dll \
- -lmpxplaybackutility.dll \
+ -lmpxplaybackutility.dll \
-lmpxcollectionutility.dll \
-lmpxcollectionhelper.dll \
-lmpxcommon.dll \
- -lestor.dll \
- -lfbscli.dll \
-lplaybackhelper.dll \
-lvideoplaylistutility.dll \
-lservicehandler.dll \
-lxqservice.dll \
-lxqserviceutil.dll \
- -lflogger.dll
+ -lflogger.dll \
+ -lefsrv.dll
-DEPENDPATH += ../inc inc
+DEPENDPATH += ../../inc ../inc inc
VPATH += src
HEADERS += videoplayerengine.h \
mpxvideoplaybackwrapper.h \
mpxvideoplayerappuiengine.h \
- mpxvideoembeddedpdlhandler.h \
videoservices.h \
videoserviceplay.h \
- videoserviceurifetch.h
+ videoserviceurifetch.h \
+ videoserviceview.h \
+ videoservicebrowse.h
SOURCES += videoplayerengine.cpp \
mpxvideoplaybackwrapper.cpp \
mpxvideoplayerappuiengine.cpp \
- mpxvideoembeddedpdlhandler.cpp \
videoservices.cpp \
videoserviceplay.cpp \
- videoserviceurifetch.cpp
+ videoserviceurifetch.cpp \
+ videoserviceview.cpp \
+ videoservicebrowse.cpp