|
1 /* |
|
2 * Copyright (c) 2003 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: SVG Implementation header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _INC_CSVGAELEMENTIMPL_ |
|
20 #define _INC_CSVGAELEMENTIMPL_ |
|
21 |
|
22 // |
|
23 #include "GfxFloatFixPt.h" |
|
24 #include "SVGElementImpl.h" |
|
25 #include "SVGListener.h" |
|
26 |
|
27 class CSvgDocumentImpl; |
|
28 |
|
29 /** |
|
30 * Class description goes here. |
|
31 * |
|
32 * @lib SVGEngine.lib |
|
33 * @since 1.0 |
|
34 */ |
|
35 class CSvgAElementImpl : public CSvgElementImpl, |
|
36 public MSvgMouseListener |
|
37 { |
|
38 public: |
|
39 |
|
40 // Constructor/deconstructor |
|
41 |
|
42 |
|
43 /** |
|
44 * Need method description |
|
45 * |
|
46 * @since 1.0 |
|
47 * @param |
|
48 * @return |
|
49 */ |
|
50 static CSvgAElementImpl*NewL( const TUint8 aElemID, |
|
51 CSvgDocumentImpl* aDoc ); |
|
52 |
|
53 |
|
54 /** |
|
55 * Need method description |
|
56 * |
|
57 * @since 1.0 |
|
58 * @param |
|
59 * @return |
|
60 */ |
|
61 static CSvgAElementImpl*NewLC( const TUint8 aElemID, |
|
62 CSvgDocumentImpl* aDoc ); |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 /** |
|
68 * Need method description |
|
69 * |
|
70 * @since 1.0 |
|
71 * @param |
|
72 * @return |
|
73 */ |
|
74 virtual ~CSvgAElementImpl(); |
|
75 |
|
76 private: |
|
77 |
|
78 |
|
79 /** |
|
80 * Need method description |
|
81 * |
|
82 * @since 1.0 |
|
83 * @param |
|
84 * @return |
|
85 */ |
|
86 void ConstructL( const TUint8 aElemID ); |
|
87 |
|
88 |
|
89 |
|
90 /** |
|
91 * Need method description |
|
92 * |
|
93 * @since 1.0 |
|
94 * @param |
|
95 * @return |
|
96 */ |
|
97 CSvgAElementImpl( CSvgDocumentImpl* aDoc ); |
|
98 |
|
99 public: |
|
100 |
|
101 // From MXmlElement API |
|
102 |
|
103 |
|
104 /** |
|
105 * Need method description |
|
106 * |
|
107 * @since 1.0 |
|
108 * @param |
|
109 * @return |
|
110 */ |
|
111 TInt SetAttributeL( const TDesC& aName, |
|
112 const TDesC& aValue ); |
|
113 |
|
114 TBool SetTargetL( const TDesC& aName, const TDesC& aValue ); |
|
115 |
|
116 const TDesC& Target(); |
|
117 |
|
118 void GetBBox( TGfxRectangle2D& aBbox ); |
|
119 void GetUnscaledBBox( TGfxRectangle2D& aBbox ); |
|
120 |
|
121 // From CSvgElementImpl |
|
122 |
|
123 |
|
124 /** |
|
125 * Need method description |
|
126 * |
|
127 * @since 1.0 |
|
128 * @param |
|
129 * @return |
|
130 */ |
|
131 MXmlElement* CloneL( MXmlElement* aParentElement); |
|
132 |
|
133 |
|
134 /** |
|
135 * Need method description |
|
136 * |
|
137 * @since 1.0 |
|
138 * @param |
|
139 * @return |
|
140 */ |
|
141 TBool DrawL( CGfx2dGc* aGc, |
|
142 CSvgElementImpl* aElement ); |
|
143 |
|
144 // From MEventReceiver |
|
145 |
|
146 /** |
|
147 * Need method description |
|
148 * |
|
149 * @since 1.0 |
|
150 * @param |
|
151 * @return |
|
152 */ |
|
153 TBool ReceiveEventL( MSvgEvent* aEvent ); |
|
154 void Reset(MSvgEvent* aEvent); |
|
155 TInt SetAttributeDesL( const TInt aNameId, |
|
156 const TDesC& aValue ); |
|
157 TInt GetAttributeDes( const TInt aNameId, TPtrC16& aValue ); |
|
158 |
|
159 /** |
|
160 * Return wether an svg element is displayable, such as <rect>, <circle>, or |
|
161 * an abstract element, such as <g>, <animate>. |
|
162 * |
|
163 * @since 1.0 |
|
164 * @param None |
|
165 * @return ETrue if element is viewable. |
|
166 */ |
|
167 TBool IsViewable() { return ETrue; } |
|
168 |
|
169 /** |
|
170 * Notified when the mouse pointer enters a visible svg element. |
|
171 * |
|
172 * @since 1.0 |
|
173 * param : aElements -- SVG elements containing the mouse point. |
|
174 * param : aX -- x coordinate of mouse pointer. |
|
175 * param : aY -- y coordinate of mouse pointer. |
|
176 * @return : For future use. Value is ignored. |
|
177 */ |
|
178 TBool MouseEntered( RPointerArray<CSvgElementImpl>& aElements, |
|
179 TInt aX, TInt aY ); |
|
180 |
|
181 /** |
|
182 * Notified when the mouse pointer exits a visible svg element. |
|
183 * |
|
184 * @since 1.0 |
|
185 * param : aElements -- SVG elements containing the mouse point. |
|
186 * param : aX -- x coordinate of mouse pointer. |
|
187 * param : aY -- y coordinate of mouse pointer. |
|
188 * @return : For future use. Value is ignored. |
|
189 */ |
|
190 TBool MouseExited( RPointerArray<CSvgElementImpl>& aElements, |
|
191 TInt aX, TInt aY ); |
|
192 |
|
193 /** |
|
194 * Notified when the mouse pointer is pressed down on visible svg element. |
|
195 * |
|
196 * @since 1.0 |
|
197 * param : aElements -- SVG elements containing the mouse point. |
|
198 * param : aX -- x coordinate of mouse pointer. |
|
199 * param : aY -- y coordinate of mouse pointer. |
|
200 * @return : For future use. Value is ignored. |
|
201 */ |
|
202 TBool MousePressed( RPointerArray<CSvgElementImpl>& aElements, |
|
203 TInt aX, TInt aY ); |
|
204 |
|
205 /** |
|
206 * Notified when the mouse pointer is released on on visible svg element. |
|
207 * |
|
208 * @since 1.0 |
|
209 * param : aElements -- SVG elements containing the mouse point. |
|
210 * param : aX -- x coordinate of mouse pointer. |
|
211 * param : aY -- y coordinate of mouse pointer. |
|
212 * @return : For future use. Value is ignored. |
|
213 */ |
|
214 TBool MouseReleased( RPointerArray<CSvgElementImpl>& aElements, |
|
215 TInt aX, TInt aY ); |
|
216 |
|
217 /** |
|
218 * Notified when the mouse pointer is released on on visible svg element. |
|
219 * |
|
220 * @since 1.0 |
|
221 * param : aElements -- SVG elements containing the mouse point. |
|
222 * param : aX -- x coordinate of mouse pointer. |
|
223 * param : aY -- y coordinate of mouse pointer. |
|
224 * @return : For future use. Value is ignored. |
|
225 */ |
|
226 TBool MouseMoved( RPointerArray<CSvgElementImpl>& aElements, |
|
227 TInt aX, TInt aY ); |
|
228 |
|
229 void Print( TBool aIsEncodeOn ); |
|
230 |
|
231 private: |
|
232 |
|
233 /** |
|
234 * Need method description |
|
235 * |
|
236 * @since 1.0 |
|
237 * @param |
|
238 * @return |
|
239 */ |
|
240 void AddEventReceiverSubtreeL( CSvgElementImpl* aElement ); |
|
241 |
|
242 /** |
|
243 * Need method description |
|
244 * |
|
245 * @since 1.0 |
|
246 * @param |
|
247 * @return |
|
248 */ |
|
249 TBool IsChild( CSvgElementImpl* aSubtree, |
|
250 CSvgElementImpl* aElement ); |
|
251 private: |
|
252 TBool iInitDone; |
|
253 HBufC* iTarget; |
|
254 }; |
|
255 |
|
256 #endif |