|
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 class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: da1mmcf#4 % |
|
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 // last position of the last played media clip (int) |
|
31 static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_"; |
|
32 |
|
33 // TMPXId of the last played media file |
|
34 static const QString KEY_LAST_PLAYED_MEDIA_ID = "_VideoActivity_last_played_media_id_"; |
|
35 |
|
36 // name of the media clip last played (QString) |
|
37 static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_"; |
|
38 |
|
39 // Key for plugin type in activity manager |
|
40 static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_"; |
|
41 |
|
42 // was the last played media clip a local clip (not streaming or prog. download) |
|
43 static const QString KEY_LAST_LOCAL_PLAYBACK = "_VideoActivity_last_local_playback_"; |
|
44 |
|
45 |
|
46 /** |
|
47 * Class is used as a static activity data container for videoplayer application |
|
48 * for other videoplayer components to use. |
|
49 * |
|
50 * Data is excepted to be saved as QHash<QString, QVariant>. Keys defined above |
|
51 * should be used to access data |
|
52 * |
|
53 */ |
|
54 class VIDEOPLAYERAPP_DLL_EXPORT VideoActivityState |
|
55 { |
|
56 |
|
57 public: |
|
58 |
|
59 /** |
|
60 * method returns a static instance of this class |
|
61 */ |
|
62 static VideoActivityState &instance(); |
|
63 |
|
64 /** |
|
65 * Sets activity data. If dataKey is not defined, all activity data |
|
66 * will be overwritten by a provided data. |
|
67 * |
|
68 * @param data Data to save |
|
69 * @param dataKey Key indicating dataitem. If empty, all data will be overwritten by provided data |
|
70 */ |
|
71 void setActivityData(const QVariant& data, const QString& dataKey = QString("")); |
|
72 |
|
73 /** |
|
74 * Get activity data. If dataKey is not defined, all activity data |
|
75 * will be returned. If item corresponding provided dataKey is not found, |
|
76 * method returns empty QVariant. |
|
77 * |
|
78 * @param dataKey Key indicating dataitem client wants. If empty, all data will be returned |
|
79 * |
|
80 * @return QVariant |
|
81 */ |
|
82 const QVariant getActivityData(const QString& dataKey = QString("")); |
|
83 |
|
84 private: |
|
85 |
|
86 /** |
|
87 * private default contructor |
|
88 */ |
|
89 VideoActivityState(); |
|
90 |
|
91 /** |
|
92 * copy contructor definition |
|
93 */ |
|
94 VideoActivityState(const VideoActivityState& other); |
|
95 |
|
96 /** |
|
97 * Private destructor. |
|
98 * |
|
99 */ |
|
100 virtual ~VideoActivityState(); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * locally saved activity data |
|
106 */ |
|
107 QHash<QString, QVariant> mActivityData; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif //__VIDEOACTIVITYSTATE_H__ |