|
1 /* |
|
2 * Copyright (c) 2005-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: Render context interface |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MM2GRENDERCONTEXT_H |
|
19 #define MM2GRENDERCONTEXT_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <gdi.h> // TDisplayMode |
|
23 #include "M2GUtils.h" |
|
24 |
|
25 M2G_NS_START |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 // CLASS DECLARATION |
|
38 /** |
|
39 * Interface class |
|
40 */ |
|
41 class MM2GRenderContext |
|
42 { |
|
43 public: // STATIC CONSTANTS |
|
44 static const TReal32 KFullOpaque; |
|
45 static const TReal32 KFullTransparency; |
|
46 static const TUint8 KMaxAlphaValue; |
|
47 static const TDisplayMode KDefaultDisplayMode; |
|
48 static const TDisplayMode KMaskDisplayMode; |
|
49 |
|
50 public: // METHODS |
|
51 |
|
52 /** |
|
53 * Dtor |
|
54 */ |
|
55 virtual ~MM2GRenderContext() {}; |
|
56 |
|
57 /** |
|
58 * Binds device's bitmap. |
|
59 * @since Series S60 3.1 |
|
60 * @param aGraphicsHandle Target graphics handle |
|
61 * @throws exception if not ok |
|
62 */ |
|
63 virtual void BindL(TInt& aGraphicsHandle) = 0; |
|
64 |
|
65 /** |
|
66 * SVG image bitmap is (re)created if needed. |
|
67 * @since Series S60 3.1 |
|
68 * @see MM2GRenderContext::SetRefreshModeL() |
|
69 * @throws exception if not ok |
|
70 */ |
|
71 virtual void InitImageBitmapL() = 0; |
|
72 |
|
73 /** |
|
74 * Blits an svg and a device bitmaps |
|
75 * @since Series S60 3.1 |
|
76 * @throws M2G_OK if ok |
|
77 * @throws exception if not ok |
|
78 */ |
|
79 virtual void ReleaseL() = 0; |
|
80 |
|
81 /** |
|
82 * Renders a SVG document at a current time. |
|
83 * |
|
84 * <p> The rendering is done in 2 steps: |
|
85 * <li> render the document on an internal SVG buffer (iSvg) |
|
86 * <li> alpha-blend it with the bound graphics target (iGraphicsBitmap) |
|
87 * |
|
88 * @note if transparency factor is not set, iSvg is simply blitted onto iGraphicsTarget |
|
89 * |
|
90 * @param aSvgDocumentHandle handle to SVG document |
|
91 * @param aCurrentTime the current time of the animation |
|
92 * @param aSvgW Svg image viewport width |
|
93 * @param aSvgH Svg image viewport height |
|
94 * @param aRect contains position about the rendered area |
|
95 * @since S60 3.1 |
|
96 */ |
|
97 |
|
98 |
|
99 virtual void RenderLCDUIL( |
|
100 TM2GSvgDocumentHandle& aSvgDocHandle, |
|
101 const TReal32 aCurrentTime, |
|
102 TInt aSvgW, |
|
103 TInt aSvgH, |
|
104 TM2GRenderRect& aRect) = 0 ; |
|
105 |
|
106 virtual void RenderESWTL( |
|
107 TM2GSvgDocumentHandle& aSvgDocHandle, |
|
108 const TReal32 aCurrentTime, |
|
109 TInt aSvgW, |
|
110 TInt aSvgH, |
|
111 TM2GRenderRect& aRect, |
|
112 TBool aUseNativeClear, |
|
113 TInt* aReturnData) = 0; |
|
114 |
|
115 /** |
|
116 * Sets render quality |
|
117 * @since Series S60 3.1 |
|
118 * @param aMode Mode |
|
119 * @throws exception if not ok |
|
120 */ |
|
121 virtual void SetRenderingQualityL(TInt aMode) = 0; |
|
122 |
|
123 /** |
|
124 * Sets transparency |
|
125 * @since Series S60 3.1 |
|
126 * @param aAlpha Alpha factor |
|
127 * @throws exception if not ok |
|
128 */ |
|
129 virtual void SetTransparency(TReal32 aAlpha) = 0; |
|
130 |
|
131 }; |
|
132 |
|
133 M2G_NS_END |
|
134 #endif // MM2GRENDERCONTEXT_H |