57
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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: Common model class for component.*
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef VCXHGMYVIDEOSMODEL_H
|
|
21 |
#define VCXHGMYVIDEOSMODEL_H
|
|
22 |
|
|
23 |
// INCLUDE FILES
|
|
24 |
#include <coemain.h>
|
|
25 |
#include <vcxmyvideosdefs.h>
|
|
26 |
#include <thumbnailmanager.h>
|
|
27 |
|
|
28 |
#include "CIptvDriveMonitor.h"
|
|
29 |
|
|
30 |
// FORWARD DECLARATIONS
|
|
31 |
|
|
32 |
class CVcxHgMyVideosCollectionClient;
|
|
33 |
class CRepository;
|
|
34 |
class CVcxHgMyVideosThumbnailManager;
|
|
35 |
|
|
36 |
// CONSTANTS
|
|
37 |
|
|
38 |
const TInt KVcxHgMyVideosCategoryControlGroupId(500);
|
|
39 |
const TInt KVcxHgMyVideosVideoControlGroupId(600);
|
|
40 |
|
|
41 |
// CLASS DECLARATION
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Common model class for component.
|
|
45 |
*
|
|
46 |
* @lib vcxhgmyvideos.lib
|
|
47 |
*/
|
|
48 |
NONSHARABLE_CLASS( CVcxHgMyVideosModel ) : public CBase,
|
|
49 |
public MIptvDriveMonitorObserver
|
|
50 |
{
|
|
51 |
public:
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Application / view states.
|
|
55 |
*/
|
|
56 |
enum TVcxMyVideosAppState
|
|
57 |
{
|
|
58 |
EVcxMyVideosAppStateUnknown = 0,
|
|
59 |
EVcxMyVideosAppStateCategoryBusy,
|
|
60 |
EVcxMyVideosAppStateCategoryIdle,
|
|
61 |
EVcxMyVideosAppStateVideoBusy,
|
|
62 |
EVcxMyVideosAppStateVideoIdle,
|
|
63 |
EVcxMyVideosAppStatePlayer
|
|
64 |
};
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Screen resolutions.
|
|
68 |
*/
|
|
69 |
enum TVcxScreenResolution
|
|
70 |
{
|
|
71 |
EVcxScreenResolutionUnknown = 0,
|
|
72 |
EVcxScreenResolutionQVGA,
|
|
73 |
EVcxScreenResolutionQHD,
|
|
74 |
EVcxScreenResolutionVGA
|
|
75 |
};
|
|
76 |
|
|
77 |
public: // Constructors and destructor
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Two-phased constructor.
|
|
81 |
*
|
|
82 |
* @return New object.
|
|
83 |
*/
|
|
84 |
static CVcxHgMyVideosModel* NewL();
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Two-phased constructor.
|
|
88 |
*
|
|
89 |
* @return New object.
|
|
90 |
*/
|
|
91 |
static CVcxHgMyVideosModel* NewLC();
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Destructor.
|
|
95 |
*/
|
|
96 |
virtual ~CVcxHgMyVideosModel();
|
|
97 |
|
|
98 |
public:
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Returns true if device has touch support.
|
|
102 |
*
|
|
103 |
* @return ETrue if device supports touch.
|
|
104 |
*/
|
|
105 |
TBool TouchSupport();
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Returns current screen resolution (QVGA,QHD,VGA).
|
|
109 |
*
|
|
110 |
* @param aCoeEnv Pointer to Coe Env.
|
|
111 |
* @return Screen resolution.
|
|
112 |
*/
|
|
113 |
TVcxScreenResolution GetScreenResolution( CCoeEnv* aCoeEnv );
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Returns MPX Collection Client.
|
|
117 |
*
|
|
118 |
* @return Reference to Collection client.
|
|
119 |
*/
|
|
120 |
CVcxHgMyVideosCollectionClient& CollectionClient();
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Returns reference to component's File Server session.
|
|
124 |
*
|
|
125 |
* @return Reference to File Server session.
|
|
126 |
*/
|
|
127 |
RFs& FileServerSessionL();
|
|
128 |
|
|
129 |
/**
|
|
130 |
* Returns reference to component's drive monitor.
|
|
131 |
*
|
|
132 |
* @return Reference to drive monitor.
|
|
133 |
*/
|
|
134 |
CIptvDriveMonitor& DriveMonitorL();
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Sets application state.
|
|
138 |
*
|
|
139 |
* @param aAppState New application state.
|
|
140 |
*/
|
|
141 |
void SetAppState( TVcxMyVideosAppState aAppState );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Gets application state.
|
|
145 |
*
|
|
146 |
* @return Application state.
|
|
147 |
*/
|
|
148 |
TVcxMyVideosAppState AppState();
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Returns previous application state.
|
|
152 |
*
|
|
153 |
* @return Previous application state.
|
|
154 |
*/
|
|
155 |
TVcxMyVideosAppState PreviousAppState();
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Sets video list sort order (to CenRep).
|
|
159 |
*
|
|
160 |
* @param aSortOrder New video list sort order.
|
|
161 |
*/
|
|
162 |
void SetVideolistSortOrderL( TVcxMyVideosSortingOrder aSortOrder );
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Gets the last watched video id from CenRep.
|
|
166 |
*
|
|
167 |
* @param aId Video's mpx id (iId1).
|
|
168 |
* @return System wide error code
|
|
169 |
*/
|
|
170 |
TInt GetLastWatchedIdL( TInt& aId );
|
|
171 |
|
|
172 |
/**
|
|
173 |
* Gets the last watched video name from CenRep.
|
|
174 |
*
|
|
175 |
* @param aPath On return Video's path.
|
|
176 |
* @return System wide error code
|
|
177 |
*/
|
|
178 |
TInt GetLastWatchedNameL( TDes& aName );
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Gets the last watched video path from CenRep.
|
|
182 |
*
|
|
183 |
* @param aPath On return Video's path.
|
|
184 |
* @return System wide error code
|
|
185 |
*/
|
|
186 |
TInt GetLastWatchedPathL( TDes& aPath );
|
|
187 |
|
|
188 |
/**
|
|
189 |
* Gets the last watched video indicator from CenRep.
|
|
190 |
*
|
|
191 |
* @param aValue On return Video's indicator value.
|
|
192 |
* @return System wide error code
|
|
193 |
*/
|
|
194 |
TInt GetLastWatchedIndicatorL( TInt& aValue );
|
|
195 |
|
|
196 |
/**
|
|
197 |
* Gets video list sort order (from CenRep).
|
|
198 |
*
|
|
199 |
* @return Video list sort order.
|
|
200 |
*/
|
|
201 |
TVcxMyVideosSortingOrder VideolistSortOrderL();
|
|
202 |
|
|
203 |
/**
|
|
204 |
* Gets the My Videos customization integer from CenRep.
|
|
205 |
*
|
|
206 |
* @param aKey CenRep key for the value to be fetched.
|
|
207 |
* @param aValue On return, fetched value.
|
|
208 |
* @return System wide error code
|
|
209 |
*/
|
|
210 |
TInt GetMyVideosCustomizationInt( const TInt& aKey, TInt& aValue );
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Gets the My Videos customization string from CenRep.
|
|
214 |
*
|
|
215 |
* @param aKey CenRep key for the value to be fetched.
|
|
216 |
* @param aValue On return, fetched value.
|
|
217 |
* @return System wide error code
|
|
218 |
*/
|
|
219 |
TInt GetMyVideosCustomizationString( const TInt& aKey, TDes& aValue );
|
|
220 |
/**
|
|
221 |
* Returns reference to Thumbnail Manager.
|
|
222 |
*
|
|
223 |
* @return Reference to Thumbnail Manager.
|
|
224 |
*/
|
|
225 |
CVcxHgMyVideosThumbnailManager& ThumbnailManager() const;
|
|
226 |
|
|
227 |
public: // from MIptvDriveMonitorObserver
|
|
228 |
|
|
229 |
/**
|
|
230 |
* Empty handler for drive monitor events.
|
|
231 |
*
|
|
232 |
* @aEvent The Event.
|
|
233 |
*/
|
|
234 |
void HandleDriveMonitorEvent( TIptvDriveMonitorEvent& aEvent );
|
|
235 |
|
|
236 |
private: // Constructors
|
|
237 |
|
|
238 |
/**
|
|
239 |
* Default C++ constructor.
|
|
240 |
*/
|
|
241 |
CVcxHgMyVideosModel();
|
|
242 |
|
|
243 |
/**
|
|
244 |
* Symbian 2nd phase constructor.
|
|
245 |
*/
|
|
246 |
void ConstructL();
|
|
247 |
|
|
248 |
/**
|
|
249 |
* Initializes MyVideos customization CenRep session.
|
|
250 |
*/
|
|
251 |
TInt InitMyVideosCenRepL();
|
|
252 |
|
|
253 |
private:
|
|
254 |
|
|
255 |
/**
|
|
256 |
* Client class for My Videos MPX Collection.
|
|
257 |
* Own.
|
|
258 |
*/
|
|
259 |
CVcxHgMyVideosCollectionClient* iCollection;
|
|
260 |
|
|
261 |
/**
|
|
262 |
* Application state.
|
|
263 |
*/
|
|
264 |
TVcxMyVideosAppState iAppState;
|
|
265 |
|
|
266 |
/**
|
|
267 |
* Previous application state.
|
|
268 |
*/
|
|
269 |
TVcxMyVideosAppState iPreviousAppState;
|
|
270 |
|
|
271 |
/**
|
|
272 |
* Internal flag for storing touch support information.
|
|
273 |
*/
|
|
274 |
TBool iTouchSupport;
|
|
275 |
|
|
276 |
/**
|
|
277 |
* Component's File Server session.
|
|
278 |
* Own.
|
|
279 |
*/
|
|
280 |
RFs iFsSession;
|
|
281 |
|
|
282 |
/**
|
|
283 |
* Component's drive monitor.
|
|
284 |
* Own.
|
|
285 |
*/
|
|
286 |
CIptvDriveMonitor* iDriveMonitor;
|
|
287 |
|
|
288 |
/**
|
|
289 |
* Session to MPX Collection CenRep.
|
|
290 |
* Own.
|
|
291 |
*/
|
|
292 |
CRepository* iCollectionCenRep;
|
|
293 |
|
|
294 |
/**
|
|
295 |
* Session to My Videos customization CenRep.
|
|
296 |
* Own.
|
|
297 |
*/
|
|
298 |
CRepository* iMyVideosCenRep;
|
|
299 |
|
|
300 |
/**
|
|
301 |
* Video list sort order.
|
|
302 |
*/
|
|
303 |
TVcxMyVideosSortingOrder iSortOrder;
|
|
304 |
|
|
305 |
/**
|
|
306 |
* Thumbnail Manager.
|
|
307 |
* Own.
|
|
308 |
*/
|
|
309 |
CVcxHgMyVideosThumbnailManager* iTnManager;
|
|
310 |
};
|
|
311 |
|
|
312 |
#endif // VCXHGMYVIDEOSMODEL_H
|