|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef AKN_SVG_FORMAT_HANDLER_H |
|
22 #define AKN_SVG_FORMAT_HANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <SVGEngineInterfaceImpl.h> |
|
27 #include <SVGRequestObserver.h> |
|
28 |
|
29 #include "AknIconFormatHandler.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 class CFbsBitmap; |
|
34 class MAknIconChangeObserver; |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * CAknSvgFormatHandler |
|
39 */ |
|
40 NONSHARABLE_CLASS(CAknSvgFormatHandler) : |
|
41 public CBase, |
|
42 public MAknIconFormatHandler, |
|
43 public MSvgRequestObserver |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 static CAknSvgFormatHandler* NewL(TInt aType=1,TSize aBitmapSize=TSize(0,0),TDisplayMode aBitmapDspMode=ENone,TDisplayMode aMaskDspMode=ENone); |
|
48 ~CAknSvgFormatHandler(); |
|
49 |
|
50 public: // From MAknIconFormatHandler |
|
51 |
|
52 void SetScaleMode( TScaleMode aMode ); |
|
53 |
|
54 void SetRotation( TInt aAngle ); |
|
55 |
|
56 void GetContentDimensionsL( TAknContentDimensions& aContentDimensions ); |
|
57 |
|
58 void SetObserver( MAknIconChangeObserver *aObserver ); |
|
59 |
|
60 void SupportedDisplayMode( |
|
61 TDisplayMode& aMode, TDisplayMode aPreferredMode ); |
|
62 |
|
63 void PrepareIconL( const TDesC8& aIconData, TInt& aHandle ); |
|
64 |
|
65 void UsePreparedIconL( TInt aHandle ); |
|
66 |
|
67 void RenderPreparedIconL( |
|
68 CFbsBitmap* aBitmap, |
|
69 CFbsBitmap* aMask,TSize Bitmapsize=TSize(0,0),TDisplayMode Bitmapdepth=ENone,TDisplayMode Maskdepth=ENone, TRgb aColor = TRgb(0,0,0), TBool aMarginFlag = EFalse ); |
|
70 |
|
71 void UnprepareIcon( TInt aHandle ); |
|
72 |
|
73 void SetAnimated( TBool aAnimated ); |
|
74 |
|
75 TInt IconFormatType(); |
|
76 |
|
77 |
|
78 private: // From MSvgRequestObserver |
|
79 |
|
80 void UpdateScreen(); |
|
81 TBool ScriptCall( const TDesC& aScript,CSvgElementImpl* aCallerElement ); |
|
82 TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); |
|
83 void UpdatePresentation(const TInt32& aNoOfAnimation); |
|
84 TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); |
|
85 |
|
86 private: // New functions |
|
87 |
|
88 void InitializeEngineL(); |
|
89 void CheckHandleActivatedL( CFbsBitmap* aBitmap, CFbsBitmap* aMask ); |
|
90 |
|
91 static void LeaveIfErrorL( MSvgError* aError ); |
|
92 static TInt SvgErrorToSymbianError( const TSvgErrorCode aError ); |
|
93 |
|
94 static void CleanupNullMaskPointer( TAny* aParam ); |
|
95 |
|
96 void SetEngineScaleMode(); |
|
97 |
|
98 private: // Private constructors |
|
99 CAknSvgFormatHandler(TSize aBitmapSize,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode); |
|
100 void ConstructL(); |
|
101 |
|
102 private: // Data |
|
103 |
|
104 CSvgEngineInterfaceImpl* iSvgEngine; |
|
105 MAknIconChangeObserver* iObserver; |
|
106 CFbsBitmap* iDummyBitmap; // TODO: remove when can |
|
107 CFbsBitmap* iMask; // not owned |
|
108 TInt iMode; |
|
109 TInt iAngle; |
|
110 TBool iAnimated; |
|
111 TSize iBitmapSize; |
|
112 TDisplayMode iBitmapDspMode; |
|
113 TDisplayMode iMaskDspMode; |
|
114 |
|
115 TInt iHandle; |
|
116 |
|
117 enum |
|
118 { |
|
119 ENotActivated = 0, |
|
120 EActivated = 1, |
|
121 EActivatedWithFrameBuffer = 2 |
|
122 }; |
|
123 |
|
124 TInt iHandleActivationStatus; |
|
125 }; |
|
126 |
|
127 #endif // AKN_SVG_FORMAT_HANDLER_H |
|
128 |
|
129 // End of File |