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>
|
|
22 |
|
|
23 |
// FORWARD DECLARATIONS
|
|
24 |
|
|
25 |
class MMPXCollectionUtility;
|
|
26 |
class VideoDataSignalReceiver;
|
|
27 |
class VideoCollectionListener;
|
|
28 |
|
|
29 |
|
|
30 |
// CLASS DECLARATION
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Client class for My Videos MPX Collection.
|
|
34 |
*
|
|
35 |
* @lib videocollectionwrapper.dll
|
|
36 |
*/
|
|
37 |
class VideoCollectionClient
|
|
38 |
{
|
|
39 |
|
|
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 |
*
|
|
55 |
* @return 0 if ok, < 0 in case of error
|
|
56 |
*/
|
|
57 |
int initialize();
|
|
58 |
|
|
59 |
public:
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Collection level app browsed to
|
|
63 |
*/
|
|
64 |
enum TCollectionLevels
|
|
65 |
{
|
|
66 |
ELevelInvalid = -1,
|
|
67 |
ELevelCategory = 2,
|
|
68 |
ELevelVideos = 3
|
|
69 |
};
|
|
70 |
|
|
71 |
/**
|
|
72 |
* Collection opening status
|
|
73 |
*/
|
|
74 |
enum TCollectionOpenStatus
|
|
75 |
{
|
|
76 |
ECollectionNotOpen = 0,
|
|
77 |
ECollectionOpening,
|
|
78 |
ECollectionOpened
|
|
79 |
};
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Connects videodata signals to provided object
|
|
85 |
* If method fails, client should deallocate it's
|
|
86 |
* VideoDataSignalReceiver object to make sure thee are
|
|
87 |
* no unused signal connections.
|
|
88 |
*
|
|
89 |
* @param aVideoModelObserver Observer.
|
|
90 |
*
|
|
91 |
* @return int -1 in case of failure
|
|
92 |
*/
|
|
93 |
int connectCollectionSignalReceiver(
|
|
94 |
VideoDataSignalReceiver *signalReceiver);
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Returns the current level of collection.
|
|
98 |
*
|
|
99 |
* @return some type of TCollectionLevels or -1 in case of error
|
|
100 |
*/
|
|
101 |
int getCollectionLevel();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Returns the current category
|
|
105 |
*
|
|
106 |
* @return int
|
|
107 |
*/
|
|
108 |
void getCategoryIds(int& id, int& type);
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Returns reference to collection open status. Client can use
|
|
112 |
* this to get and change the status
|
|
113 |
*
|
|
114 |
* @return some type of TCollectionLevels or -1 in case of error
|
|
115 |
*/
|
|
116 |
int getOpenStatus();
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Sets open status, if given status is ECollectionOpened calls
|
|
120 |
* startOpenCurrentState to start collection into current state.
|
|
121 |
*
|
|
122 |
*/
|
|
123 |
void setOpenStatus(int status);
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Starts opening of collection to the all videos category
|
|
127 |
*
|
|
128 |
* @return 0 startup ok
|
|
129 |
*/
|
|
130 |
int startOpenCollection(int level);
|
|
131 |
|
|
132 |
/**
|
|
133 |
* Calls open to collection to get current
|
|
134 |
* state to be opened.
|
|
135 |
*
|
|
136 |
* @return 0 startup ok
|
|
137 |
*/
|
|
138 |
int startOpenCurrentState();
|
|
139 |
|
|
140 |
/**
|
|
141 |
* calls collection to deleteFile(s) mpx media object defined by the given ids
|
|
142 |
*
|
|
143 |
* @param mediaIds pointerr to the list of items to be removed
|
|
144 |
* @return 0 if ok
|
|
145 |
*/
|
|
146 |
int deleteVideos(QList<TMPXItemId> *mediaIds);
|
|
147 |
|
|
148 |
/**
|
|
149 |
* calls collection to open video object defined by the given id
|
|
150 |
*
|
|
151 |
* @param aMediaId id of the item
|
|
152 |
* @return KErrNone if ok
|
|
153 |
*/
|
|
154 |
int openVideo(TMPXItemId &mediaId);
|
|
155 |
|
|
156 |
/**
|
|
157 |
* calls collection to go back to collection level
|
|
158 |
*
|
|
159 |
*/
|
|
160 |
int back();
|
|
161 |
|
|
162 |
/**
|
|
163 |
* Fetches MPX Media object based on MPX ID. Object can be requested later
|
|
164 |
* with method GetLatestFetchedMpxMediaL(). Note, there is no indication
|
|
165 |
* when the object becomes available.
|
|
166 |
*
|
|
167 |
* @param aMpxId MPX ID.
|
|
168 |
*
|
|
169 |
* @return 0 media fetchingstarted ok
|
|
170 |
*/
|
|
171 |
int fetchMpxMediaByMpxId(TMPXItemId &aMpxId);
|
|
172 |
|
|
173 |
/**
|
|
174 |
* Gets all details for the selected MPX Media object.
|
|
175 |
* Result will be returned in CVideoCollectionListener::HandleCollectionMediaL().
|
|
176 |
*
|
|
177 |
* @param aMediaId meida id of the item (TMPXItemId.iId1)
|
|
178 |
*
|
|
179 |
* @return 0 if detail fetching started ok
|
|
180 |
*/
|
|
181 |
int getVideoDetails(TMPXItemId& aMediaId);
|
|
182 |
|
|
183 |
/**
|
|
184 |
* Creates a new collection (album).
|
|
185 |
*
|
|
186 |
* @param name Name for the collection.
|
|
187 |
* @param thumbnail Path for the image file to use as a thumbnail for the
|
|
188 |
* collection. Can be empty.
|
|
189 |
* @param mediaIds Media ids of the videos that are added to the collection
|
|
190 |
* at creation time. Size can be zero.
|
|
191 |
* @return 0, if collection creation was success, below 0 if there was an error.
|
|
192 |
*/
|
|
193 |
int addNewCollection(QString name, QString thumbnail, QList<TMPXItemId> mediaIds);
|
|
194 |
|
|
195 |
private:
|
|
196 |
|
|
197 |
/**
|
|
198 |
* Private implementation to handle leaving code of collection opening.
|
|
199 |
*
|
|
200 |
*/
|
|
201 |
void startOpenCollectionL(int level);
|
|
202 |
|
|
203 |
/**
|
|
204 |
* Private implementation to handle leaving code of video deletion.
|
|
205 |
*
|
|
206 |
* @param mediaIds list of ides to remove
|
|
207 |
*/
|
|
208 |
void deleteVideosL(QList<TMPXItemId> &mediaIds);
|
|
209 |
|
|
210 |
/**
|
|
211 |
* Private implementation to handle leaving code of video opening.
|
|
212 |
*
|
|
213 |
* @param videoId id of the video to open
|
|
214 |
*/
|
|
215 |
void openVideoL(TMPXItemId &videoId);
|
|
216 |
|
|
217 |
/**
|
|
218 |
* Private implementation to handle leaving code of collection opening.
|
|
219 |
*
|
|
220 |
* @param id id of the collection to open
|
|
221 |
*/
|
|
222 |
void openCategoryL(TMPXItemId &id);
|
|
223 |
|
|
224 |
/**
|
|
225 |
* Private implementation to handle leaving code of collection back stepping.
|
|
226 |
*
|
|
227 |
*/
|
|
228 |
void backL();
|
|
229 |
|
|
230 |
/**
|
|
231 |
* Private implementation to handle leaving code while starting to get video
|
|
232 |
* details
|
|
233 |
*
|
|
234 |
* @param videoId id of the video to get details from
|
|
235 |
*/
|
|
236 |
void getVideoDetailsL(TMPXItemId &videoId);
|
|
237 |
|
|
238 |
/**
|
|
239 |
* Creates a new collection (album).
|
|
240 |
*
|
|
241 |
* @param name Name for the collection.
|
|
242 |
* @param mediaIds Media ids of the videos that are added to the collection
|
|
243 |
* at creation time. Size can be zero.
|
|
244 |
*/
|
|
245 |
void addNewCollectionL(QString name, QString thumbnail, QList<TMPXItemId> mediaIds);
|
|
246 |
|
|
247 |
/**
|
|
248 |
* Private implementation to handle leaving code while starting to fetch video
|
|
249 |
* object from collection
|
|
250 |
*
|
|
251 |
* @param mpxId mpxif for the video object to fetch from collection
|
|
252 |
*/
|
|
253 |
void fetchMpxMediaByMpxIdL(TMPXItemId &mpxId);
|
|
254 |
|
|
255 |
private:
|
|
256 |
|
|
257 |
|
|
258 |
/**
|
|
259 |
* Pointer to MPX Collection utility.
|
|
260 |
* Own.
|
|
261 |
*/
|
|
262 |
MMPXCollectionUtility* mCollectionUtility;
|
|
263 |
|
|
264 |
/**
|
|
265 |
* Variable for storing My Videos collection opening status.
|
|
266 |
*/
|
|
267 |
int mCollectionOpenStatus;
|
|
268 |
|
|
269 |
/**
|
|
270 |
* Collectionlistener
|
|
271 |
*/
|
|
272 |
VideoCollectionListener *mCollectionListener;
|
|
273 |
|
|
274 |
/**
|
|
275 |
* Variable for storing opened My Videos category and album ids.
|
|
276 |
*/
|
|
277 |
TMPXItemId mOpenCategoryAlbum;
|
|
278 |
|
|
279 |
/**
|
|
280 |
* Variable for storing My Videos collection path level.
|
|
281 |
*/
|
|
282 |
TCollectionLevels mCollectionPathLevel;
|
|
283 |
};
|
|
284 |
|
|
285 |
#endif // __VIDEOCOLLECTIONCLIENT_H
|