|
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: 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 // type of collectionview plugin's widget level(int): |
|
38 // all videos, collections or collection video list |
|
39 static const QString KEY_WIDGET_LEVEL = "_VideoActivity_widget_level_"; |
|
40 |
|
41 // id of the collection whose videolist is to be shown (int). |
|
42 static const QString KEY_WIDGET_ID = "_VideoActivity_view_item_id_"; |
|
43 |
|
44 // for playback plugin: view to activate either play or details |
|
45 static const QString KEY_PLAYB_VIEW = "_VideoActivity_playb_view_type_"; |
|
46 |
|
47 // for playback plugin: video path |
|
48 static const QString KEY_VIDEO_PATH = "_VideoActivity_video_path_"; |
|
49 |
|
50 // for playback plugin: video playback position |
|
51 static const QString KEY_VIDEO_POS = "_VideoActivity_video_pos_"; |
|
52 |
|
53 // for playback plugin: video playback state |
|
54 static const QString KEY_PLAYB_STATE = "_VideoActivity_playb_state_"; |
|
55 |
|
56 // for playback plugin: video playback volume |
|
57 static const QString KEY_PLAYB_VOLUME = "_VideoActivity_playb_volume_"; |
|
58 |
|
59 } |
|
60 |
|
61 /** |
|
62 * Class is used as a static activity data container for videoplayer application |
|
63 * for other videoplayer components to use. |
|
64 * |
|
65 * Data is excepted to be saved as QHash<QString, QVariant>. Keys defined above |
|
66 * should be used to access data |
|
67 * |
|
68 */ |
|
69 class VIDEOPLAYERAPP_DLL_EXPORT VideoActivityState |
|
70 { |
|
71 |
|
72 public: |
|
73 |
|
74 /** |
|
75 * method returns a static instance of this class |
|
76 */ |
|
77 static VideoActivityState &instance(); |
|
78 |
|
79 /** |
|
80 * Sets activity data. If dataKey is not defined, all activity data |
|
81 * will be overwritten by a provided data. |
|
82 * |
|
83 * @param data Data to save |
|
84 * @param dataKey Key indicating dataitem. If empty, all data will be overwritten by provided data |
|
85 */ |
|
86 void setActivityData(const QVariant& data, const QString& dataKey = QString("")); |
|
87 |
|
88 /** |
|
89 * Get activity data. If dataKey is not defined, all activity data |
|
90 * will be returned. If item corresponding provided dataKey is not found, |
|
91 * method returns empty QVariant. |
|
92 * |
|
93 * @param dataKey Key indicating dataitem client wants. If empty, all data will be returned |
|
94 * |
|
95 * @return QVariant |
|
96 */ |
|
97 const QVariant getActivityData(const QString& dataKey = QString("")); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * private default contructor |
|
103 */ |
|
104 VideoActivityState(); |
|
105 |
|
106 /** |
|
107 * copy contructor definition |
|
108 */ |
|
109 VideoActivityState(const VideoActivityState& other); |
|
110 |
|
111 /** |
|
112 * Private destructor. |
|
113 * |
|
114 */ |
|
115 virtual ~VideoActivityState(); |
|
116 |
|
117 private: |
|
118 |
|
119 /** |
|
120 * locally saved activity data |
|
121 */ |
|
122 QHash<QString, QVariant> mActivityData; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif //__VIDEOACTIVITYSTATE_H__ |