14
|
1 |
/*
|
|
2 |
* Copyright (c) 2004,2005 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: SVGT Custom Control Class implements the custom control used
|
|
15 |
* to display SVGT content.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef __SVGTCUSTCONTROL_H__
|
|
22 |
#define __SVGTCUSTCONTROL_H__
|
|
23 |
|
|
24 |
// INCLUDES
|
|
25 |
|
|
26 |
#include <e32property.h>
|
|
27 |
#include <SVGAnimationListener.h>
|
|
28 |
#include <SVGEngineInterfaceImpl.h>
|
|
29 |
#include <SVGRequestObserver.h>
|
|
30 |
#include <AknUtils.h>
|
|
31 |
|
|
32 |
#include <SVGListener.h>
|
|
33 |
#include <SVGHyperlinkListener.h>
|
|
34 |
|
|
35 |
#include <SVGTUIControlDbgFlags.hrh>
|
|
36 |
#include <SVGTProgressBarTimer.h>
|
|
37 |
#include <SVGTPointerHideTimer.h>
|
|
38 |
#include <e32std.h>
|
|
39 |
|
|
40 |
#ifdef RD_SVGT_AUDIO_SUPPORT
|
|
41 |
#include<remconcoreapitargetobserver.h> //for MRemConCoreApiTargetObserver
|
|
42 |
#endif //RD_SVGT_AUDIO_SUPPORT
|
|
43 |
|
|
44 |
// CONSTANTS
|
|
45 |
const TInt KFindTextQueryMaxLen = 50;
|
|
46 |
// MACROS
|
|
47 |
|
|
48 |
// DATA TYPES
|
|
49 |
|
|
50 |
// Enumeration for indicating animation Status of current SVGT Content
|
|
51 |
enum TSvgtAnimStatus {
|
|
52 |
ESvgNoAnimationsPresent,
|
|
53 |
ESvgAllAnimationsComplete,
|
|
54 |
ESvgAnimationsNotComplete };
|
|
55 |
|
|
56 |
// Enumeration for indicating Animation State of the viewer
|
|
57 |
enum TSvgtViewerAnimStatus
|
|
58 |
{
|
|
59 |
ESvgAnimPausedState,
|
|
60 |
ESvgAnimPlayingState,
|
|
61 |
ESvgAnimStoppedState
|
|
62 |
};
|
|
63 |
|
|
64 |
// Enumeration for indicating pointer types in the viewer
|
|
65 |
enum TSvgtViewerPointerTypes
|
|
66 |
{
|
|
67 |
ESvgPointerDefault,
|
|
68 |
ESvgPointerHand,
|
|
69 |
ESvgPointerText
|
|
70 |
};
|
|
71 |
|
|
72 |
|
|
73 |
enum TSvgCustomControlFlag
|
|
74 |
{
|
|
75 |
ESvgDisplayWaitNote = 0x01, // need to draw initial wait note
|
|
76 |
ESvgDisplayErrorNotes = 0x02, // Display Error Notes
|
|
77 |
ESvgDisplayIcons = 0x04, // Display Icons
|
|
78 |
ESvgWindowOwning = 0x08, // Window Owning Control
|
|
79 |
ESvgDrawPointer = 0x10, // Pointer is drawn
|
|
80 |
ESvgDrawPanIndicator = 0x20, // Panning Indicator is drawn
|
|
81 |
ESvgDrawPauseIndicator = 0x40, // Pause Indicator is drawn
|
|
82 |
ESvgDrawProgressBar = 0x80, // ProgressBar drawn
|
|
83 |
ESvgUseBackLight = 0x100 // Keep Backlight on while animating
|
|
84 |
};
|
|
85 |
|
|
86 |
enum TSvgCustomControlSelectCause
|
|
87 |
{
|
|
88 |
ESvgInvalidSelectCause,
|
|
89 |
ESvgHyperLinkSelectCause,
|
|
90 |
ESvgTextSelectCause,
|
|
91 |
ESvgTextAreaSelectCause
|
|
92 |
};
|
|
93 |
|
|
94 |
// FUNCTION PROTOTYPES
|
|
95 |
|
|
96 |
// FORWARD DECLARATIONS
|
|
97 |
class CSvgEngineInterfaceImpl;
|
|
98 |
class CSVGTHyperlinkHandler;
|
|
99 |
class CCoeControl;
|
|
100 |
class CSVGTProgressBarTimer;
|
|
101 |
class MSvgtAppObserver;
|
|
102 |
class CAknWaitDialog;
|
|
103 |
class CSVGTDrmHelper;
|
|
104 |
class CSvgtThreadController;
|
|
105 |
class CAknInformationNote;
|
|
106 |
class MSvgtApplicationExitObserver;
|
|
107 |
class CSvgtEventHandlerAO;
|
|
108 |
class CAknNavigationControlContainer;
|
|
109 |
class CAknNavigationDecorator;
|
|
110 |
|
|
111 |
#ifdef RD_SVGT_AUDIO_SUPPORT
|
|
112 |
class CAknVolumePopup;
|
|
113 |
class CRemConCoreApiTarget;
|
|
114 |
class CRemConInterfaceSelector;
|
|
115 |
#endif //RD_SVGT_AUDIO_SUPPORT
|
|
116 |
|
|
117 |
// CLASS DECLARATION
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Interface for the progress timer event listener.
|
|
121 |
* @lib SVGTUIControl.lib
|
|
122 |
* @since 3.0
|
|
123 |
*/
|
|
124 |
|
|
125 |
class MSVGTProgressBarDrawImpl
|
|
126 |
{
|
|
127 |
public:
|
|
128 |
|
|
129 |
/**
|
|
130 |
* This function is called in order to render the progress indicator.
|
|
131 |
* @since 3.0
|
|
132 |
* @param aTimeElapsed - Contains the time elapsed in seconds.
|
|
133 |
* @param aTotalTime - Contains the total time in seconds
|
|
134 |
*/
|
|
135 |
virtual void DrawProgressBarL( TUint aTimeElapsed,
|
|
136 |
TUint aTotalTime ) = 0;
|
|
137 |
};
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Interface for MSK labelling
|
|
141 |
* @lib SVGTUIControl.lib
|
|
142 |
* @since 3.2
|
|
143 |
*/
|
|
144 |
|
|
145 |
class MSVGTMSKImpl
|
|
146 |
{
|
|
147 |
public:
|
|
148 |
|
|
149 |
/**
|
|
150 |
* This function is called to draw the MSK label by pushing the command to
|
|
151 |
* position button's stack
|
|
152 |
* @since 3.2
|
|
153 |
* @param aResourceID - The MSK label resourceID
|
|
154 |
* @param aCommandID - The command associated with that label
|
|
155 |
*/
|
|
156 |
virtual void DrawMSKLabelL(TInt aResourceID,TInt aCommandID)=0;
|
|
157 |
|
|
158 |
/**
|
|
159 |
* This function is called to remove MSK label from button group's stack
|
|
160 |
* @since 3.2
|
|
161 |
*/
|
|
162 |
virtual void RemoveMSKLabel()=0;
|
|
163 |
|
|
164 |
};
|
|
165 |
|
|
166 |
|
|
167 |
class MCustControlPointerEventHandler
|
|
168 |
{
|
|
169 |
public:
|
|
170 |
virtual TBool HandleCustControlPointerEventL(const TPointerEvent& aPointerEvent) = 0;
|
|
171 |
};
|
|
172 |
|
|
173 |
|
|
174 |
class MSvgCustControlListener
|
|
175 |
{
|
|
176 |
};
|
|
177 |
|
|
178 |
enum TCustControlListener
|
|
179 |
{
|
|
180 |
EAudioListener = 0
|
|
181 |
};
|
|
182 |
#ifdef RD_SVGT_AUDIO_SUPPORT
|
|
183 |
class MSvgAudioMuteListener : public MSvgCustControlListener
|
|
184 |
{
|
|
185 |
public:
|
|
186 |
virtual void VolumeMuted(TBool aIsVolumeMuted) = 0;
|
|
187 |
};
|
|
188 |
#endif
|
|
189 |
/**
|
|
190 |
* CSVGTCustControl is a CCoeControl used to display SVGT content.
|
|
191 |
* It can be used independently or through dialog provided by
|
|
192 |
* CSVGTUIDialog.
|
|
193 |
*
|
|
194 |
* @lib SVGTUIControl.lib
|
|
195 |
* @since 3.0
|
|
196 |
*/
|
|
197 |
|
|
198 |
class CSVGTCustControl : public CCoeControl,
|
|
199 |
public MSvgRequestObserver,
|
|
200 |
public MSvgAnimationListener,
|
|
201 |
public MSVGTProgressBarListener,
|
|
202 |
public MSVGTPointerInactivityListener,
|
|
203 |
public MSvgHyperlinkListener
|
|
204 |
#ifdef SVGTUICONTROL_DBG_TEXT_EDIT_SELECT_API_ENABLE
|
|
205 |
, public MSvgTextAreaListener,
|
|
206 |
public MSvgTextListener
|
|
207 |
#endif // SVGTUICONTROL_DBG_TEXT_EDIT_SELECT_API_ENABLE
|
|
208 |
, public MSvgLoadingListener
|
|
209 |
|
|
210 |
#ifdef RD_SVGT_AUDIO_SUPPORT
|
|
211 |
, public MCoeControlObserver
|
|
212 |
, public MRemConCoreApiTargetObserver
|
|
213 |
#endif //RD_SVGT_AUDIO_SUPPORT
|
|
214 |
, public MSvgInteractiveElementListener
|
|
215 |
,public MSvgViewPortListener
|
|
216 |
{
|
|
217 |
public:
|
|
218 |
enum TFileType
|
|
219 |
{
|
|
220 |
// The uri refers to a local image file
|
|
221 |
ELocalImageFile,
|
|
222 |
// The uri refers to a remote image file
|
|
223 |
ERemoteImageFile,
|
|
224 |
// The uri doesnt refer to an image file
|
|
225 |
ENotAnImageFile,
|
|
226 |
// The uri is not well formed(parsing error)
|
|
227 |
EInvalidFilePath
|
|
228 |
};
|
|
229 |
public: // Constructors and destructor
|
|
230 |
|
|
231 |
MCustControlPointerEventHandler* iPntrObserver;
|
|
232 |
void SetPointerObserver(MCustControlPointerEventHandler* aPntrObserver)
|
|
233 |
{
|
|
234 |
iPntrObserver = aPntrObserver;
|
|
235 |
}
|
|
236 |
|
|
237 |
|
|
238 |
//TOUCH SUPPORT START
|
|
239 |
#ifdef RD_SCALABLE_UI_V2
|
|
240 |
//From CCoeControl
|
|
241 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
242 |
void SetContainerWindowL(const CCoeControl &aContainer);
|
|
243 |
|
|
244 |
enum TIndicatorType
|
|
245 |
{
|
|
246 |
ELeftIndicator,
|
|
247 |
ERightIndicator,
|
|
248 |
EUpIndicator,
|
|
249 |
EDownIndicator,
|
|
250 |
EPauseIndicator, //for future use
|
|
251 |
ENoIndicator
|
|
252 |
};
|
|
253 |
|
|
254 |
TIndicatorType ActiveIndicator(const TPoint aPosition ) const;
|
|
255 |
TRect ActiveIndicatorRect( TIndicatorType aIndicator) const;
|
|
256 |
|
|
257 |
void PanPresentation(const CSVGTCustControl::TIndicatorType aIndicatorType );
|
|
258 |
|
|
259 |
#endif //RD_SCALABLE_UI_V2
|
|
260 |
|
|
261 |
#ifdef RD_SVGT_AUDIO_SUPPORT
|
|
262 |
//From MCoeControlObserver
|
|
263 |
virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
|
|
264 |
|
|
265 |
void SetPresentationVolume( TInt aVolumeLevel );
|
|
266 |
TInt PresentationVolume() const;
|
|
267 |
|
|
268 |
TInt GetPrevVolume() const;
|
|
269 |
void MrccatoCommand(TRemConCoreApiOperationId aOperationId,
|
|
270 |
TRemConCoreApiButtonAction aButtonAct );
|
|
271 |
|
|
272 |
void FilterAndSendCommand(TInt aCommandId);
|
|
273 |
|
|
274 |
#endif //RD_SVGT_AUDIO_SUPPORT
|
|
275 |
//TOUCH SUPPORT END
|
|
276 |
|
|
277 |
/**
|
|
278 |
* Two-phased constructor.
|
|
279 |
* @since 3.0
|
|
280 |
* @param aFileHandle RFile that indicates the SVGT content filehandle
|
|
281 |
* @param aAppObs Implementation Class provided by application that
|
|
282 |
* uses this control
|
|
283 |
* @param aPBDrawImpl Implementation for rendering progress Indicator
|
|
284 |
* @param aMSKImpl Implementation for drawing MSK label
|
|
285 |
* Note: The ownership of the file handle is not transferred.
|
|
286 |
* It is the responsibility of the caller to close this file
|
|
287 |
* after deleting this control.
|
|
288 |
* @return CSVGTCustControl*
|
|
289 |
*/
|
|
290 |
|
|
291 |
IMPORT_C static CSVGTCustControl* NewL( RFile& aFileHandle,
|
|
292 |
MSvgtAppObserver* aAppObs,
|
|
293 |
MSVGTProgressBarDrawImpl* aPBDrawImpl,
|
|
294 |
MSVGTMSKImpl* aMSKImpl,
|
|
295 |
MSvgtApplicationExitObserver*
|
|
296 |
aExitObserver = NULL,
|
|
297 |
TBool aProgressiveRendering = EFalse,
|
|
298 |
const CCoeControl* aParent = NULL,
|
|
299 |
TInt aDisplayFlag =
|
|
300 |
ESvgDisplayWaitNote|
|
|
301 |
ESvgDisplayErrorNotes|
|
|
302 |
ESvgDisplayIcons|
|
|
303 |
ESvgDrawPanIndicator|
|
|
304 |
ESvgDrawPointer|
|
|
305 |
ESvgDrawPauseIndicator|
|
|
306 |
ESvgDrawProgressBar|
|
|
307 |
ESvgUseBackLight
|
|
308 |
);
|
|
309 |
|
|
310 |
/**
|
|
311 |
* Two-phased constructor which pushes created object onto
|
|
312 |
* Cleanup Stack.
|
|
313 |
* @since 3.0
|
|
314 |
* @param aFileHandle RFile that indicates the SVGT content filehandle
|
|
315 |
* @param aAppObs Implementation Class provided by application that
|
|
316 |
* uses this control
|
|
317 |
* @param aPBDrawImpl Implementation for rendering progress Indicator
|
|
318 |
* @param aMSKImpl Implementation for drawing MSK label
|
|
319 |
* Note: The ownership of the file handle is not transferred.
|
|
320 |
* It is the responsibility of the caller to close this file
|
|
321 |
* after deleting this control.
|
|
322 |
* @return CSVGTCustControl*
|
|
323 |
*/
|
|
324 |
|
|
325 |
static CSVGTCustControl* NewLC( RFile& aFileHandle,
|
|
326 |
MSvgtAppObserver* aAppObs,
|
|
327 |
MSVGTProgressBarDrawImpl* aPBDrawImpl,
|
|
328 |
MSVGTMSKImpl* aMSKImpl,
|
|
329 |
MSvgtApplicationExitObserver*
|
|
330 |
aExitObserver = NULL,
|
|
331 |
TBool aProgressiveRendering = EFalse,
|
|
332 |
const CCoeControl* aParent = NULL,
|
|
333 |
TInt aDisplayFlag =
|
|
334 |
ESvgDisplayWaitNote|
|
|
335 |
ESvgDisplayErrorNotes|
|
|
336 |
ESvgDisplayIcons|
|
|
337 |
ESvgDrawPanIndicator|
|
|
338 |
ESvgDrawPointer|
|
|
339 |
ESvgDrawPauseIndicator|
|
|
340 |
ESvgDrawProgressBar|
|
|
341 |
ESvgUseBackLight );
|
|
342 |
/**
|
|
343 |
* Destructor.
|
|
344 |
*/
|
|
345 |
|
|
346 |
virtual ~CSVGTCustControl();
|
|
347 |
|
|
348 |
public: // New functions
|
|
349 |
|
|
350 |
|
|
351 |
/**
|
|
352 |
* Sets the MSK Labels under various circumstances.
|
|
353 |
* @since 3.2
|
|
354 |
*/
|
|
355 |
void SetMSKLabelL();
|
|
356 |
|
|
357 |
/**
|
|
358 |
* Indicates whether the context menu is opened or not
|
|
359 |
* @since 3.2
|
|
360 |
* @param aButtonID -EAknSoftkeyContextOptions indicates context menu icon is pressed
|
|
361 |
* -EAknSoftkeySelect animation on mousedown/mouseup event.
|
|
362 |
* @return TBool-ETrue Indicates context menu icon is pressed
|
|
363 |
* EFalse otherwise.
|
|
364 |
*/
|
|
365 |
TBool GetMSKLabelFlag(TInt aButtonId) const;
|
|
366 |
|
|
367 |
|
|
368 |
/**
|
|
369 |
* Sets either the iPlayMSKLabel and iContextMenuActivated flag.
|
|
370 |
* @since 3.2
|
|
371 |
* @param aButtonID -EAknSoftkeyContextOptions indicates context menu icon is pressed
|
|
372 |
* -EAknSoftkeySelect animation on mousedown/mouseup event.
|
|
373 |
*/
|
|
374 |
void ChangeMSKLabelFlag(TInt aButtonId);
|
|
375 |
|
|
376 |
/**
|
|
377 |
* Process commands for handling SVGT content.
|
|
378 |
* @since 3.0
|
|
379 |
* @param aCommandId Integer indicating command that was activated.
|
|
380 |
*/
|
|
381 |
virtual void ProcessViewerCommandL( TInt aCommandId );
|
|
382 |
|
|
383 |
/**
|
|
384 |
* Get function for current zoom level.
|
|
385 |
* @since 3.0
|
|
386 |
* @param aZoomLevel Integer indicating the number of times the
|
|
387 |
* user has zoomed in(Zero indicates original view or no Zoom)
|
|
388 |
*/
|
|
389 |
void GetCurrentZoomLevel( TInt& aZoomLevel ) const;
|
|
390 |
|
|
391 |
/**
|
|
392 |
* Get function for current play status.
|
|
393 |
* @since 3.0
|
|
394 |
* @param aIsPlaying Boolean indicating whether Content is
|
|
395 |
* Playing/Paused.
|
|
396 |
*/
|
|
397 |
void GetCurrentAnimState( TSvgtViewerAnimStatus& aAnimState ) const;
|
|
398 |
|
|
399 |
/**
|
|
400 |
* Indicates whether the Control in Full Screen Mode.
|
|
401 |
* @since 3.0
|
|
402 |
* @param aIsFullScreenOn Boolean indicating whether Content is
|
|
403 |
* in Full Screen Mode.
|
|
404 |
*/
|
|
405 |
void GetCurrentFullScreenStatus( TBool& aIsFullScreenOn ) const;
|
|
406 |
|
|
407 |
/**
|
|
408 |
* Indicates whether the Loop feature is enabled for the Control
|
|
409 |
* @since 3.0
|
|
410 |
* @param aIsLoopOn Boolean indicating whether Content is
|
|
411 |
* in Loop Mode.
|
|
412 |
*/
|
|
413 |
void GetCurrentLoopStatus( TBool& aIsLoopOn ) const;
|
|
414 |
|
|
415 |
/**
|
|
416 |
* Gets the normal screen layout rectangle for control from LAF
|
|
417 |
* @since 3.0
|
|
418 |
* @param aRect TRect indicating the rectangle extent of the control
|
|
419 |
*/
|
|
420 |
void GetNormalScreenLayoutRect( TRect& aRect ) const;
|
|
421 |
|
|
422 |
/**
|
|
423 |
* Indicates whether the Loop feature is allowed for the Control
|
|
424 |
* Note: Loop Feature is allowed only for Non-Interactive content
|
|
425 |
* which has finite duration animations.
|
|
426 |
* @since 3.0
|
|
427 |
* @return TBool - ETrue Indicates Loop is allowed
|
|
428 |
* EFalse Otherwise.
|
|
429 |
*/
|
|
430 |
TBool IsLoopAllowed() const;
|
|
431 |
|
|
432 |
/**
|
|
433 |
* Finds whether the content contains animations
|
|
434 |
* @return TBool - ETrue indicates content contains animations,
|
|
435 |
* EFalse otherwise
|
|
436 |
* @since 3.0
|
|
437 |
*/
|
|
438 |
TBool IsAnimationPresent() const;
|
|
439 |
|
|
440 |
/**
|
|
441 |
* Finds whether the content contains any infinite duration animation
|
|
442 |
* @return TBool - ETrue indicates Finite duration,
|
|
443 |
* EFalse otherwise
|
|
444 |
* @since 3.0
|
|
445 |
*/
|
|
446 |
TBool IsContentFinite() const;
|
|
447 |
|
|
448 |
/**
|
|
449 |
* Indicates whether the SVG content is loaded
|
|
450 |
* @return TBool - ETrue indicates content loading complete,
|
|
451 |
* EFalse otherwise
|
|
452 |
* @since 3.0
|
|
453 |
*/
|
|
454 |
TBool IsProcessDone() const;
|
|
455 |
|
|
456 |
/**
|
|
457 |
* Sets the screen mode of the Control State Variable.
|
|
458 |
* Note: This does not change the size of the framebuffer -
|
|
459 |
* This is done in the SizeChanged().
|
|
460 |
* @since 3.0
|
|
461 |
* @param aIsFullScreenOn Boolean indicating whether Content is
|
|
462 |
* in Full Screen Mode.
|
|
463 |
*/
|
|
464 |
virtual void SetCurrentFullScreenStatus( TBool aIsFullScreenOn );
|
|
465 |
|
|
466 |
/**
|
|
467 |
* Function used by the application to handle background/foreground
|
|
468 |
* events. When the application goes to background the presentation
|
|
469 |
* needs to be paused. When application comes back to foreground,
|
|
470 |
* the user would need to start the paused presentation.
|
|
471 |
* @param aForeground: ETrue: Foreground event,
|
|
472 |
* EFalse: Background event.
|
|
473 |
* @since 3.0
|
|
474 |
*/
|
|
475 |
void HandleApplicationForegroundEvent( TBool aForeground );
|
|
476 |
|
|
477 |
/**
|
|
478 |
* Indicates whether the "Select Text" menu item be displayed
|
|
479 |
* @since 3.1
|
|
480 |
* @return TBool - ETrue Indicates menu item is displayed
|
|
481 |
* EFalse Otherwise.
|
|
482 |
*/
|
|
483 |
TBool IsTextSelectOn() const;
|
|
484 |
|
|
485 |
/**
|
|
486 |
* Indicates whether the "Edit Text" menu item be displayed
|
|
487 |
* @since 3.1
|
|
488 |
* @return TBool - ETrue Indicates menu item is displayed
|
|
489 |
* EFalse Otherwise.
|
|
490 |
*/
|
|
491 |
TBool IsTextEditOn() const;
|
|
492 |
|
|
493 |
/**
|
|
494 |
* Indicates whether the text content has changed since
|
|
495 |
* last Save.
|
|
496 |
* @since 3.1
|
|
497 |
* @return TBool - ETrue Indicates text has changed
|
|
498 |
* EFalse Otherwise.
|
|
499 |
*/
|
|
500 |
TBool IsTextContentChanged() const;
|
|
501 |
|
|
502 |
/**
|
|
503 |
* Used to notify custom control that save is complete and
|
|
504 |
* any cleanup operation can be performed.
|
|
505 |
* @since 3.1
|
|
506 |
*/
|
|
507 |
void SaveComplete( const TInt aError );
|
|
508 |
TInt DoHandleLoadingThreadError();
|
|
509 |
void DoExitFromDialogL();
|
|
510 |
|
|
511 |
void AssignImageData( const TDesC& aUri, HBufC8* aData );
|
|
512 |
TFileType ImageFileType( const TDesC& aUri ) const;
|
|
513 |
void SetThreadRunning(TBool aState);
|
|
514 |
TBool IsThreadRunning() const;
|
|
515 |
void PerformEngineRedraw();
|
|
516 |
|
|
517 |
/**
|
|
518 |
* Used to reset the backlight time for finite content
|
|
519 |
* any cleanup operation can be performed.
|
|
520 |
* @since 3.1
|
|
521 |
*/
|
|
522 |
void ResetBacklightTime();
|
|
523 |
|
|
524 |
void StopEventHandler();
|
|
525 |
|
|
526 |
/**
|
|
527 |
* This is a utility function is used for performing functionality
|
|
528 |
* once the engine load is complete
|
|
529 |
* @since 3.1
|
|
530 |
*/
|
|
531 |
void DoPostLoadFuncL();
|
|
532 |
|
|
533 |
/**
|
|
534 |
* This is a utility function for saving the SVG content to
|
|
535 |
* a file
|
|
536 |
* @since 3.1
|
|
537 |
*/
|
|
538 |
TInt SaveSvgDom( const TDesC& aFileName );
|
|
539 |
|
|
540 |
void GetViewPort(TInt getWidth, TInt getHeight, TBool isWidthInPercentage, TBool isHeightInPercentage, TInt& setWidth, TInt& setHeight);
|
|
541 |
|
|
542 |
public: // Functions from base classes
|
|
543 |
/**
|
|
544 |
* From MSvgRequestObserver Method called by SVG Engine
|
|
545 |
* after it has rendered a frame.
|
|
546 |
* @since 3.0
|
|
547 |
*/
|
|
548 |
void UpdateScreen();
|
|
549 |
|
|
550 |
/**
|
|
551 |
* From MSvgRequestObserver This method is for future extension,
|
|
552 |
* in which an external script engine could be used to evaluate
|
|
553 |
* a script description.
|
|
554 |
* @since 3.0
|
|
555 |
* @param aScript Descriptor containing script
|
|
556 |
* @param aCallerElement SVG Element that calls the script by a
|
|
557 |
* an event of the "on" attribute.
|
|
558 |
* @return TBool.
|
|
559 |
*/
|
|
560 |
TBool ScriptCall( const TDesC& aScript,
|
|
561 |
CSvgElementImpl* aCallerElement );
|
|
562 |
|
|
563 |
/**
|
|
564 |
* From MSvgRequestObserver This method is called by the SVG engine
|
|
565 |
* to retrieve the absolute path of the image file.
|
|
566 |
* @since 3.0
|
|
567 |
* @param aUri Descriptor containing the relative path of the image.
|
|
568 |
* @param aFilePath Descriptor which contains absolute path that is
|
|
569 |
* to be used by the Engine to retrieve the image.
|
|
570 |
* @return TBool -
|
|
571 |
* ETrue indicates absolute path is present in aFilePath.
|
|
572 |
* EFalse otherwise.
|
|
573 |
*/
|
|
574 |
TInt FetchImage( const TDesC& aUri,
|
|
575 |
RFs& aSession, RFile& aFileHandle ) ;
|
|
576 |
|
|
577 |
TInt FetchFont( const TDesC& /* aUri */,
|
|
578 |
RFs& /* aSession */, RFile& /* aFileHandle */ );
|
|
579 |
|
|
580 |
/**
|
|
581 |
* From MSvgRequestObserver This method is called by the SVG engine
|
|
582 |
* to get the SMIL Fit attribute value.
|
|
583 |
* @since 3.0
|
|
584 |
* @param aSmilValue Descriptor containing the SMIL Fit attribute.
|
|
585 |
*/
|
|
586 |
void GetSmilFitValue( TDes& aSmilValue );
|
|
587 |
|
|
588 |
/**
|
|
589 |
* From MSvgRequestObserver This method is called by the SVG engine
|
|
590 |
* to update the presentation status.
|
|
591 |
* @since 3.0
|
|
592 |
* @param aNoOfAnimation Integer. When called for the first time
|
|
593 |
* it indicates total number of animations.
|
|
594 |
* Subsequently it contains number of animations that were completed.
|
|
595 |
*/
|
|
596 |
void UpdatePresentation( const TInt32& aNoOfAnimation );
|
|
597 |
|
|
598 |
/**
|
|
599 |
* From CCoeControl Key Handling Method for control.
|
|
600 |
* @since 3.0
|
|
601 |
* @param aKeyEvent Key Event.
|
|
602 |
* @param aType Type of Key Event.
|
|
603 |
* @return TKeyResponse - EKeyWasConsumed/EKeyWasNotConsumed.
|
|
604 |
*/
|
|
605 |
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
|
|
606 |
TEventCode aType );
|
|
607 |
/**
|
|
608 |
* From CCoeControl
|
|
609 |
* @see CCoeControl::HandleResourceChange
|
|
610 |
*/
|
|
611 |
void HandleResourceChange( TInt aType );
|
|
612 |
|
|
613 |
|
|
614 |
public: //From MSvgHyperlinkListener
|
|
615 |
|
|
616 |
/**
|
|
617 |
* From MSvgHyperlinkListener
|
|
618 |
* @see MSvgHyperlinkListener::LinkEntered
|
|
619 |
*/
|
|
620 |
virtual TBool LinkEntered( const TDesC& aUri );
|
|
621 |
|
|
622 |
/**
|
|
623 |
* From MSvgHyperlinkListener
|
|
624 |
* @see MSvgHyperlinkListener::LinkExited
|
|
625 |
*/
|
|
626 |
virtual TBool LinkExited( const TDesC& aUri ) ;
|
|
627 |
|
|
628 |
|
|
629 |
|
|
630 |
/**
|
|
631 |
* From MSvgHyperlinkListener
|
|
632 |
* @see MSvgHyperlinkListener::LinkActivated
|
|
633 |
*/
|
|
634 |
virtual TBool LinkActivated( const TDesC& aUri ) ;
|
|
635 |
|
|
636 |
/**
|
|
637 |
* From MSvgHyperlinkListener
|
|
638 |
* @see MSvgHyperlinkListener::LinkActivatedWithShow
|
|
639 |
*/
|
|
640 |
virtual TBool LinkActivatedWithShow( const TDesC& aUri,
|
|
641 |
const TDesC& aShow ) ;
|
|
642 |
|
|
643 |
|
|
644 |
public:
|
|
645 |
|
|
646 |
/**
|
|
647 |
* From MSvgLoadingListener
|
|
648 |
* @see MSvgLoadingListener::ReportAllElements
|
|
649 |
*/
|
|
650 |
virtual TBool ReportAllElements() ;
|
|
651 |
|
|
652 |
/**
|
|
653 |
* From MSvgLoadingListener
|
|
654 |
* @see MSvgLoadingListener::WillAssignImageData
|
|
655 |
*/
|
|
656 |
virtual TBool WillAssignImageData() ;
|
|
657 |
|
|
658 |
/**
|
|
659 |
* From MSvgLoadingListener
|
|
660 |
* @see MSvgLoadingListener::ImageDataReference
|
|
661 |
*/
|
|
662 |
virtual void ImageDataReference( const TDesC& aUri );
|
|
663 |
|
|
664 |
/**
|
|
665 |
* From MSvgLoadingListener
|
|
666 |
* @see MSvgLoadingListener::DocumentStart
|
|
667 |
*/
|
|
668 |
virtual TBool DocumentStart() ;
|
|
669 |
|
|
670 |
/**
|
|
671 |
* From MSvgLoadingListener
|
|
672 |
* @see MSvgLoadingListener::DocumentEnd
|
|
673 |
*/
|
|
674 |
virtual TBool DocumentEnd() ;
|
|
675 |
|
|
676 |
/**
|
|
677 |
* From MSvgLoadingListener
|
|
678 |
* @see MSvgLoadingListener::ElementStart
|
|
679 |
*/
|
|
680 |
virtual TBool ElementStart( const TDesC& aTagName ,
|
|
681 |
MSvgAttributeList& aAttributeList );
|
|
682 |
|
|
683 |
/**
|
|
684 |
* From MSvgLoadingListener
|
|
685 |
* @see MSvgLoadingListener::ElementEnd
|
|
686 |
*/
|
|
687 |
virtual TBool ElementEnd( const TDesC& aTagName ) ;
|
|
688 |
|
|
689 |
/**
|
|
690 |
* From MSvgLoadingListener
|
|
691 |
* @see MSvgLoadingListener::ExternalDataRequested
|
|
692 |
*/
|
|
693 |
virtual TBool ExternalDataRequested( const TDesC& aUri ) ;
|
|
694 |
|
|
695 |
/**
|
|
696 |
* From MSvgLoadingListener
|
|
697 |
* @see MSvgLoadingListener::ExternalDataReceived
|
|
698 |
*/
|
|
699 |
virtual TBool ExternalDataReceived( const TDesC& aUri ) ;
|
|
700 |
|
|
701 |
/**
|
|
702 |
* From MSvgLoadingListener
|
|
703 |
* @see MSvgLoadingListener::ExternalDataRequestFailed
|
|
704 |
*/
|
|
705 |
virtual TBool ExternalDataRequestFailed( const TDesC& aUri ) ;
|
|
706 |
|
|
707 |
/**
|
|
708 |
* From MSvgLoadingListener
|
|
709 |
* @see MSvgLoadingListener::UnsupportedElement
|
|
710 |
*/
|
|
711 |
virtual TBool UnsupportedElement( const TDesC& aTagName ,
|
|
712 |
MSvgAttributeList& aAttributeList );
|
|
713 |
|
|
714 |
virtual void ImagesLoaded(TInt aError);
|
|
715 |
|
|
716 |
public: // From MSvgAudioMuteListener
|
|
717 |
/**
|
|
718 |
* This function is called to add a observer that will want a
|
|
719 |
* callback from custcontrol
|
|
720 |
* @param aListener object which needs the callback
|
|
721 |
* aType represents the type of listener
|
|
722 |
* @since 5.0
|
|
723 |
*/
|
|
724 |
IMPORT_C void AddListener(MSvgCustControlListener *aListener, TCustControlListener aType);
|
|
725 |
|
|
726 |
protected: // New functions - Startup Helper Functions
|
|
727 |
/**
|
|
728 |
* This function is called to create the bitmaps used by the SVG
|
|
729 |
* engine for rendering.
|
|
730 |
* @param aBitmapSize Size of Bitmap used for Framebuffer
|
|
731 |
* @since 3.0
|
|
732 |
*/
|
|
733 |
void CreateBitmapsL( const TSize& aBitmapSize );
|
|
734 |
|
|
735 |
/**
|
|
736 |
* This function is called to create the icons used by the control
|
|
737 |
* for panning/pointer display etc.
|
|
738 |
* @since 3.0
|
|
739 |
*/
|
|
740 |
void CreateIconsL();
|
|
741 |
/**
|
|
742 |
* This function is called to initialize the SVGT-Engine interface.
|
|
743 |
* @since 3.0
|
|
744 |
*/
|
|
745 |
void InitializeEngineL();
|
|
746 |
|
|
747 |
/**
|
|
748 |
* This function uses the SVG Engine to load the SVGT content.
|
|
749 |
* @since 3.0
|
|
750 |
* @param aFileHandle file handle to the SVGT content
|
|
751 |
* SVGT content.
|
|
752 |
*/
|
|
753 |
void LoadContentL( RFile& aFileHandle );
|
|
754 |
|
|
755 |
/**
|
|
756 |
* This function is used for the loading of SVG content in case
|
|
757 |
* of progressive rendering
|
|
758 |
* @since 3.1
|
|
759 |
* @param TAny* Pointer to the custom control
|
|
760 |
*/
|
|
761 |
static TInt LoadSvgContent( TAny* aAny );
|
|
762 |
|
|
763 |
/**
|
|
764 |
* This function is used for initialising the SVG engine in case
|
|
765 |
* of progressive rendering
|
|
766 |
* @since 3.1
|
|
767 |
*/
|
|
768 |
void InitSvgContentL();
|
|
769 |
|
|
770 |
/**
|
|
771 |
* This is a utility function is used for displaying the
|
|
772 |
* information notes
|
|
773 |
* @since 3.1
|
|
774 |
*/
|
|
775 |
void DisplayInfoNoteL( TInt aResourceId, TBool aIsWaitingDialog );
|
|
776 |
|
|
777 |
protected: // New functions - Pointer Helper Functions
|
|
778 |
/**
|
|
779 |
* Draws the Pointer on the screen.
|
|
780 |
* @since 3.0
|
|
781 |
*/
|
|
782 |
void DrawPointer() const;
|
|
783 |
|
|
784 |
/**
|
|
785 |
* This function is called when pointer needs to be redrawn.
|
|
786 |
* @since 3.0
|
|
787 |
*/
|
|
788 |
void UpdatePointer();
|
|
789 |
|
|
790 |
protected: // New functions - Full/Normal Screen Helper Functions
|
|
791 |
/**
|
|
792 |
* This function is called to change the framebuffer to new size
|
|
793 |
* in the SizeChanged function
|
|
794 |
* @since 3.0
|
|
795 |
*/
|
|
796 |
void SwitchScreenModeL();
|
|
797 |
|
|
798 |
protected: // New functions - Find Text Helper Functions
|
|
799 |
|
|
800 |
/**
|
|
801 |
* This function is called to calculate the find text bounding boxes.
|
|
802 |
* @since 3.0
|
|
803 |
* @return Bool Indicating Text was found or not
|
|
804 |
*/
|
|
805 |
TBool CalcFindTextBBox();
|
|
806 |
|
|
807 |
/**
|
|
808 |
* This function is called to pan the content in order that the
|
|
809 |
* current bounding box is visible. The reference point is taken as the
|
|
810 |
* center of the screen.
|
|
811 |
* @since 3.0
|
|
812 |
*/
|
|
813 |
void PanToCurBBox();
|
|
814 |
|
|
815 |
/**
|
|
816 |
* This function is called to perform the necessary procesing for
|
|
817 |
* Find Text.
|
|
818 |
* @since 3.0
|
|
819 |
*/
|
|
820 |
void ProcessFindTextCmdL();
|
|
821 |
|
|
822 |
/**
|
|
823 |
* Draws the Bounding box for the current match on the screen.
|
|
824 |
* @since 3.0
|
|
825 |
*
|
|
826 |
*/
|
|
827 |
void DrawFindTextBBox( const TRect& aRect ) const;
|
|
828 |
|
|
829 |
/**
|
|
830 |
* This function is called to perform the necessary procesing when
|
|
831 |
* text being searched using Find Text command is not found.
|
|
832 |
* @since 3.0
|
|
833 |
*/
|
|
834 |
void ProcessNoTextFoundL();
|
|
835 |
|
|
836 |
|
|
837 |
protected: // New functions - Panning Indicator Helper Functions
|
|
838 |
/**
|
|
839 |
* Draws the Pan Indicators on the screen.
|
|
840 |
* @since 3.0
|
|
841 |
*/
|
|
842 |
void DrawPanInd() const;
|
|
843 |
|
|
844 |
protected: // New functions - Related to Progress Bar/Loop
|
|
845 |
/**
|
|
846 |
* Counts the number of animations started in the SVGT content.
|
|
847 |
* @since 3.0
|
|
848 |
*/
|
|
849 |
void CountAnimStarted();
|
|
850 |
|
|
851 |
/**
|
|
852 |
* Counts the number of animations paused in the SVGT content.
|
|
853 |
* @since 3.0
|
|
854 |
*/
|
|
855 |
void CountAnimPaused();
|
|
856 |
|
|
857 |
/**
|
|
858 |
* Counts the number of animations stopped in the SVGT content.
|
|
859 |
* @since 3.0
|
|
860 |
*/
|
|
861 |
void CountAnimStopped();
|
|
862 |
|
|
863 |
|
|
864 |
/**
|
|
865 |
* Function indicates whether the animation currently in
|
|
866 |
* progress is first one.
|
|
867 |
* @return TBool - ETrue - First one
|
|
868 |
* EFalse Otherwise.
|
|
869 |
* @since 3.0
|
|
870 |
*/
|
|
871 |
TBool IsAnimFirst() const;
|
|
872 |
|
|
873 |
/**
|
|
874 |
* Function indicates whether the animation currently in
|
|
875 |
* progress is first one.
|
|
876 |
* @return TBool - ETrue - First one
|
|
877 |
* EFalse Otherwise.
|
|
878 |
* @since 3.0
|
|
879 |
*/
|
|
880 |
TBool IsAnimLast() const;
|
|
881 |
|
|
882 |
protected: // New functions for Pointer handling
|
|
883 |
/**
|
|
884 |
* Function sets the Pointer display status and redraws the whole
|
|
885 |
* control inorder to update display status
|
|
886 |
* @since 3.0
|
|
887 |
*/
|
|
888 |
void SetPointerDisplayStatusAndRedraw( TBool aIsPointerDisplayed );
|
|
889 |
protected: // New functions for pause icon blink support
|
|
890 |
/**
|
|
891 |
* Function sets the Pause display status and starts the periodic
|
|
892 |
* timer to draw the Pause Indicator
|
|
893 |
* @param TBool ETrue Indicates that Pause should be displayed
|
|
894 |
* @since 3.0
|
|
895 |
*/
|
|
896 |
void ShowPauseIcon( TBool aPauseIconVisible );
|
|
897 |
|
|
898 |
/**
|
|
899 |
* Callback Function for periodic timer for blinking the pause indicator
|
|
900 |
* @see TCallBack
|
|
901 |
* @since 3.0
|
|
902 |
*/
|
|
903 |
static TInt BlinkPauseIcon( TAny* aPtr );
|
|
904 |
|
|
905 |
/**
|
|
906 |
* Function which does the actual work of toggling pause indicator
|
|
907 |
* @since 3.0
|
|
908 |
*/
|
|
909 |
void DoBlinkPauseIcon();
|
|
910 |
protected: // New functions for cleanup
|
|
911 |
/**
|
|
912 |
* Function which frees the icons created by CreateIconsL().
|
|
913 |
* @since 3.0
|
|
914 |
*/
|
|
915 |
void FreeIcons();
|
|
916 |
|
|
917 |
protected: // New functions for wait-note processing
|
|
918 |
/**
|
|
919 |
* Launch wait note.
|
|
920 |
* @since 3.0
|
|
921 |
* @param aResourceId Resource id for note text.
|
|
922 |
*/
|
|
923 |
void LaunchWaitNoteL( TInt aResourceId );
|
|
924 |
|
|
925 |
/**
|
|
926 |
* Dismiss wait dialog.
|
|
927 |
* @since 3.0
|
|
928 |
*/
|
|
929 |
void DismissWaitNote();
|
|
930 |
protected: // New functions for progress bar timer handling
|
|
931 |
|
|
932 |
/**
|
|
933 |
* Start progress indicator timer.
|
|
934 |
* @since 3.0
|
|
935 |
* @param aAfter Time period in microseconds after which the timer ticks.
|
|
936 |
*/
|
|
937 |
void StartProgIndTimer( TInt aAfter );
|
|
938 |
|
|
939 |
/**
|
|
940 |
* Stop the progress indicator timer.
|
|
941 |
* @since 3.0
|
|
942 |
*/
|
|
943 |
void StopProgIndTimer();
|
|
944 |
|
|
945 |
protected: // New functions for handling animation controls
|
|
946 |
// play/pause/stop
|
|
947 |
/**
|
|
948 |
* This function is called to perform the necessary procesing for
|
|
949 |
* the Play Command.
|
|
950 |
* @since 3.0
|
|
951 |
*/
|
|
952 |
void ProcessPlayCmd();
|
|
953 |
|
|
954 |
/**
|
|
955 |
* This function is called to perform the necessary procesing for
|
|
956 |
* the Pause Command.
|
|
957 |
* @since 3.0
|
|
958 |
*/
|
|
959 |
void ProcessPauseCmd();
|
|
960 |
|
|
961 |
/**
|
|
962 |
* This function is called to perform the necessary procesing for
|
|
963 |
* the Stop Command.
|
|
964 |
* @since 3.0
|
|
965 |
*/
|
|
966 |
void ProcessStopCmd();
|
|
967 |
|
|
968 |
private: // Functions for voice call check
|
|
969 |
/**
|
|
970 |
* This function checks whether a voice call is in progress
|
|
971 |
* and in connected state.
|
|
972 |
* @return TBool - ETrue - If voice call is in connected state
|
|
973 |
* EFalse Otherwise.
|
|
974 |
* @since 3.0
|
|
975 |
*/
|
|
976 |
TBool IsVoiceCallActive();
|
|
977 |
|
|
978 |
private: // New Function for Note remover timer
|
|
979 |
/**
|
|
980 |
* Callback Function for timer for removing the note that is not
|
|
981 |
* removed in the UI.
|
|
982 |
* @see TCallBack
|
|
983 |
* @since 3.0
|
|
984 |
*/
|
|
985 |
static TInt RemoveInfoNote( TAny* aPtr );
|
|
986 |
|
|
987 |
private: // New Functions for rotation
|
|
988 |
/**
|
|
989 |
* This function rotates the presentation with given angle
|
|
990 |
* about bitmap center.
|
|
991 |
* @param aAngle in Degrees
|
|
992 |
*/
|
|
993 |
void DoRotation(const TInt aAngle);
|
|
994 |
|
|
995 |
private: // New Functions for Text Editing/Selection
|
|
996 |
#ifdef SVGTUICONTROL_DBG_TEXT_EDIT_SELECT_API_ENABLE
|
|
997 |
/**
|
|
998 |
* This function displays the existing text in the text/textArea
|
|
999 |
* in a read-only dialog so that the user can copy text from it to
|
|
1000 |
* the system clipboard.
|
|
1001 |
* @param aText Text content Descriptor
|
|
1002 |
*/
|
|
1003 |
void DoTextSelectionL( TDes& aText ) const;
|
|
1004 |
|
|
1005 |
/**
|
|
1006 |
* This function displays the existing text in the text/textArea
|
|
1007 |
* element which is editable and returns the modified text in the
|
|
1008 |
* same descriptor.
|
|
1009 |
* @param aIsTextElement Bool indicating whether elem is text/textArea
|
|
1010 |
* @param aElemHandle TInt Handle for the elem from engine
|
|
1011 |
* @param aText Text content Descriptor modified on return
|
|
1012 |
*/
|
|
1013 |
void DoTextEditingL( TBool aIsTextElement, TInt aElemHandle,
|
|
1014 |
TDes& aText );
|
|
1015 |
#endif // SVGTUICONTROL_DBG_TEXT_EDIT_SELECT_API_ENABLE
|
|
1016 |
private: // New functions for Four Point Rects
|
|
1017 |
/**
|
|
1018 |
* This function calculates the center of the 4-point rect
|
|
1019 |
* @param aBBoxRect the Four point Rect whose center is to be found
|
|
1020 |
* @return TPoint - Center coordinates
|
|
1021 |
*/
|
|
1022 |
TPoint FPRCenter( const MRect* aBBoxRect ) const;
|
|
1023 |
|
|
1024 |
/**
|
|
1025 |
* This function checks whether the FPR intersects with the rectangle
|
|
1026 |
* @param aBBoxRect the Four point Rect
|
|
1027 |
* @param aRect Rectangle with which intersection is to be found
|
|
1028 |
* @return TBool - Whether Intersects(ETrue) or not.
|
|
1029 |
*/
|
|
1030 |
TBool FPRIntersects( const MRect* aBBoxRect, const TRect& aRect ) const;
|
|
1031 |
|
|
1032 |
/**
|
|
1033 |
* This function converts a four point rectangle to an array of points
|
|
1034 |
* @param aBBoxRect the Four point Rect
|
|
1035 |
* @param aArrayPtr Array of TPoints
|
|
1036 |
*/
|
|
1037 |
void FPR2PointArrayL( const MRect* aBBoxRect,
|
|
1038 |
CArrayFix<TPoint>*& aArrayPtr ) const;
|
|
1039 |
|
|
1040 |
protected: // Functions from base classes
|
|
1041 |
/**
|
|
1042 |
* From CCoeControl Draws the SVGT frame on the screen.
|
|
1043 |
* @since 3.0
|
|
1044 |
* @param aRect Rectangle which needs to be redrawn.
|
|
1045 |
*/
|
|
1046 |
virtual void Draw( const TRect& aRect ) const;
|
|
1047 |
|
|
1048 |
/**
|
|
1049 |
* From CCoeControl Constructs the control from resource.
|
|
1050 |
* @since 3.0
|
|
1051 |
* @param aReader Resource Reader with which to access the
|
|
1052 |
* control's resource.
|
|
1053 |
*/
|
|
1054 |
virtual void ConstructFromResourceL( TResourceReader& aReader );
|
|
1055 |
|
|
1056 |
/**
|
|
1057 |
* From CCoeControl Handles control resizing.
|
|
1058 |
* @since 3.0
|
|
1059 |
*/
|
|
1060 |
virtual void SizeChanged();
|
|
1061 |
|
|
1062 |
/**
|
|
1063 |
* From MSvgAnimationListener Callback called by SVG
|
|
1064 |
* engine when animation starts
|
|
1065 |
* @since 3.0
|
|
1066 |
*/
|
|
1067 |
TBool AnimationStarted( TBool aIsAnimationIndefinite );
|
|
1068 |
|
|
1069 |
/**
|
|
1070 |
* From MSvgAnimationListener Callback called by SVG
|
|
1071 |
* engine when animation ends.
|
|
1072 |
* @since 3.0
|
|
1073 |
*/
|
|
1074 |
TBool AnimationEnded();
|
|
1075 |
|
|
1076 |
/**
|
|
1077 |
* From MSvgAnimationListener Callback called by SVG
|
|
1078 |
* engine when animation is paused.
|
|
1079 |
* @since 3.0
|
|
1080 |
*/
|
|
1081 |
TBool AnimationPaused();
|
|
1082 |
|
|
1083 |
/**
|
|
1084 |
* From MSVGTProgressBarListener. This function
|
|
1085 |
* updates the progress bar in the navi pane. It is called
|
|
1086 |
* back by the progress bar timer.
|
|
1087 |
* @since 3.0
|
|
1088 |
*/
|
|
1089 |
void UpdateProgressBar();
|
|
1090 |
|
|
1091 |
/**
|
|
1092 |
* From MSVGTPointerInactivityListener. This function
|
|
1093 |
* updates the display status for the pointer. It is called
|
|
1094 |
* back by the Pointer Hide Timer after a period of
|
|
1095 |
* inactivity.
|
|
1096 |
* @since 3.0
|
|
1097 |
*/
|
|
1098 |
void PointerInactivityTimeout();
|
|
1099 |
#ifdef SVGTUICONTROL_DBG_TEXT_EDIT_SELECT_API_ENABLE
|
|
1100 |
/**
|
|
1101 |
* From MSvgTextAreaListener. This callback is called to notify
|
|
1102 |
* when a pointer enters a textbox element.
|
|
1103 |
* @since 3.1
|
|
1104 |
* @see MSvgTextAreaListener
|
|
1105 |
*/
|
|
1106 |
virtual TBool TextAreaEntered( TInt aTextAreaHandle );
|
|
1107 |
|
|
1108 |
/**
|
|
1109 |
* From MSvgTextAreaListener. This callback is called to notify
|
|
1110 |
* when a pointer exits a textbox element.
|
|
1111 |
*
|
|
1112 |
* @since 3.1
|
|
1113 |
* @see MSvgTextAreaListener
|
|
1114 |
*/
|
|
1115 |
virtual TBool TextAreaExited( TInt aTextAreaHandle );
|
|
1116 |
|
|
1117 |
/**
|
|
1118 |
* From MSvgTextAreaListener. This callback is called to notify
|
|
1119 |
* the client that a link has been activated.
|
|
1120 |
*
|
|
1121 |
* @since 3.1
|
|
1122 |
* @see MSvgTextAreaListener
|
|
1123 |
*/
|
|
1124 |
virtual TBool TextAreaActivated( TInt aTextAreaHandle );
|
|
1125 |
|
|
1126 |
/**
|
|
1127 |
* From MSvgTextListener - Notified when a pointer enters a
|
|
1128 |
* text element.
|
|
1129 |
*
|
|
1130 |
* @since 3.1
|
|
1131 |
* @see MSvgTextListener
|
|
1132 |
*/
|
|
1133 |
virtual TBool TextEntered( TInt aTextHandle );
|
|
1134 |
|
|
1135 |
/**
|
|
1136 |
* From MSvgTextListener - Notified when a pointer exits a
|
|
1137 |
* text element.
|
|
1138 |
*
|
|
1139 |
* @since 3.1
|
|
1140 |
* @see MSvgTextListener
|
|
1141 |
*/
|
|
1142 |
virtual TBool TextExited( TInt aTextHandle );
|
|
1143 |
|
|
1144 |
/**
|
|
1145 |
* From MSvgTextListener - Notified when a pointer selects a
|
|
1146 |
* text element.
|
|
1147 |
*
|
|
1148 |
* @since 3.1
|
|
1149 |
* @see MSvgTextListener
|
|
1150 |
*/
|
|
1151 |
virtual TBool TextActivated( TInt aTextHandle );
|
|
1152 |
#endif // SVGTUICONTROL_DBG_TEXT_EDIT_SELECT_API_ENABLE
|
|
1153 |
|
|
1154 |
/**
|
|
1155 |
* From MSvgInteractiveElementListener. This callback is called to notify
|
|
1156 |
* the client that an interactive element has been entered.
|
|
1157 |
*
|
|
1158 |
* @since 3.2
|
|
1159 |
* @see MSvgInteractiveElementListener
|
|
1160 |
*/
|
|
1161 |
virtual TBool InteractiveElementEntered(TPtrC aElementIdPtr, TUint16 aInteractonTypeList );
|
|
1162 |
|
|
1163 |
/**
|
|
1164 |
* From MSvgInteractiveElementListener - Notified when a pointer exits an
|
|
1165 |
* interactive element.
|
|
1166 |
*
|
|
1167 |
* @since 3.2
|
|
1168 |
* @see MSvgInteractiveElementListener
|
|
1169 |
*/
|
|
1170 |
virtual TBool InteractiveElementExited(TPtrC aElementIdPtr);
|
|
1171 |
|
|
1172 |
private:
|
|
1173 |
|
|
1174 |
/**
|
|
1175 |
* C++ default constructor.
|
|
1176 |
* @param RFile File Handle - File handle of SVGT content
|
|
1177 |
*/
|
|
1178 |
CSVGTCustControl( RFile& aFileHandle ,
|
|
1179 |
TBool aProgressiveRendering,
|
|
1180 |
TInt aDisplayFlag =
|
|
1181 |
ESvgDisplayWaitNote|
|
|
1182 |
ESvgDisplayErrorNotes|
|
|
1183 |
ESvgDisplayIcons|
|
|
1184 |
ESvgDrawPanIndicator|
|
|
1185 |
ESvgDrawPointer|
|
|
1186 |
ESvgDrawPauseIndicator|
|
|
1187 |
ESvgDrawProgressBar|
|
|
1188 |
ESvgUseBackLight );
|
|
1189 |
|
|
1190 |
/**
|
|
1191 |
* Second Phase constructor.
|
|
1192 |
* @param aAppObs Implementation Class provided by application that
|
|
1193 |
* uses this control
|
|
1194 |
* @param aPBDrawImpl Implementation for rendering progress Indicator
|
|
1195 |
* @param aMSKImpl Implementation for drawing MSK label
|
|
1196 |
*/
|
|
1197 |
void ConstructL( MSvgtAppObserver* aAppObs,
|
|
1198 |
MSVGTProgressBarDrawImpl* aPBDrawImpl,
|
|
1199 |
MSVGTMSKImpl* aMSKImpl,
|
|
1200 |
MSvgtApplicationExitObserver* aExitObserver,
|
|
1201 |
const CCoeControl* aParent );
|
|
1202 |
private: // Data
|
|
1203 |
// Stores the Application's implementation of the Callbacks.
|
|
1204 |
MSvgtAppObserver* iAppObserver;
|
|
1205 |
// Stores the Application's Exit callback implementation pointer
|
|
1206 |
MSvgtApplicationExitObserver* iExitObserver;
|
|
1207 |
// Bitmap used by SVG Engine to render content.
|
|
1208 |
CFbsBitmap* iSVGTBitMap;
|
|
1209 |
|
|
1210 |
// Mask for the bitmap.
|
|
1211 |
CFbsBitmap* iSVGTBitMapMask;
|
|
1212 |
|
|
1213 |
// Icons
|
|
1214 |
// Pointer Icons - owned
|
|
1215 |
CGulIcon* iPointerIcon;
|
|
1216 |
CGulIcon* iHandIcon;
|
|
1217 |
CGulIcon* iTextIcon;
|
|
1218 |
|
|
1219 |
// Panning Indicator Icons - owned
|
|
1220 |
CGulIcon* iPanIndLeftIcon;
|
|
1221 |
CGulIcon* iPanIndRightIcon;
|
|
1222 |
CGulIcon* iPanIndUpIcon;
|
|
1223 |
CGulIcon* iPanIndDownIcon;
|
|
1224 |
|
|
1225 |
// Pause Indicator Icons - owned
|
|
1226 |
CGulIcon* iPauseIcon;
|
|
1227 |
|
|
1228 |
// SVG Engine Interface Implementation pointer
|
|
1229 |
CSvgEngineInterfaceImpl* iSvgModule;
|
|
1230 |
|
|
1231 |
// Stores the total number of animation in content.
|
|
1232 |
TInt32 iTotalNumerOfAnimation;
|
|
1233 |
|
|
1234 |
// Stores the current animation status.
|
|
1235 |
TSvgtAnimStatus iAnimationStatus;
|
|
1236 |
|
|
1237 |
// Stores the viewer animation state.
|
|
1238 |
TSvgtViewerAnimStatus iAnimState;
|
|
1239 |
|
|
1240 |
// SVGT content filehandle
|
|
1241 |
RFile& iContentFileHandle;
|
|
1242 |
|
|
1243 |
// Boolean to keep track of whether the loading of content is done.
|
|
1244 |
TBool iIsLoadingDone;
|
|
1245 |
|
|
1246 |
// Integer variable which stores the FetchImage error
|
|
1247 |
TInt iFetchImageError;
|
|
1248 |
|
|
1249 |
// Zoom Level is the number of times content has been zoomed-in.
|
|
1250 |
TInt iZoomLevel;
|
|
1251 |
|
|
1252 |
// Boolean indicating whether Loop Mode is enabled.
|
|
1253 |
TBool iIsLoopOn;
|
|
1254 |
|
|
1255 |
// Boolean indicating whether Full Screen mode is enabled.
|
|
1256 |
TBool iIsFullScreenOn;
|
|
1257 |
|
|
1258 |
// Pointer State Variable - Delta Change in X in pixels.
|
|
1259 |
TInt iPointerDx;
|
|
1260 |
|
|
1261 |
// Pointer State Variable - Delta Change in Y in pixels.
|
|
1262 |
TInt iPointerDy;
|
|
1263 |
|
|
1264 |
// Pointer State Variable - Current X pixel coordinate.
|
|
1265 |
TInt iPointerX;
|
|
1266 |
|
|
1267 |
// Pointer State Variable - Current Y pixel coordinate.
|
|
1268 |
TInt iPointerY;
|
|
1269 |
|
|
1270 |
// Last Searched Text for use with Find Text
|
|
1271 |
TBuf<KFindTextQueryMaxLen> iLastSearchText;
|
|
1272 |
|
|
1273 |
// Array to store the Bounding boxes for found text
|
|
1274 |
RPointerArray <MRect> iBoundBoxArray;
|
|
1275 |
|
|
1276 |
// Array to store the text found
|
|
1277 |
RArray <TPtrC> iFoundTextArray;
|
|
1278 |
|
|
1279 |
// Array to store the text element ids found - for use in animation case.
|
|
1280 |
RArray <TInt> iTextElemIdArray;
|
|
1281 |
|
|
1282 |
// Bool that keeps track whether current search string(iLastSearchText)
|
|
1283 |
// is valid
|
|
1284 |
TBool iIsSearchStrValid;
|
|
1285 |
|
|
1286 |
// Current Match Index
|
|
1287 |
TInt iCurSearchMatchId;
|
|
1288 |
|
|
1289 |
//Flag to check whether the svg file has only Preview rights
|
|
1290 |
TBool iPreviewMode;
|
|
1291 |
|
|
1292 |
// Number of animations in progress (whose repeatCount != Infinite)
|
|
1293 |
TInt iNumAnimInProgress;
|
|
1294 |
|
|
1295 |
// Progress Indicator Timer
|
|
1296 |
CSVGTProgressBarTimer* iProgressBarTimer;
|
|
1297 |
|
|
1298 |
// Duration of SVG Content
|
|
1299 |
TUint iDuration;
|
|
1300 |
|
|
1301 |
// Interface for Progress Bar Draw Implementation
|
|
1302 |
MSVGTProgressBarDrawImpl* iProgressBarDrawImpl;
|
|
1303 |
|
|
1304 |
//Interface for MSK label implementation
|
|
1305 |
MSVGTMSKImpl* iMSKImpl;
|
|
1306 |
|
|
1307 |
// Pointer Hide Timer
|
|
1308 |
CSVGTPointerHideTimer* iInactivityTimer;
|
|
1309 |
|
|
1310 |
// Bool that keeps track whether pointer should be drawn or not.
|
|
1311 |
TBool iIsPointerDisplayed;
|
|
1312 |
|
|
1313 |
// Timer for blinking pause icon
|
|
1314 |
CPeriodic* iBlinker;
|
|
1315 |
|
|
1316 |
// Bool that keeps track whether paused icon is drawn or not.
|
|
1317 |
TBool iPauseIconVisible;
|
|
1318 |
|
|
1319 |
|
|
1320 |
// Number of continous key presses since last key down
|
|
1321 |
TInt iKeyRepeatCount;
|
|
1322 |
// Main Viewer Pane Layout
|
|
1323 |
TAknLayoutRect iViewerPaneRect;
|
|
1324 |
// Layout Rectangles for Pan Indicators
|
|
1325 |
TAknLayoutRect iPanIndLeftRect;
|
|
1326 |
TAknLayoutRect iPanIndRightRect;
|
|
1327 |
TAknLayoutRect iPanIndUpRect;
|
|
1328 |
TAknLayoutRect iPanIndDownRect;
|
|
1329 |
TAknLayoutRect iPauseRect;
|
|
1330 |
|
|
1331 |
// Layout Touch Area Rectangles of Pan Indicators
|
|
1332 |
TAknLayoutRect iPanIndLeftAidRect;
|
|
1333 |
TAknLayoutRect iPanIndRightAidRect;
|
|
1334 |
TAknLayoutRect iPanIndUpAidRect;
|
|
1335 |
TAknLayoutRect iPanIndDownAidRect;
|
|
1336 |
|
|
1337 |
// Layout Rectangle for Pointer
|
|
1338 |
TAknLayoutRect iPointerRect;
|
|
1339 |
TAknLayoutRect iHandRect;
|
|
1340 |
TAknLayoutRect iTextRect;
|
|
1341 |
|
|
1342 |
// Layout Rectangle for aid of placement of pointer
|
|
1343 |
TAknLayoutRect iPointerAidRect;
|
|
1344 |
TAknLayoutRect iHandAidRect;
|
|
1345 |
TAknLayoutRect iTextAidRect;
|
|
1346 |
|
|
1347 |
// Framebuffer Bitmap
|
|
1348 |
CFbsBitmap* iSVGTFrameBufBitMap;
|
|
1349 |
|
|
1350 |
// Bitmap Device
|
|
1351 |
CFbsBitmapDevice* iSVGTFrameBufDevice;
|
|
1352 |
|
|
1353 |
// Bitmap Context
|
|
1354 |
CFbsBitGc* iSVGTFrameBufContext;
|
|
1355 |
|
|
1356 |
// Current Layout - To check whether layout changed in SizeChanged()
|
|
1357 |
TRect iCurrentLayout;
|
|
1358 |
|
|
1359 |
// Find Text Highlight Colour
|
|
1360 |
TRgb iFindTextHiColor;
|
|
1361 |
|
|
1362 |
// Number of microseconds elapsed since content started.
|
|
1363 |
TUint iProgIndTimeElap;
|
|
1364 |
|
|
1365 |
// Number of milliseconds elapsed since last progress indicator update
|
|
1366 |
TUint iProgIndResidueTime;
|
|
1367 |
|
|
1368 |
// Last update of progress indicator tick in millisec
|
|
1369 |
TUint iProgIndLastTickTime;
|
|
1370 |
// Wait note dialog pointer
|
|
1371 |
CAknWaitDialog* iWaitDialog;
|
|
1372 |
|
|
1373 |
// DrmHelper to display save related query
|
|
1374 |
CSVGTDrmHelper* iSvgDrmHelper;
|
|
1375 |
|
|
1376 |
// To get the type and the state of the phone call
|
|
1377 |
RProperty iSystemState;
|
|
1378 |
|
|
1379 |
// Used to keep track of whether key events are ignored
|
|
1380 |
// when pointer is unhidden
|
|
1381 |
TBool iIgnorePointerKeyEvent;
|
|
1382 |
|
|
1383 |
// Information Note for displaying the "text not found" note
|
|
1384 |
CAknInformationNote* iInfoNote;
|
|
1385 |
|
|
1386 |
// Timer for removing the "text not found" wait note
|
|
1387 |
CPeriodic* iNoteRemoverTimer;
|
|
1388 |
|
|
1389 |
// Indicates what type of pointer is to be drawn
|
|
1390 |
TSvgtViewerPointerTypes iPointerType;
|
|
1391 |
|
|
1392 |
// Enable/Disable Control for text operations(Editing/selection)
|
|
1393 |
TBool iEnableTextOps;
|
|
1394 |
|
|
1395 |
// Boolean indicating whether text edit menu is to be displayed
|
|
1396 |
TBool iIsTextEditOn;
|
|
1397 |
|
|
1398 |
// Boolean indicating whether text select menu is to be displayed
|
|
1399 |
TBool iIsTextSelectOn;
|
|
1400 |
|
|
1401 |
// Text (text/textArea) element currently under the cursor
|
|
1402 |
TInt iCurrentTextElementId;
|
|
1403 |
|
|
1404 |
// Boolean indicating whether current element is text(ETrue) or
|
|
1405 |
// a textArea (EFalse) element
|
|
1406 |
TBool iIsCurrentTextElement;
|
|
1407 |
|
|
1408 |
TBool iProgressiveRendering;
|
|
1409 |
TInt iDisplayFlags;
|
|
1410 |
|
|
1411 |
CSvgtEventHandlerAO* iEventHandlerAO;
|
|
1412 |
CSvgtThreadController* iThreadController;
|
|
1413 |
RThread iMainThread;
|
|
1414 |
MSvgError* iLoadingThreadError;
|
|
1415 |
TFileType iImageFileType;
|
|
1416 |
TTime iPreviousBackLightTimeStamp;
|
|
1417 |
TBool iIsThreadRunning;
|
|
1418 |
TBool iIsWaitNoteDisplayed;
|
|
1419 |
//TOUCH SUPPORT START
|
|
1420 |
#ifdef RD_SVGT_AUDIO_SUPPORT
|
|
1421 |
CAknVolumePopup* iVolumePopup;
|
|
1422 |
TInt iPrevVolume;
|
|
1423 |
TInt iVolumeLevel;
|
|
1424 |
|
|
1425 |
CRemConCoreApiTarget* iInterfaceSelector;
|
|
1426 |
CRemConInterfaceSelector* iSelector;
|
|
1427 |
#endif //RD_SVGT_AUDIO_SUPPORT
|
|
1428 |
//TOUCH SUPPORT END
|
|
1429 |
// The cause for select operation - Hyperlink/text/textArea activate
|
|
1430 |
TSvgCustomControlSelectCause iSelectCause;
|
|
1431 |
// Boolean indicating whether the cursor is inside a textArea element
|
|
1432 |
TBool iTextAreaEntered;
|
|
1433 |
|
|
1434 |
// Boolean indicating whether text is modified in content
|
|
1435 |
// since last save
|
|
1436 |
TBool iIsTextChanged;
|
|
1437 |
// Booleans that are updated every time a frame is rendered
|
|
1438 |
// in order to avoid overhead of calling IsPanPossibleFourWay
|
|
1439 |
// API all the time.
|
|
1440 |
// Pan Left Possible
|
|
1441 |
TBool iPanLt;
|
|
1442 |
// Pan Right Possible
|
|
1443 |
TBool iPanRt;
|
|
1444 |
// Pan Up Possible
|
|
1445 |
TBool iPanUp;
|
|
1446 |
// Pan Down Possible
|
|
1447 |
TBool iPanDn;
|
|
1448 |
|
|
1449 |
//Bool that checks whether the select key is pressed for options or a normal seletion
|
|
1450 |
TBool iViewerCommand;
|
|
1451 |
|
|
1452 |
//Flag to check whether play msk is visible
|
|
1453 |
TBool iPlayMSKLabel;
|
|
1454 |
|
|
1455 |
//Flag that indicates MSK is not visible
|
|
1456 |
TBool iContextMenuActivated;
|
|
1457 |
|
|
1458 |
// Flag to indicate whether the element is "a" element or not
|
|
1459 |
TBool iAElement;
|
|
1460 |
|
|
1461 |
//Flag to check whether scrolling is done when the pointer is hidden
|
|
1462 |
TBool iScrollKey;
|
|
1463 |
|
|
1464 |
|
|
1465 |
//Flag to indicate that pointer-down animation is possible with the element
|
|
1466 |
TBool iPointerDownAnimation;
|
|
1467 |
|
|
1468 |
// Count maintained to get a list of interactive elements entered
|
|
1469 |
TInt iInteractiveElementEnteredCnt;
|
|
1470 |
#ifdef _DEBUG
|
|
1471 |
TInt iDbgNumAnimStarted;
|
|
1472 |
TInt iDbgNumAnimStopped;
|
|
1473 |
TInt iDbgNumAnimPaused;
|
|
1474 |
#endif
|
|
1475 |
|
|
1476 |
TBool iEngineInitialized;
|
|
1477 |
|
|
1478 |
TBool iDownKeyOccurred;
|
|
1479 |
|
|
1480 |
//indicates if volume is currently muted or not
|
|
1481 |
TBool iIsVolumeMuted;
|
|
1482 |
TBool iIsForeground;
|
|
1483 |
|
|
1484 |
//AudioListener to indicate to UIdialog that volume is muted
|
|
1485 |
MSvgAudioMuteListener* iAudioMuteListener;
|
|
1486 |
};
|
|
1487 |
|
|
1488 |
#endif // __SVGTCUSTCONTROL_H__
|
|
1489 |
|
|
1490 |
// End of File
|