author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:15:24 +0300 | |
branch | RCL_3 |
changeset 64 | 3eb824b18d67 |
parent 57 | befca0ec475f |
child 70 | 375929f879c2 |
permissions | -rw-r--r-- |
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 "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: App UI engine |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
64
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
19 |
// Version : %version: 35 % |
57 | 20 |
|
21 |
||
22 |
#ifndef CMPXVIDEOPLAYERAPPUIENGINE_H |
|
23 |
#define CMPXVIDEOPLAYERAPPUIENGINE_H |
|
24 |
||
25 |
#include <e32base.h> |
|
26 |
#include <mpxplaybackutility.h> |
|
27 |
#include <mpxviewutility.h> |
|
28 |
#include <mpxcollectionutility.h> |
|
29 |
#include <mpxmessage2.h> |
|
30 |
#include <mpxcollectionplaylist.h> |
|
31 |
#include <mediarecognizer.h> |
|
32 |
#include <mpxviewactivationobserver.h> |
|
33 |
#include <mpxcollectionobserver.h> |
|
34 |
#include <mpxcollectionuihelperobserver.h> |
|
35 |
||
36 |
#ifdef __APPUIENGINESTIF__ |
|
37 |
#include "mpxvideoplayerappui_stub.h" |
|
38 |
#else |
|
39 |
#include "mpxvideoplayerappui.h" |
|
40 |
#endif |
|
41 |
||
42 |
class CMpxVideoEmbeddedPdlHandler; |
|
43 |
class MMPXCollectionUiHelper; |
|
44 |
class CAiwGenericParamList; |
|
45 |
class CVideoPlaylistUtility; |
|
64
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
46 |
class CMpxVideoPlayerIadUpdate; |
57 | 47 |
|
48 |
/** |
|
49 |
* Application UI class. |
|
50 |
* |
|
51 |
* @lib mpxvideoplayer.exe |
|
52 |
* @since MpxVideoPlayer 0.1 |
|
53 |
*/ |
|
54 |
class CMpxVideoPlayerAppUiEngine : public CBase, |
|
55 |
public MMPXViewActivationObserver, |
|
56 |
public MMPXCollectionObserver , |
|
57 |
public MMPXCHelperEmbeddedOpenObserver |
|
58 |
{ |
|
59 |
public: // Constructors and destructor |
|
60 |
static CMpxVideoPlayerAppUiEngine* NewL( CMpxVideoPlayerAppUi* aAppUi ); |
|
61 |
||
62 |
/** |
|
63 |
* Destructor. |
|
64 |
*/ |
|
65 |
virtual ~CMpxVideoPlayerAppUiEngine(); |
|
66 |
||
67 |
public: |
|
68 |
||
69 |
/* |
|
70 |
* Retrieves playback utility and creates it if needed |
|
71 |
*/ |
|
72 |
MMPXPlaybackUtility& PlaybackUtilityL(); |
|
73 |
||
74 |
/** |
|
75 |
* Opens the specified file in response to a corresponding message. |
|
76 |
* |
|
77 |
* @param aFile File to be opened. |
|
78 |
* @param aParams aiw generic parameters for the file |
|
79 |
*/ |
|
80 |
void OpenFileL( RFile& aFile, const CAiwGenericParamList* aParams ); |
|
81 |
||
82 |
/** |
|
83 |
* Opens the specified file in response to a corresponding message. |
|
84 |
* |
|
85 |
* @param aFile File to be opened. |
|
86 |
*/ |
|
87 |
void OpenFileL( const TDesC& aFileName ); |
|
88 |
||
89 |
/** |
|
90 |
* Opens the specified mpx media object. |
|
91 |
* |
|
92 |
* @param aMedia Media to be opened. |
|
93 |
*/ |
|
94 |
void OpenMediaL( const CMPXMedia& aMedia ); |
|
95 |
||
96 |
/* |
|
97 |
* Activate the proper playback view |
|
98 |
*/ |
|
99 |
void ActivatePlaybackViewL(); |
|
100 |
||
101 |
/** |
|
102 |
* Sets AppUiEngine in stand alone "mode" |
|
103 |
*/ |
|
104 |
void StartStandAloneL(); |
|
105 |
||
106 |
/** |
|
107 |
* Handle media properties. |
|
108 |
*/ |
|
109 |
void DoHandleCollectionMediaL( const CMPXMedia& aMedia ); |
|
110 |
||
111 |
/** |
|
112 |
* Steps one level up in collection path |
|
113 |
*/ |
|
114 |
void StepBackCollectionPathL(); |
|
115 |
||
116 |
/* |
|
117 |
* Handle embedded playback message |
|
118 |
* @param aMessageUid message identification uid |
|
119 |
* @param aMessageParameters aiw generic parameters |
|
120 |
*/ |
|
121 |
TBool HandleMessageL( TUid aMessageUid, |
|
122 |
const TDesC8& aMessageParameters ); |
|
123 |
||
124 |
/** |
|
125 |
* From MMPXViewActivationObserver |
|
126 |
* Handle view activation. |
|
127 |
* |
|
128 |
* @since 3.1 |
|
129 |
* @param aCurrentViewType Current view type Uid. |
|
130 |
* @param aPreviousViewType Previous view type Uid. |
|
131 |
*/ |
|
132 |
void HandleViewActivation( const TUid& aCurrentViewType, const TUid& aPreviousViewType ); |
|
133 |
||
134 |
||
135 |
/** |
|
136 |
* From MPXCollectionObserver |
|
137 |
* @since S60 3.2.3 |
|
138 |
* @param aMessage collection message, ownership not transferred. |
|
139 |
* Please check aMsg is not NULL before using it. If aErr is not |
|
140 |
* KErrNone, plugin might still call back with more info in the aMsg. |
|
141 |
* @param aErr system error code |
|
142 |
*/ |
|
143 |
void HandleCollectionMessage( CMPXMessage* aMsg, TInt /*aErr*/ ); |
|
144 |
||
145 |
/** |
|
146 |
* From MMPXCollectionObserver |
|
147 |
* Handle media properties. |
|
148 |
* |
|
149 |
* @since 3.1 |
|
150 |
* @param aMedia media properties. |
|
151 |
* @param aError Error code. |
|
152 |
*/ |
|
153 |
void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); |
|
154 |
||
155 |
/** |
|
156 |
* From MMPXCollectionObserver |
|
157 |
* Handles the collection entries being opened. |
|
158 |
* |
|
159 |
* @since 3.1 |
|
160 |
* @param aEntries Collection entries opened. |
|
161 |
* @param aIndex Focused entry. |
|
162 |
* @param aComplete ETrue no more entries. EFalse more entries |
|
163 |
* expected. |
|
164 |
* @param aError Error code. |
|
165 |
*/ |
|
166 |
void HandleOpenL( const CMPXMedia& aEntries, |
|
167 |
TInt aIndex, |
|
168 |
TBool aComplete, |
|
169 |
TInt aError ); |
|
170 |
||
171 |
/** |
|
172 |
* From MMPXCollectionObserver |
|
173 |
* Handles the item being opened. |
|
174 |
* |
|
175 |
* @since 3.1 |
|
176 |
* @param aPlaylist Collection playlist, owner ship is transfered. |
|
177 |
* @param aError Error code. |
|
178 |
*/ |
|
179 |
void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError); |
|
180 |
||
181 |
// from base class MMPXCHelperEmbeddedOpenObserver |
|
182 |
/** |
|
183 |
* From MMPXCHelperEmbeddedOpenObserver |
|
184 |
* Handles errors from opening in embedded mode |
|
185 |
* |
|
186 |
* @since 3.1 |
|
187 |
* @param aErr Error code |
|
188 |
* @param aCategory Type of item to be opened. |
|
189 |
*/ |
|
190 |
void HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory aCategory ); |
|
191 |
||
192 |
void PreLoadPdlPlaybackViewL(); |
|
193 |
||
194 |
/* |
|
195 |
* Handles the "back" button. |
|
196 |
*/ |
|
197 |
void HandleSoftKeyBackL(); |
|
198 |
||
199 |
/* |
|
200 |
* Processes shell commands. |
|
201 |
* @param aCommand |
|
202 |
* @param aDocumentName |
|
203 |
* @param aTail |
|
204 |
* @return ETrue if document name exists |
|
205 |
*/ |
|
206 |
TBool ProcessCommandParametersL( TApaCommand aCommand, |
|
207 |
TFileName& aDocumentName, |
|
208 |
const TDesC8& aTail ); |
|
209 |
||
210 |
/* |
|
211 |
* Provides the static function for the callback to exit the application |
|
212 |
* Called by CIdle iIdle |
|
213 |
* @since 9.2 |
|
214 |
* @param aPtr Pointer to callback class |
|
215 |
* @return KErrNone |
|
216 |
*/ |
|
217 |
static TInt ExitApplicationL( TAny* aPtr ); |
|
218 |
||
219 |
/* |
|
220 |
* returns the viewdepth from the viewutlity |
|
221 |
*/ |
|
222 |
TInt ViewHistoryDepth(); |
|
223 |
||
224 |
void ClearPdlInformation(); |
|
225 |
||
226 |
void InitializeFileL( const TDesC& aFileName ); |
|
227 |
||
228 |
void ClosePlaybackPluginL(); |
|
229 |
||
230 |
void SendMessageToPdlViewL( TInt aMsg ); |
|
231 |
||
232 |
/* |
|
233 |
* Activates an active object to finish the |
|
234 |
* initialization of the standalone application |
|
235 |
*/ |
|
236 |
void ActivateLateConstructTimerL(); |
|
237 |
||
238 |
private: |
|
239 |
/** |
|
240 |
* Constructor |
|
241 |
*/ |
|
242 |
CMpxVideoPlayerAppUiEngine( CMpxVideoPlayerAppUi* aAppUi ); |
|
243 |
||
244 |
/** |
|
245 |
* Default constructor |
|
246 |
*/ |
|
247 |
CMpxVideoPlayerAppUiEngine( ); |
|
248 |
||
249 |
/** |
|
250 |
* By default Symbian 2nd phase constructor is private. |
|
251 |
*/ |
|
252 |
void ConstructL(); |
|
253 |
||
254 |
||
255 |
void HandleMultiLinksFileL( const TDesC& aFileName, |
|
256 |
CMediaRecognizer::TMediaType aMediaType ); |
|
257 |
||
258 |
void HandleMultiLinksFileL( RFile& aFile, |
|
259 |
CMediaRecognizer::TMediaType aMediaType ); |
|
260 |
||
261 |
void DoHandleMultiLinksFileL( CVideoPlaylistUtility* aPlaylistUtil, |
|
262 |
TBool aSingleLink, |
|
263 |
TBool aLocalFile ); |
|
264 |
||
265 |
TPtrC GetLinkLC( const TDesC& aFileName, |
|
266 |
CMediaRecognizer::TMediaType aMediaType, |
|
267 |
TBool aUseFileHandle = EFalse ); |
|
268 |
||
269 |
TInt HandleAiwGenericParamListL( const CAiwGenericParamList* aParams ); |
|
270 |
||
271 |
/** |
|
272 |
* Handle collection message |
|
273 |
* |
|
274 |
* @param aMessage collection message |
|
275 |
*/ |
|
276 |
void DoHandleCollectionMessageL( CMPXMessage* aMessage ); |
|
277 |
||
278 |
void CreateCollectionUtilityMemberVariablesL(); |
|
279 |
||
280 |
void CreateRemoteControlListenerL(); |
|
281 |
||
282 |
/* |
|
283 |
* Activates an active object to exit the application |
|
284 |
* @since 5.0 |
|
285 |
*/ |
|
286 |
void ActivateExitActiveObject(); |
|
287 |
||
288 |
/* |
|
289 |
* Called to stop and exit the application |
|
290 |
* @since 9.2 |
|
291 |
* @return void |
|
292 |
*/ |
|
293 |
virtual void DoExitApplicationL(); |
|
294 |
||
295 |
/* |
|
296 |
* used to send media info to plugin |
|
297 |
*/ |
|
298 |
void UpdatePbPluginMediaL(); |
|
299 |
||
300 |
void InitializeStreamingLinkL( const TDesC& aUri ); |
|
301 |
void InitializePlaylistL( const CMPXCollectionPlaylist& aPlaylist, TBool aPlay ); |
|
302 |
||
303 |
/* |
|
304 |
* Provides the static function for the callback to |
|
305 |
* finish the standalone application construction |
|
306 |
* Called by CPeriodic iConstructTimer |
|
307 |
* @param aPtr Pointer to callback class |
|
308 |
* @return KErrNone |
|
309 |
*/ |
|
310 |
static TInt LateConstructCallback( TAny* aPtr ); |
|
311 |
||
312 |
/* |
|
313 |
* Called to finalize the standalone |
|
314 |
* application initialization. |
|
315 |
*/ |
|
316 |
virtual void DoLateConstructL(); |
|
317 |
||
64
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
318 |
/** |
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
319 |
* Checks for updates via IAD. |
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
320 |
*/ |
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
321 |
void DoCheckForUpdatesL(); |
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
322 |
|
57 | 323 |
private: // data |
324 |
||
325 |
CMpxVideoPlayerAppUi* iAppUi; |
|
326 |
||
327 |
// |
|
328 |
// Owned Utilities |
|
329 |
// |
|
330 |
MMPXPlaybackUtility* iPlaybackUtility; |
|
331 |
MMPXViewUtility* iViewUtility; |
|
332 |
MMPXCollectionUtility* iCollectionUtility; |
|
333 |
MMPXCollectionUiHelper* iCollectionUiHelper; // own |
|
334 |
||
335 |
CPeriodic* iConstructTimer; |
|
336 |
CIdle* iExitAo; |
|
337 |
CMediaRecognizer* iRecognizer; // own |
|
338 |
CMpxVideoEmbeddedPdlHandler* iPdlHandler; // own |
|
64
3eb824b18d67
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
339 |
CMpxVideoPlayerIadUpdate* iIadUpdate; // own |
57 | 340 |
|
341 |
TInt iAccessPointId; |
|
342 |
TBool iMultilinkPlaylist; |
|
343 |
TBool iSeekable; |
|
344 |
TBool iUpdateSeekInfo; |
|
345 |
}; |
|
346 |
||
347 |
#endif // CMPXVIDEOPLAYERAPPUIENGINE_H |