34
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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 the License "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: Queues commands to MDS.
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef VCXMYVIDEOSMDSCMDQUEUE_H
|
|
20 |
#define VCXMYVIDEOSMDSCMDQUEUE_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <vcxmyvideosdefs.h>
|
|
24 |
#include "vcxmyvideosalbum.h"
|
|
25 |
#include "vcxmyvideosmdsdb.h"
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
class CMPXMedia;
|
|
29 |
|
|
30 |
// CONSTANTS
|
|
31 |
|
|
32 |
// CLASS DECLARATION
|
|
33 |
|
|
34 |
/**
|
|
35 |
* All MDS commands inherit this.
|
|
36 |
*
|
|
37 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
38 |
*/
|
|
39 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmd) : public CBase
|
|
40 |
{
|
|
41 |
public:
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Destructor
|
|
45 |
*/
|
|
46 |
virtual ~CVcxMyVideosMdsCmd() {}
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Command type. Used for casting the pointer to correct type.
|
|
50 |
*/
|
|
51 |
CVcxMyVideosMdsDb::TRequestType iCmdType;
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Pointer to client is stored here, used for performing response call.
|
|
55 |
*/
|
|
56 |
MVcxMyVideosMdsAlbumsObserver* iClient;
|
|
57 |
};
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Class which encapsulates GetVideoListL function parameters.
|
|
61 |
*
|
|
62 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
63 |
*/
|
|
64 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetVideoList) : public CVcxMyVideosMdsCmd
|
|
65 |
{
|
|
66 |
public:
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Constructor
|
|
70 |
*/
|
|
71 |
CVcxMyVideosMdsCmdGetVideoList() {}
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Destructor
|
|
75 |
*/
|
|
76 |
virtual ~CVcxMyVideosMdsCmdGetVideoList() {}
|
|
77 |
|
|
78 |
public:
|
|
79 |
/**
|
|
80 |
* Stored CreateVideoListL function parameters, see meanings from vcxmyvideosmdsdb.h file.
|
|
81 |
*/
|
|
82 |
TVcxMyVideosSortingOrder iSortingOrder;
|
|
83 |
TBool iAscending;
|
|
84 |
TBool iFullDetails;
|
|
85 |
CMPXMedia** iVideoList;
|
|
86 |
};
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Class which stores GetAlbumsL function arguments.
|
|
90 |
*
|
|
91 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
92 |
*/
|
|
93 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbums) : public CVcxMyVideosMdsCmd
|
|
94 |
{
|
|
95 |
public: // Constructors and destructor
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Constructor
|
|
99 |
*/
|
|
100 |
CVcxMyVideosMdsCmdGetAlbums() {}
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Destructor
|
|
104 |
*/
|
|
105 |
virtual ~CVcxMyVideosMdsCmdGetAlbums() {}
|
|
106 |
|
|
107 |
public:
|
|
108 |
/**
|
|
109 |
* Stored GetAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
|
|
110 |
*/
|
|
111 |
CMPXMedia* iAlbumList;
|
|
112 |
};
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Class which stores GetAlbumContentIdsL function arguments.
|
|
116 |
*
|
|
117 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
118 |
*/
|
|
119 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentIds) : public CVcxMyVideosMdsCmd
|
|
120 |
{
|
|
121 |
public: // Constructors and destructor
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Constructor
|
|
125 |
*/
|
|
126 |
CVcxMyVideosMdsCmdGetAlbumContentIds() {}
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Destructor
|
|
130 |
*/
|
|
131 |
virtual ~CVcxMyVideosMdsCmdGetAlbumContentIds() {}
|
|
132 |
|
|
133 |
public:
|
|
134 |
/**
|
|
135 |
* Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
|
|
136 |
*/
|
|
137 |
TUint32 iAlbumId;
|
|
138 |
RArray<TVcxMyVideosAlbumVideo>* iAlbumContent; //not own
|
|
139 |
};
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Class which stores GetAlbumContentVideosL function arguments.
|
|
143 |
*
|
|
144 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
145 |
*/
|
|
146 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdGetAlbumContentVideos) : public CVcxMyVideosMdsCmd
|
|
147 |
{
|
|
148 |
public: // Constructors and destructor
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Constructor
|
|
152 |
*/
|
|
153 |
CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Destructor
|
|
157 |
*/
|
|
158 |
virtual ~CVcxMyVideosMdsCmdGetAlbumContentVideos() {}
|
|
159 |
|
|
160 |
public:
|
|
161 |
/**
|
|
162 |
* Stored GetAlbumContentL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
|
|
163 |
*/
|
|
164 |
TUint32 iAlbumId;
|
|
165 |
CMPXMedia* iAlbumContentVideos; //not own
|
|
166 |
};
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Class which stores AddVideosToAlbumL function arguments.
|
|
170 |
*
|
|
171 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
172 |
*/
|
|
173 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdAddVideosToAlbum) : public CVcxMyVideosMdsCmd
|
|
174 |
{
|
|
175 |
public: // Constructors and destructor
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Constructor
|
|
179 |
*/
|
|
180 |
CVcxMyVideosMdsCmdAddVideosToAlbum() {}
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Destructor
|
|
184 |
*/
|
|
185 |
virtual ~CVcxMyVideosMdsCmdAddVideosToAlbum() {}
|
|
186 |
|
|
187 |
public:
|
|
188 |
/**
|
|
189 |
* Stored AddVideosToAlbumL function parameters, see meanings from vcxmyvideosdefs.h
|
|
190 |
* KVcxCommandMyVideosAddToAlbum command descriptions.
|
|
191 |
*/
|
|
192 |
CMPXMedia* iMpxCmd;
|
|
193 |
};
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Class which stores RemoveRelationsL function arguments.
|
|
197 |
*
|
|
198 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
199 |
*/
|
|
200 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveRelations) : public CVcxMyVideosMdsCmd
|
|
201 |
{
|
|
202 |
public: // Constructors and destructor
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Constructor
|
|
206 |
*/
|
|
207 |
CVcxMyVideosMdsCmdRemoveRelations() {}
|
|
208 |
|
|
209 |
/**
|
|
210 |
* Destructor
|
|
211 |
*/
|
|
212 |
virtual ~CVcxMyVideosMdsCmdRemoveRelations() {}
|
|
213 |
|
|
214 |
public:
|
|
215 |
/**
|
|
216 |
* Stored RemoveRelationsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
|
|
217 |
*/
|
|
218 |
RArray<TUint32>* iRelationIds; //not own
|
|
219 |
RArray<TUint32>* iResults; //not own
|
|
220 |
};
|
|
221 |
|
|
222 |
/**
|
|
223 |
* Class which stores RemoveAlbumsL function arguments.
|
|
224 |
*
|
|
225 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
226 |
*/
|
|
227 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdRemoveAlbums) : public CVcxMyVideosMdsCmd
|
|
228 |
{
|
|
229 |
public: // Constructors and destructor
|
|
230 |
|
|
231 |
/**
|
|
232 |
* Constructor
|
|
233 |
*/
|
|
234 |
CVcxMyVideosMdsCmdRemoveAlbums() {}
|
|
235 |
|
|
236 |
/**
|
|
237 |
* Destructor
|
|
238 |
*/
|
|
239 |
virtual ~CVcxMyVideosMdsCmdRemoveAlbums() {}
|
|
240 |
|
|
241 |
public:
|
|
242 |
/**
|
|
243 |
* Stored RemoveAlbumsL function parameters, see meanings from vcxmyvideosmdsalbums.h file.
|
|
244 |
*/
|
|
245 |
CMPXMedia* iMpxCmd; //not own
|
|
246 |
};
|
|
247 |
|
|
248 |
/**
|
|
249 |
* Queues MDS commands.
|
|
250 |
*
|
|
251 |
* @lib mpxmyvideoscollectionplugin.lib
|
|
252 |
*/
|
|
253 |
NONSHARABLE_CLASS(CVcxMyVideosMdsCmdQueue) : public CBase
|
|
254 |
{
|
|
255 |
public: // Constructors and destructor
|
|
256 |
|
|
257 |
/**
|
|
258 |
* Two-phased constructor
|
|
259 |
* @return object constructed
|
|
260 |
*/
|
|
261 |
static CVcxMyVideosMdsCmdQueue* NewL( CVcxMyVideosMdsDb& aMdsDb );
|
|
262 |
|
|
263 |
/**
|
|
264 |
* Destructor
|
|
265 |
*/
|
|
266 |
virtual ~CVcxMyVideosMdsCmdQueue();
|
|
267 |
|
|
268 |
public: // new methods
|
|
269 |
|
|
270 |
/**
|
|
271 |
* Executes command if queue is empty, otherwise adds it to queue.
|
|
272 |
* Ownership of aCmd moves to this object.
|
|
273 |
*
|
|
274 |
* @param aCmd Command to execute.
|
|
275 |
*/
|
|
276 |
void ExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
|
|
277 |
|
|
278 |
/**
|
|
279 |
* Called when command finishes. Executes next command from the queue.
|
|
280 |
*/
|
|
281 |
void CmdFinished();
|
|
282 |
|
|
283 |
/**
|
|
284 |
* Removes commands from command queue.
|
|
285 |
*
|
|
286 |
* @param aType Defines what kind of commands are removed from the command queue.
|
|
287 |
*/
|
|
288 |
void Cancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll );
|
|
289 |
|
|
290 |
private:
|
|
291 |
|
|
292 |
/**
|
|
293 |
* Constructor
|
|
294 |
*/
|
|
295 |
CVcxMyVideosMdsCmdQueue( CVcxMyVideosMdsDb& aMdsDb );
|
|
296 |
|
|
297 |
/**
|
|
298 |
* Symbian 2nd phase constructor.
|
|
299 |
*/
|
|
300 |
void ConstructL();
|
|
301 |
|
|
302 |
/**
|
|
303 |
* Executes the command.
|
|
304 |
*
|
|
305 |
* @param aCmd Command to execute, ownership does not move.
|
|
306 |
*/
|
|
307 |
void DoExecuteCmdL( CVcxMyVideosMdsCmd* aCmd );
|
|
308 |
|
|
309 |
private:
|
|
310 |
|
|
311 |
/**
|
|
312 |
* Owner of this object.
|
|
313 |
*/
|
|
314 |
CVcxMyVideosMdsDb& iMdsDb;
|
|
315 |
|
|
316 |
/**
|
|
317 |
* Command queue. Own.
|
|
318 |
*/
|
|
319 |
RArray<CVcxMyVideosMdsCmd*> iQueue;
|
|
320 |
|
|
321 |
/**
|
|
322 |
* Set to ETrue when command is started and to EFalse
|
|
323 |
* when command finishes.
|
|
324 |
*/
|
|
325 |
TBool iCmdInProgress;
|
|
326 |
};
|
|
327 |
|
|
328 |
#endif // VCXMYVIDEOSMDSCMDQUEUE_H
|
|
329 |
|
|
330 |
|