videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoactivitystate.h
changeset 46 adbe7d5ba2f5
child 44 518105d52e45
equal deleted inserted replaced
28:c48470be1ba7 46:adbe7d5ba2f5
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   VideoActivityState stub class definition
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  1 %
       
    19 
       
    20 #ifndef __VIDEOACTIVITYSTATE_H__
       
    21 #define __VIDEOACTIVITYSTATE_H__
       
    22 
       
    23 #include <qhash.h>
       
    24 #include <qvariant.h>
       
    25 #include "videoplayerappexport.h"
       
    26 
       
    27 // videoplayer activity id
       
    28 static const QString ACTIVITY_VIDEOPLAYER_MAINVIEW = "VideosMainView";
       
    29 
       
    30 
       
    31 namespace VideoActivityData
       
    32 {        
       
    33     // consts to be used as key values    
       
    34     // plugin type (int): collectionplugin or videoplaybackplugin 
       
    35     static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_";
       
    36           
       
    37 }
       
    38 
       
    39 /**
       
    40  * Class is used as a stub for testing activity saving from videoplayerengine
       
    41  *
       
    42  */
       
    43 class VIDEOPLAYERAPP_DLL_EXPORT VideoActivityState 
       
    44 {
       
    45     
       
    46 public:
       
    47  
       
    48     /**
       
    49      * method returns a static instance of this class
       
    50      */
       
    51     static VideoActivityState &instance();
       
    52     
       
    53     /**
       
    54      * Method clears all activity data.
       
    55      */
       
    56     void clearActivityData();
       
    57     
       
    58     /**
       
    59      * Sets activity data. If dataKey is not defined, all activity data
       
    60      * will be overwritten by a provided data.
       
    61      * 
       
    62      * @param data Data to save
       
    63      * @param dataKey Key indicating dataitem. If empty, all data will be overwritten by provided data 
       
    64      */
       
    65     void setActivityData(const QVariant& data, const QString& dataKey = QString(""));
       
    66 
       
    67     /**
       
    68      * Get activity data. If dataKey is not defined, all activity data
       
    69      * will be returned. If item corresponding provided dataKey is not found,
       
    70      * method returns empty QVariant.
       
    71      * 
       
    72      * @param dataKey Key indicating dataitem client wants. If empty, all data will be returned
       
    73      * 
       
    74      * @return QVariant 
       
    75      */
       
    76     const QVariant getActivityData(const QString& dataKey = QString(""));
       
    77     
       
    78     static int mAllDataGetCount;
       
    79 
       
    80 private:
       
    81     
       
    82     /**
       
    83      * private default contructor
       
    84      */
       
    85     VideoActivityState();  
       
    86     
       
    87     /**
       
    88      * copy contructor definition
       
    89      */
       
    90     VideoActivityState(const VideoActivityState& other);  
       
    91     
       
    92     /**
       
    93      * Private destructor.
       
    94      *
       
    95      */
       
    96     virtual ~VideoActivityState();    
       
    97 
       
    98 private:
       
    99     
       
   100     /**
       
   101      * locally saved activity data
       
   102      */
       
   103     QHash<QString, QVariant> mActivityData;
       
   104         
       
   105 };
       
   106 
       
   107 #endif //__VIDEOACTIVITYSTATE_H__