30
|
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: VideoCollectionClient class definition*
|
|
15 |
*/
|
|
16 |
|
|
17 |
#ifndef __VIDEOCOLLECTIONCLIENT_H
|
|
18 |
#define __VIDEOCOLLECTIONCLIENT_H
|
|
19 |
|
|
20 |
#include <vcxmyvideosdefs.h>
|
|
21 |
#include <QList>
|
34
|
22 |
#include "videocollectioncommon.h"
|
36
|
23 |
|
30
|
24 |
// FORWARD DECLARATIONS
|
|
25 |
|
|
26 |
class MMPXCollectionUtility;
|
|
27 |
class VideoDataSignalReceiver;
|
|
28 |
class VideoCollectionListener;
|
|
29 |
|
|
30 |
// CLASS DECLARATION
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Client class for My Videos MPX Collection.
|
|
34 |
*
|
|
35 |
* @lib videocollectionwrapper.dll
|
|
36 |
*/
|
|
37 |
class VideoCollectionClient
|
|
38 |
{
|
36
|
39 |
|
30
|
40 |
public:
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Constructor
|
|
44 |
*/
|
|
45 |
VideoCollectionClient();
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Destructor.
|
|
49 |
*/
|
|
50 |
virtual ~VideoCollectionClient();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Initializes object and allocates members
|
|
54 |
*
|
34
|
55 |
* @param signal receiver
|
|
56 |
*
|
30
|
57 |
* @return 0 if ok, < 0 in case of error
|
|
58 |
*/
|
34
|
59 |
int initialize(VideoDataSignalReceiver *signalReceiver);
|
30
|
60 |
|
|
61 |
public:
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Collection opening status
|
|
65 |
*/
|
|
66 |
enum TCollectionOpenStatus
|
|
67 |
{
|
|
68 |
ECollectionNotOpen = 0,
|
|
69 |
ECollectionOpening,
|
|
70 |
ECollectionOpened
|
|
71 |
};
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Connects videodata signals to provided object
|
|
75 |
* If method fails, client should deallocate it's
|
|
76 |
* VideoDataSignalReceiver object to make sure thee are
|
|
77 |
* no unused signal connections.
|
|
78 |
*
|
|
79 |
* @param aVideoModelObserver Observer.
|
|
80 |
*
|
|
81 |
* @return int -1 in case of failure
|
|
82 |
*/
|
|
83 |
int connectCollectionSignalReceiver(
|
|
84 |
VideoDataSignalReceiver *signalReceiver);
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Returns the current level of collection.
|
|
88 |
*
|
|
89 |
* @return some type of TCollectionLevels or -1 in case of error
|
|
90 |
*/
|
|
91 |
int getCollectionLevel();
|
|
92 |
|
|
93 |
/**
|
34
|
94 |
* Returns the current category requested to open
|
30
|
95 |
*
|
|
96 |
*/
|
34
|
97 |
void getCategoryId(TMPXItemId &id);
|
30
|
98 |
|
|
99 |
/**
|
|
100 |
* Returns reference to collection open status. Client can use
|
|
101 |
* this to get and change the status
|
|
102 |
*
|
|
103 |
* @return some type of TCollectionLevels or -1 in case of error
|
|
104 |
*/
|
|
105 |
int getOpenStatus();
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Sets open status, if given status is ECollectionOpened calls
|
|
109 |
* startOpenCurrentState to start collection into current state.
|
|
110 |
*
|
|
111 |
*/
|
36
|
112 |
void setOpenStatus(int status, bool startOpening = true);
|
30
|
113 |
|
|
114 |
/**
|
|
115 |
* Starts opening of collection to the all videos category
|
|
116 |
*
|
|
117 |
* @return 0 startup ok
|
|
118 |
*/
|
|
119 |
int startOpenCollection(int level);
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Calls open to collection to get current
|
|
123 |
* state to be opened.
|
|
124 |
*
|
|
125 |
* @return 0 startup ok
|
|
126 |
*/
|
|
127 |
int startOpenCurrentState();
|
|
128 |
|
|
129 |
/**
|
|
130 |
* calls collection to deleteFile(s) mpx media object defined by the given ids
|
|
131 |
*
|
|
132 |
* @param mediaIds pointerr to the list of items to be removed
|
|
133 |
* @return 0 if ok
|
|
134 |
*/
|
|
135 |
int deleteVideos(QList<TMPXItemId> *mediaIds);
|
|
136 |
|
|
137 |
/**
|
34
|
138 |
* Calls collection to open item defined by the given id.
|
30
|
139 |
*
|
|
140 |
* @param aMediaId id of the item
|
|
141 |
* @return KErrNone if ok
|
|
142 |
*/
|
34
|
143 |
int openItem(TMPXItemId &mediaId);
|
30
|
144 |
|
|
145 |
/**
|
|
146 |
* calls collection to go back to collection level
|
|
147 |
*
|
|
148 |
*/
|
|
149 |
int back();
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Fetches MPX Media object based on MPX ID. Object can be requested later
|
|
153 |
* with method GetLatestFetchedMpxMediaL(). Note, there is no indication
|
|
154 |
* when the object becomes available.
|
|
155 |
*
|
|
156 |
* @param aMpxId MPX ID.
|
|
157 |
*
|
|
158 |
* @return 0 media fetchingstarted ok
|
|
159 |
*/
|
|
160 |
int fetchMpxMediaByMpxId(TMPXItemId &aMpxId);
|
|
161 |
|
|
162 |
/**
|
|
163 |
* Gets all details for the selected MPX Media object.
|
|
164 |
* Result will be returned in CVideoCollectionListener::HandleCollectionMediaL().
|
|
165 |
*
|
|
166 |
* @param aMediaId meida id of the item (TMPXItemId.iId1)
|
|
167 |
*
|
|
168 |
* @return 0 if detail fetching started ok
|
|
169 |
*/
|
|
170 |
int getVideoDetails(TMPXItemId& aMediaId);
|
|
171 |
|
|
172 |
/**
|
34
|
173 |
* Add a new album.
|
|
174 |
*
|
|
175 |
* @param title, Album title.
|
|
176 |
* @return TMPXItemId id of created album TMPXItemId:::InvalidId() in case of failure
|
|
177 |
*/
|
|
178 |
TMPXItemId addNewAlbum(const QString &title);
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Add a new album.
|
30
|
182 |
*
|
34
|
183 |
* @param mediaIds, list of album id's to be removed.
|
|
184 |
* @return 0 if no errors.
|
30
|
185 |
*/
|
34
|
186 |
int removeAlbums(const QList<TMPXItemId> &mediaIds);
|
|
187 |
|
|
188 |
/**
|
|
189 |
* Add items in existing album.
|
|
190 |
*
|
|
191 |
* @param albumId, Album where to add items.
|
|
192 |
* @param mediaIds, Items which to add.
|
|
193 |
* @return 0 if no errors.
|
|
194 |
*/
|
35
|
195 |
int addItemsInAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
|
|
196 |
|
|
197 |
/**
|
|
198 |
* Removes items from existing album.
|
|
199 |
*
|
|
200 |
* @param albumId, Album from where to remove items.
|
|
201 |
* @param mediaIds, Items which to remove.
|
|
202 |
* @return 0 if no errors.
|
|
203 |
*/
|
|
204 |
int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
|
36
|
205 |
|
|
206 |
/**
|
|
207 |
* Renames an album.
|
|
208 |
*
|
|
209 |
* @param albumId, Album to be renamed.
|
|
210 |
* @param newTitle, New title for the album.
|
|
211 |
* @return 0 if no errors.
|
|
212 |
*/
|
|
213 |
int renameAlbum(const TMPXItemId &albumId, const QString &newTitle);
|
30
|
214 |
|
|
215 |
private:
|
|
216 |
|
|
217 |
/**
|
|
218 |
* Private implementation to handle leaving code of collection opening.
|
|
219 |
*
|
|
220 |
*/
|
|
221 |
void startOpenCollectionL(int level);
|
|
222 |
|
|
223 |
/**
|
|
224 |
* Private implementation to handle leaving code of video deletion.
|
|
225 |
*
|
|
226 |
* @param mediaIds list of ides to remove
|
|
227 |
*/
|
|
228 |
void deleteVideosL(QList<TMPXItemId> &mediaIds);
|
|
229 |
|
|
230 |
/**
|
|
231 |
* Private implementation to handle leaving code of video opening.
|
|
232 |
*
|
|
233 |
* @param videoId id of the video to open
|
|
234 |
*/
|
|
235 |
void openVideoL(TMPXItemId &videoId);
|
|
236 |
|
|
237 |
/**
|
|
238 |
* Private implementation to handle leaving code of collection opening.
|
|
239 |
*
|
|
240 |
* @param id id of the collection to open
|
|
241 |
*/
|
|
242 |
void openCategoryL(TMPXItemId &id);
|
|
243 |
|
|
244 |
/**
|
|
245 |
* Private implementation to handle leaving code of collection back stepping.
|
|
246 |
*
|
|
247 |
*/
|
|
248 |
void backL();
|
|
249 |
|
|
250 |
/**
|
|
251 |
* Private implementation to handle leaving code while starting to get video
|
|
252 |
* details
|
|
253 |
*
|
|
254 |
* @param videoId id of the video to get details from
|
|
255 |
*/
|
|
256 |
void getVideoDetailsL(TMPXItemId &videoId);
|
34
|
257 |
|
30
|
258 |
/**
|
34
|
259 |
* Removes user created albums.
|
30
|
260 |
*
|
34
|
261 |
* @param mediaIds, list of album id's to be removed
|
30
|
262 |
*/
|
34
|
263 |
void removeAlbumsL(const QList<TMPXItemId> &mediaIds);
|
|
264 |
|
30
|
265 |
/**
|
|
266 |
* Private implementation to handle leaving code while starting to fetch video
|
|
267 |
* object from collection
|
|
268 |
*
|
|
269 |
* @param mpxId mpxif for the video object to fetch from collection
|
|
270 |
*/
|
|
271 |
void fetchMpxMediaByMpxIdL(TMPXItemId &mpxId);
|
|
272 |
|
34
|
273 |
/**
|
|
274 |
* Create a new album.
|
|
275 |
*
|
|
276 |
* @param title, Album title.
|
|
277 |
* @return album id.
|
|
278 |
*/
|
|
279 |
TMPXItemId createAlbumL(const QString &title);
|
|
280 |
|
|
281 |
/**
|
|
282 |
* Add items in an album.
|
|
283 |
*
|
|
284 |
* @param albumId, Album where to add items.
|
|
285 |
* @param mediaIds, Items to add in the album.
|
|
286 |
* @return None.
|
|
287 |
*/
|
35
|
288 |
void addItemsInAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
|
|
289 |
|
|
290 |
/**
|
|
291 |
* Removes items from an album.
|
|
292 |
*
|
|
293 |
* @param albumId, Album where to remove items.
|
|
294 |
* @param mediaIds, Items to remove from album.
|
|
295 |
* @return None.
|
|
296 |
*/
|
|
297 |
void removeItemsFromAlbumL(TMPXItemId &albumId, const QList<TMPXItemId> &mediaIds);
|
34
|
298 |
|
36
|
299 |
/**
|
|
300 |
* Renames an album.
|
|
301 |
*
|
|
302 |
* @param albumId, Album to be renamed.
|
|
303 |
* @param newTitle, New title for the album.
|
|
304 |
* @return None.
|
|
305 |
*/
|
|
306 |
void renameAlbumL(const TMPXItemId &albumId, const QString newTitle);
|
|
307 |
|
30
|
308 |
private:
|
|
309 |
|
|
310 |
/**
|
|
311 |
* Pointer to MPX Collection utility.
|
|
312 |
* Own.
|
|
313 |
*/
|
|
314 |
MMPXCollectionUtility* mCollectionUtility;
|
|
315 |
|
|
316 |
/**
|
|
317 |
* Variable for storing My Videos collection opening status.
|
|
318 |
*/
|
|
319 |
int mCollectionOpenStatus;
|
|
320 |
|
|
321 |
/**
|
|
322 |
* Collectionlistener
|
|
323 |
*/
|
|
324 |
VideoCollectionListener *mCollectionListener;
|
|
325 |
|
|
326 |
/**
|
|
327 |
* Variable for storing opened My Videos category and album ids.
|
|
328 |
*/
|
|
329 |
TMPXItemId mOpenCategoryAlbum;
|
|
330 |
|
|
331 |
/**
|
|
332 |
* Variable for storing My Videos collection path level.
|
|
333 |
*/
|
34
|
334 |
VideoCollectionCommon::TCollectionLevels mCollectionPathLevel;
|
30
|
335 |
};
|
|
336 |
|
|
337 |
#endif // __VIDEOCOLLECTIONCLIENT_H
|