|
1 /* |
|
2 * Copyright (c) 2006 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: Implementation of SmilSVGRenderer. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CSMILSVGRENDERER_H |
|
22 #define CSMILSVGRENDERER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <SVGTAppObserver.h> |
|
26 #include <SVGRequestObserver.h> |
|
27 #include "SmilMediaRendererBase.h" |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 |
|
35 // FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CGulIcon; |
|
39 class MMediaFactoryFileInfo; |
|
40 class MSvgError; |
|
41 class CSVGTAppObserverUtil; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * CSmilSVGRenderer provides SMIL media renderer interface to render |
|
47 * SVG-T files. |
|
48 * |
|
49 * This class is used by SMIL engine to perform the SVG presentation |
|
50 * playback. |
|
51 * |
|
52 * @lib mediarenderer.lib |
|
53 * @since S60 3.2 |
|
54 */ |
|
55 NONSHARABLE_CLASS( CSmilSVGRenderer ) : public CSmilMediaRendererBase, |
|
56 public MSvgtAppObserver, |
|
57 public MSvgRequestObserver |
|
58 { |
|
59 public: // Constructors and destructor |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * |
|
64 * @param aFileHandle IN Source file handle. |
|
65 * @param aMedia IN SMIL media object. |
|
66 * @param aFileInfo IN File information interface. |
|
67 * |
|
68 * @return Initialized SVG renderer. |
|
69 */ |
|
70 static CSmilSVGRenderer* NewL( RFile& aFileHandle, |
|
71 MSmilMedia* aMedia, |
|
72 MMediaFactoryFileInfo* aFileInfo, |
|
73 DRMCommon& aDrmCommon, |
|
74 CDRMHelper& aDrmHelper ); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 virtual ~CSmilSVGRenderer(); |
|
80 |
|
81 public: // Functions from base classes |
|
82 |
|
83 /** |
|
84 * From MSmilMediaRenderer Returns if renderer is visual |
|
85 * (i.e. draws something to the screen). |
|
86 * |
|
87 * @since S60 3.2 |
|
88 * |
|
89 * @return Returns ETrue since the media type is visual. |
|
90 */ |
|
91 TBool IsVisual() const; |
|
92 |
|
93 /** |
|
94 * From MSmilMediaRenderer Returns the unscalable size of the |
|
95 * visual media object. |
|
96 * |
|
97 * @since S60 3.2 |
|
98 * |
|
99 * @return Width in pixels of SVG thumbnail. |
|
100 */ |
|
101 TInt IntrinsicWidth() const; |
|
102 |
|
103 /** |
|
104 * From MSmilMediaRenderer Returns the unscalable size of the |
|
105 * visual media object. |
|
106 * |
|
107 * @since S60 3.2 |
|
108 * |
|
109 * @return Height in pixels of SVG thumbnail. |
|
110 */ |
|
111 TInt IntrinsicHeight() const; |
|
112 |
|
113 /** |
|
114 * From MSmilMediaRenderer Returns the duration of the media object. |
|
115 * |
|
116 * @since S60 3.2 |
|
117 * |
|
118 * @return Returns duration of SVG thumbnail. |
|
119 */ |
|
120 TSmilTime IntrinsicDuration() const; |
|
121 |
|
122 /** |
|
123 * From MSmilMediaRenderer Called by the engine to signal that |
|
124 * the media is going to be played soon. |
|
125 * |
|
126 * @since S60 3.2 |
|
127 * |
|
128 * @return void |
|
129 */ |
|
130 void PrepareMediaL(); |
|
131 |
|
132 /** |
|
133 * From MSmilMediaRenderer Called by the engine to seek the media |
|
134 * to given position in its local timeline. |
|
135 * |
|
136 * @since S60 3.2 |
|
137 * |
|
138 * @param aTime IN Seek position. |
|
139 * |
|
140 * @return void |
|
141 */ |
|
142 void SeekMediaL( const TSmilTime& aTime ); |
|
143 |
|
144 /** |
|
145 * From MSmilMediaRenderer Called by the engine to start media |
|
146 * playback and to make visual media visible. |
|
147 * |
|
148 * @since S60 3.2 |
|
149 * |
|
150 * @return void |
|
151 */ |
|
152 void ShowMediaL(); |
|
153 |
|
154 /** |
|
155 * From MSmilMediaRenderer Called by the engine to stop media |
|
156 * playback and remove visual media from the screen. |
|
157 * |
|
158 * @since S60 3.2 |
|
159 * |
|
160 * @return void |
|
161 */ |
|
162 void HideMedia(); |
|
163 |
|
164 /** |
|
165 * From MSmilMediaRenderer Called by the engine to pause media playback. |
|
166 * |
|
167 * @since S60 3.2 |
|
168 * |
|
169 * @return void |
|
170 */ |
|
171 void FreezeMedia(); |
|
172 |
|
173 /** |
|
174 * From MSmilMediaRenderer Called by the engine to continue paused |
|
175 * media playback. |
|
176 * |
|
177 * @since S60 3.2 |
|
178 * |
|
179 * @return void |
|
180 */ |
|
181 void ResumeMedia(); |
|
182 |
|
183 /** |
|
184 * From MSmilMediaRenderer Called by the engine to make a media |
|
185 * renderer draw its content. |
|
186 * |
|
187 * @since S60 3.2 |
|
188 * |
|
189 * @param aGc IN Graphical context performing the drawing. |
|
190 * @param aRect IN Target rectangle. |
|
191 * @param aTransitionFilter IN Transition effects if present. |
|
192 * @param aFocus IN Focus indication if focussed. |
|
193 * |
|
194 * @return void |
|
195 */ |
|
196 void Draw( CGraphicsContext& aGc, |
|
197 const TRect& aRect, |
|
198 CSmilTransitionFilter* aTransitionFilter, |
|
199 const MSmilFocus* aFocus ); |
|
200 |
|
201 /** |
|
202 * From MSmilMediaRenderer Called by the UI to activate renderer. |
|
203 * |
|
204 * @since S60 3.2 |
|
205 * |
|
206 * @return void |
|
207 */ |
|
208 IMPORT_C void ActivateRendererL(); |
|
209 |
|
210 /** |
|
211 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
212 */ |
|
213 TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); |
|
214 |
|
215 /** |
|
216 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
217 */ |
|
218 TBool LinkActivated( const TDesC& aUri ); |
|
219 |
|
220 /** |
|
221 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
222 */ |
|
223 TBool LinkActivatedWithShow( const TDesC& aUri, const TDesC& aShow ); |
|
224 |
|
225 /** |
|
226 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
227 */ |
|
228 void DisplayDownloadMenuL(); |
|
229 |
|
230 /** |
|
231 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
232 */ |
|
233 void GetSmilFitValue( TDes& aSmilValue ); |
|
234 |
|
235 /** |
|
236 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
237 */ |
|
238 TBool CanShowSave(); |
|
239 |
|
240 /** |
|
241 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
242 */ |
|
243 TBool IsSavingDone(); |
|
244 |
|
245 /** |
|
246 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
247 */ |
|
248 TBool CanShowDownload() const; |
|
249 |
|
250 /** |
|
251 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
252 */ |
|
253 void DoSaveL( TInt aButtonid ); |
|
254 |
|
255 /** |
|
256 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
257 */ |
|
258 TInt NewFetchImageData( const TDesC& aUri ); |
|
259 |
|
260 /** |
|
261 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
262 */ |
|
263 void AssignEmbededDataL( const TDesC& aUri ); |
|
264 |
|
265 /** |
|
266 * From MSvgRequestObserver. See SVGRequestObserver.h for more information. |
|
267 */ |
|
268 void UpdateScreen(); |
|
269 |
|
270 /** |
|
271 * From MSvgRequestObserver. See SVGRequestObserver.h for more information. |
|
272 */ |
|
273 TBool ScriptCall( const TDesC& aScript, CSvgElementImpl* aCallerElement ); |
|
274 |
|
275 /** |
|
276 * From MSvgRequestObserver. See SVGRequestObserver.h for more information. |
|
277 */ |
|
278 TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); |
|
279 |
|
280 /** |
|
281 * From MSvgRequestObserver. See SVGRequestObserver.h for more information. |
|
282 */ |
|
283 void UpdatePresentation( const TInt32& aNoOfAnimation ); |
|
284 /** |
|
285 * From MSvgtAppObserver. See SVGTAppObserver.h for more information. |
|
286 */ |
|
287 TBool ExitWhenOrientationChange(); |
|
288 private: |
|
289 |
|
290 /** |
|
291 * C++ default constructor. |
|
292 */ |
|
293 CSmilSVGRenderer(); |
|
294 |
|
295 /** |
|
296 * C++ constructor. |
|
297 */ |
|
298 CSmilSVGRenderer( MSmilMedia* aMedia, |
|
299 MMediaFactoryFileInfo* aFileInfo, |
|
300 DRMCommon& aDrmCommon, |
|
301 CDRMHelper& aDrmHelper ); |
|
302 |
|
303 /** |
|
304 * By default Symbian 2nd phase constructor is private. |
|
305 */ |
|
306 void ConstructL( RFile& aFileHandle ); |
|
307 |
|
308 /** |
|
309 * Create thumbnail from SVG file. |
|
310 */ |
|
311 void GenerateThumbnailL(); |
|
312 |
|
313 /** |
|
314 * Performs SVG engine error handling. |
|
315 */ |
|
316 void HandleSVGEngineErrorL( MSvgError* aError ) const; |
|
317 |
|
318 private: // Data |
|
319 |
|
320 // Presentation thumbnail bitmap. |
|
321 CFbsBitmap* iThumbnailBitmap; |
|
322 |
|
323 // Presentation thumbnail mask. |
|
324 CFbsBitmap* iThumbnailMask; |
|
325 |
|
326 // Presentation thumbnail indicator icon. |
|
327 CGulIcon* iIndicatorIcon; |
|
328 |
|
329 // Indicates whether renderer is visible. |
|
330 TBool iVisible; |
|
331 |
|
332 // Handle to source file. |
|
333 RFile iFileHandle; |
|
334 |
|
335 // File information interface. |
|
336 MMediaFactoryFileInfo* iFileInfo; |
|
337 |
|
338 // Size of the SVG thumbnail. |
|
339 TSize iThumbnailSize; |
|
340 |
|
341 // Size of the superimposed indicator. |
|
342 TSize iIndicatorSize; |
|
343 |
|
344 // Helper class for SVG-T dialog observer. |
|
345 CSVGTAppObserverUtil* iObserverUtil; |
|
346 }; |
|
347 |
|
348 #endif // CSMILSVGRENDERER_H |
|
349 |
|
350 // End of File |