|
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: stub VideoActivityState class definition for collection view unite tests |
|
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 |
|
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 // name of the media clip last played (QString) |
|
34 static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_"; |
|
35 |
|
36 // Key for plugin type in activity manager |
|
37 static const QString KEY_VIEWPLUGIN_TYPE = "_VideoActivity_viewplugin_type_"; |
|
38 |
|
39 // was the last played media clip a local clip (not streaming or prog. download) |
|
40 static const QString KEY_LAST_LOCAL_PLAYBACK = "_VideoActivity_last_local_playback_"; |
|
41 |
|
42 |
|
43 |
|
44 namespace VideoActivityData |
|
45 { |
|
46 // type of collectionview plugin's widget level(int): |
|
47 // all videos, collections or collection video list |
|
48 static const QString KEY_WIDGET_LEVEL = "_VideoActivity_widget_level_"; |
|
49 |
|
50 // id of the collection whose videolist is to be shown (int). |
|
51 static const QString KEY_WIDGET_ID = "_VideoActivity_view_item_id_"; |
|
52 } |
|
53 |
|
54 |
|
55 class VideoActivityState |
|
56 { |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * method returns a static instance of this class |
|
62 */ |
|
63 static VideoActivityState &instance(); |
|
64 |
|
65 /** |
|
66 * Sets activity data. If dataKey is not defined, all activity data |
|
67 * will be overwritten by a provided data. |
|
68 * |
|
69 * @param data Data to save |
|
70 * @param dataKey Key indicating dataitem. If empty, all data will be overwritten by provided data |
|
71 */ |
|
72 void setActivityData(const QVariant& data, const QString& dataKey = QString("")); |
|
73 |
|
74 /** |
|
75 * Get activity data. If dataKey is not defined, all activity data |
|
76 * will be returned. If item corresponding provided dataKey is not found, |
|
77 * method returns empty QVariant. |
|
78 * |
|
79 * @param dataKey Key indicating dataitem client wants. If empty, all data will be returned |
|
80 * |
|
81 * @return QVariant |
|
82 */ |
|
83 const QVariant getActivityData(const QString& dataKey = QString("")); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * private default contructor |
|
89 */ |
|
90 VideoActivityState(); |
|
91 |
|
92 /** |
|
93 * copy contructor definition |
|
94 */ |
|
95 VideoActivityState(const VideoActivityState& other); |
|
96 |
|
97 /** |
|
98 * Private destructor. |
|
99 * |
|
100 */ |
|
101 virtual ~VideoActivityState(); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * locally saved activity data |
|
107 */ |
|
108 QHash<QString, QVariant> mActivityData; |
|
109 |
|
110 }; |
|
111 |
|
112 #endif //__VIDEOACTIVITYSTATE_H__ |