|
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 Engine header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __INC_SVGEVENT_H__ |
|
20 #define __INC_SVGEVENT_H__ |
|
21 |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 |
|
26 #include "GfxFloatFixPt.h" |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 //******************************************************* |
|
32 // constants |
|
33 const TUint8 KSvgEventMaskNone = 0x0; |
|
34 const TUint8 KSvgEventMaskExternalUI = 0x1; |
|
35 const TUint8 KSvgEventMaskTimer = 0x2; |
|
36 const TUint8 KSvgEventMaskInternal = 0x4; |
|
37 const TUint8 KSvgEventMaskExternalSystem = 0x8; |
|
38 |
|
39 enum TSvgEngineEventType |
|
40 { |
|
41 ESvgEngineEventTimerPrep, |
|
42 ESvgEngineEventTimer, |
|
43 ESvgEngineInternalEvent, |
|
44 |
|
45 ESvgEngineEventMouseDown, |
|
46 ESvgEngineEventMouseUp, |
|
47 ESvgEngineEventMouseMove, |
|
48 ESvgEngineEventKeyPress, |
|
49 ESvgEngineEventScreenUpdate |
|
50 }; |
|
51 |
|
52 enum TSvgEvent |
|
53 { |
|
54 // 26 events defined in SVG spec |
|
55 ESvgEventFocusin = 0, |
|
56 ESvgEventFocusout = 1, |
|
57 ESvgEventActivate = 2, |
|
58 ESvgEventClick = 3, |
|
59 ESvgEventMousedown = 4, |
|
60 ESvgEventMouseup = 5, |
|
61 ESvgEventMouseover = 6, |
|
62 ESvgEventMousemove = 7, |
|
63 ESvgEventMouseout = 8, |
|
64 ESvgEventDOMSubtreeModified = 9, |
|
65 ESvgEventDOMNodeInserted = 10, |
|
66 ESvgEventDOMNodeRemoved = 11, |
|
67 ESvgEventDOMNodeRemovedFromDocument = 12, |
|
68 ESvgEventDOMNodeInsertedIntoDocument = 13, |
|
69 ESvgEventDOMAttrModified = 14, |
|
70 ESvgEventDOMCharacterDataModified = 15, |
|
71 ESvgEventSVGLoad = 16, |
|
72 ESvgEventSVGUnload = 17, |
|
73 ESvgEventSVGAbort = 18, |
|
74 ESvgEventSVGError = 19, |
|
75 ESvgEventSVGResize = 20, |
|
76 ESvgEventSVGScroll = 21, |
|
77 ESvgEventSVGZoom = 22, |
|
78 ESvgEventBeginEvent = 23, |
|
79 ESvgEventEndEvent = 24, |
|
80 ESvgEventRepeatEvent = 25, |
|
81 |
|
82 // Extension for implementation |
|
83 ESvgEventKey = 100, |
|
84 ESvgEventWallClock = 101, |
|
85 ESvgEventNone = -1 |
|
86 }; |
|
87 |
|
88 class CSvgElementImpl; |
|
89 |
|
90 class MSvgEvent |
|
91 { |
|
92 public: |
|
93 /** |
|
94 * Accessor that returns the event mask |
|
95 * |
|
96 * @since 1.0 |
|
97 * @param None |
|
98 * @return An integer that is the event mask |
|
99 */ |
|
100 virtual TUint8 EventMask() = 0; |
|
101 |
|
102 /** |
|
103 * Accessor for the event type |
|
104 * |
|
105 * @since 1.0 |
|
106 * @param None |
|
107 * @return A TSvgEngineEventType that is the event type |
|
108 */ |
|
109 virtual TSvgEngineEventType EventType() = 0; |
|
110 }; |
|
111 |
|
112 |
|
113 /** |
|
114 * Class description goes here. |
|
115 * |
|
116 * @lib SVGEngine.lib |
|
117 * @since 1.0 |
|
118 */ |
|
119 class MSvgTimerEvent : public MSvgEvent |
|
120 { |
|
121 public: |
|
122 |
|
123 /** |
|
124 * Accessor that returns the time of the event |
|
125 * |
|
126 * @since 1.0 |
|
127 * @param None |
|
128 * @return An integer that is the time of the event |
|
129 */ |
|
130 virtual TUint32 Time() = 0; |
|
131 |
|
132 /** |
|
133 * Accessor that returns the begin time of the event |
|
134 * |
|
135 * @since 1.0 |
|
136 * @param None |
|
137 * @return An integer that is the begin time of the event |
|
138 */ |
|
139 virtual TInt32 BeginTime() = 0; |
|
140 |
|
141 /** |
|
142 * Accessor that sets time of the event |
|
143 * |
|
144 * @since 1.0 |
|
145 * @param TInt32 An integer that is the begin time of the event |
|
146 * @return none |
|
147 */ |
|
148 virtual void SetTime(TInt32 aTime) = 0; |
|
149 |
|
150 /** |
|
151 * Accessor that sets the begin time of the event |
|
152 * |
|
153 * @since 1.0 |
|
154 * @param aTime - An integer that is the begin time |
|
155 * @return None |
|
156 */ |
|
157 virtual void SetBeginTime( TInt32 aTime ) = 0; |
|
158 |
|
159 }; |
|
160 |
|
161 // An internal event specialization |
|
162 class MSvgInternalEvent : public MSvgEvent |
|
163 { |
|
164 public: |
|
165 |
|
166 virtual TBool UserSeek() = 0; |
|
167 /** |
|
168 * Return a pointer the element that is the target for the event |
|
169 * |
|
170 * @since 1.0 |
|
171 * @param None |
|
172 * @return A pointer to the target element |
|
173 */ |
|
174 virtual CSvgElementImpl* ObjectAddress() = 0; |
|
175 |
|
176 /** |
|
177 * Return the event description |
|
178 * |
|
179 * @since 1.0 |
|
180 * @param None |
|
181 * @return A TSvgEvent type |
|
182 */ |
|
183 virtual TSvgEvent SvgEvent() = 0; |
|
184 |
|
185 /** |
|
186 * Accessor that returns the time of the event |
|
187 * |
|
188 * @since 1.0 |
|
189 * @param None |
|
190 * @return An integer that is the time of the event |
|
191 */ |
|
192 virtual TInt32 Time() = 0; |
|
193 |
|
194 /** |
|
195 * Accessor that sets the time of the event |
|
196 * |
|
197 * @since 1.0 |
|
198 * @param aTime - An integer that is the time of the event |
|
199 * @return |
|
200 */ |
|
201 virtual void SetTime( TInt32 aTime ) = 0; |
|
202 |
|
203 /** |
|
204 * Accessor that returns the begin time of the event |
|
205 * |
|
206 * @since 1.0 |
|
207 * @param None |
|
208 * @return An integer that is the begin time of the event |
|
209 */ |
|
210 virtual TInt32 BeginTime() = 0; |
|
211 |
|
212 /** |
|
213 * Accessor that sets the begin time of the event |
|
214 * |
|
215 * @since 1.0 |
|
216 * @param aTime - An integer that is the begin time |
|
217 * @return None |
|
218 */ |
|
219 virtual void SetBeginTime( TInt32 aTime ) = 0; |
|
220 |
|
221 }; |
|
222 |
|
223 // A UI Mouse event specialization |
|
224 class MSvgUiMouseEvent : public MSvgEvent |
|
225 { |
|
226 public: |
|
227 |
|
228 /** |
|
229 * Accessor for the x coordinate of the mouse event |
|
230 * |
|
231 * @since 1.0 |
|
232 * @param None |
|
233 * @return A fixed point that is the x coordinate of the event |
|
234 */ |
|
235 virtual TFloatFixPt X() = 0; |
|
236 |
|
237 /** |
|
238 * Accessor for the y coordinate of the mouse event |
|
239 * |
|
240 * @since 1.0 |
|
241 * @param None |
|
242 * @return A fixed point that is the y coordinate of the event |
|
243 */ |
|
244 virtual TFloatFixPt Y() = 0; |
|
245 }; |
|
246 |
|
247 // A UI Key event specialization |
|
248 class MSvgUiKeyEvent : public MSvgEvent |
|
249 { |
|
250 public: |
|
251 |
|
252 /** |
|
253 * Accessor that returns the key code of the event |
|
254 * |
|
255 * @since 1.0 |
|
256 * @param |
|
257 * @return |
|
258 */ |
|
259 virtual TUint32 KeyCode() = 0; |
|
260 |
|
261 /** |
|
262 * Accessor that returns the time of the event |
|
263 * |
|
264 * @since 1.0 |
|
265 * @param None |
|
266 * @return An integer that is the time of the event |
|
267 */ |
|
268 virtual TInt32 Time() = 0; |
|
269 |
|
270 /** |
|
271 * Accessor that sets the time of the event |
|
272 * |
|
273 * @since 1.0 |
|
274 * @param aTime - An integer that is the time of the event |
|
275 * @return |
|
276 */ |
|
277 virtual void SetTime( TInt32 aTime ) = 0; |
|
278 |
|
279 /** |
|
280 * Accessor that returns the begin time of the event |
|
281 * |
|
282 * @since 1.0 |
|
283 * @param None |
|
284 * @return An integer that is the begin time of the event |
|
285 */ |
|
286 virtual TInt32 BeginTime() = 0; |
|
287 |
|
288 /** |
|
289 * Accessor that sets the begin time of the event |
|
290 * |
|
291 * @since 1.0 |
|
292 * @param aTime - An integer that is the begin time |
|
293 * @return None |
|
294 */ |
|
295 virtual void SetBeginTime( TInt32 aTime ) = 0; |
|
296 |
|
297 }; |
|
298 |
|
299 |
|
300 //******************************************************* |
|
301 |
|
302 class TSvgUiMouseEvent : public MSvgUiMouseEvent |
|
303 { |
|
304 public: |
|
305 |
|
306 /** |
|
307 * Constructor |
|
308 * |
|
309 * @since 1.0 |
|
310 * @param aEtype - A TSvgEngineEventType representing the event type |
|
311 * @param aX - x coordinate of the event |
|
312 * @param aY - y coordinate of the event |
|
313 * @return |
|
314 */ |
|
315 TSvgUiMouseEvent( TSvgEngineEventType aEtype, TFloatFixPt aX, TFloatFixPt aY ); |
|
316 |
|
317 /** |
|
318 * Accessor that returns the event mask |
|
319 * |
|
320 * @since 1.0 |
|
321 * @param None |
|
322 * @return An integer that is the event mask |
|
323 */ |
|
324 TUint8 EventMask(); |
|
325 |
|
326 /** |
|
327 * Accessor for the event type |
|
328 * |
|
329 * @since 1.0 |
|
330 * @param None |
|
331 * @return A TSvgEngineEventType that is the event type |
|
332 */ |
|
333 TSvgEngineEventType EventType(); |
|
334 |
|
335 /** |
|
336 * Accessor for the x coordinate of the mouse event |
|
337 * |
|
338 * @since 1.0 |
|
339 * @param None |
|
340 * @return A fixed point that is the x coordinate of he event |
|
341 */ |
|
342 TFloatFixPt X(); |
|
343 |
|
344 /** |
|
345 * Accessor for the y coordinate of the mouse event |
|
346 * |
|
347 * @since 1.0 |
|
348 * @param None |
|
349 * @return A fixed point that is the y coordinate of the event |
|
350 */ |
|
351 TFloatFixPt Y(); |
|
352 |
|
353 public: |
|
354 TSvgEngineEventType iEtype; |
|
355 TFloatFixPt iX; |
|
356 TFloatFixPt iY; |
|
357 }; |
|
358 |
|
359 class TSvgUiKeyEvent : public MSvgUiKeyEvent |
|
360 { |
|
361 public: |
|
362 |
|
363 /** |
|
364 * Accessor that returns the key code of the event |
|
365 * |
|
366 * @since 1.0 |
|
367 * @param |
|
368 * @return |
|
369 */ |
|
370 TSvgUiKeyEvent( TUint32 aKeyCode ); |
|
371 |
|
372 /** |
|
373 * Accessor that returns the event mask |
|
374 * |
|
375 * @since 1.0 |
|
376 * @param None |
|
377 * @return An integer that is the event mask |
|
378 */ |
|
379 TUint8 EventMask(); |
|
380 |
|
381 /** |
|
382 * Accessor for the event type |
|
383 * |
|
384 * @since 1.0 |
|
385 * @param None |
|
386 * @return A TSvgEngineEventType that is the event type |
|
387 */ |
|
388 TSvgEngineEventType EventType(); |
|
389 |
|
390 /** |
|
391 * Accessor that returns the key code of the event |
|
392 * |
|
393 * @since 1.0 |
|
394 * @param |
|
395 * @return |
|
396 */ |
|
397 TUint32 KeyCode(); |
|
398 |
|
399 /** |
|
400 * Accessor that returns the time of the event |
|
401 * |
|
402 * @since 1.0 |
|
403 * @param None |
|
404 * @return An integer that is the time of the event |
|
405 */ |
|
406 TInt32 Time(); |
|
407 |
|
408 /** |
|
409 * Accessor that sets the time of the event |
|
410 * |
|
411 * @since 1.0 |
|
412 * @param aTime - An integer that is the time of the event |
|
413 * @return None |
|
414 */ |
|
415 void SetTime( TInt32 aTime ); |
|
416 |
|
417 /** |
|
418 * Accessor that returns the begin time of the event |
|
419 * |
|
420 * @since 1.0 |
|
421 * @param None |
|
422 * @return An integer that is the begin time of the event |
|
423 */ |
|
424 TInt32 BeginTime(); |
|
425 |
|
426 /** |
|
427 * Accessor that sets the begin time of the event |
|
428 * |
|
429 * @since 1.0 |
|
430 * @param aTime - An integer that is the begin time |
|
431 * @return None |
|
432 */ |
|
433 void SetBeginTime( TInt32 aTime ); |
|
434 |
|
435 private: |
|
436 TUint32 iKeyCode; |
|
437 TInt32 iTime; |
|
438 TInt32 iBeginTime; |
|
439 }; |
|
440 |
|
441 |
|
442 // |
|
443 class TSvgTimerEventPrep : public MSvgTimerEvent |
|
444 { |
|
445 public: |
|
446 |
|
447 /** |
|
448 * Constructor |
|
449 * |
|
450 * @since 1.0 |
|
451 * @param aTime - An integer that is the event time |
|
452 * @return None |
|
453 */ |
|
454 TSvgTimerEventPrep( TUint32 aTime ); |
|
455 |
|
456 /** |
|
457 * Accessor that returns the event mask |
|
458 * |
|
459 * @since 1.0 |
|
460 * @param None |
|
461 * @return An integer that is the event mask |
|
462 */ |
|
463 TUint8 EventMask(); |
|
464 |
|
465 /** |
|
466 * Accessor for the event type |
|
467 * |
|
468 * @since 1.0 |
|
469 * @param None |
|
470 * @return A TSvgEngineEventType that is the event type |
|
471 */ |
|
472 TSvgEngineEventType EventType(); |
|
473 |
|
474 /** |
|
475 * Accessor that returns the time of the event |
|
476 * |
|
477 * @since 1.0 |
|
478 * @param None |
|
479 * @return An integer that is the time of the event |
|
480 */ |
|
481 TUint32 Time(); |
|
482 |
|
483 private: |
|
484 TInt32 iTime; |
|
485 }; |
|
486 |
|
487 class TSvgTimerEvent : public MSvgTimerEvent |
|
488 { |
|
489 public: |
|
490 |
|
491 /** |
|
492 * Constructor |
|
493 * |
|
494 * @since 1.0 |
|
495 * @param aTime - An integer that is the time of the event |
|
496 * @return None |
|
497 */ |
|
498 TSvgTimerEvent( TUint32 aTime ); |
|
499 |
|
500 /** |
|
501 * Accessor that returns the event mask |
|
502 * |
|
503 * @since 1.0 |
|
504 * @param None |
|
505 * @return An integer that is the event mask |
|
506 */ |
|
507 TUint8 EventMask(); |
|
508 |
|
509 /** |
|
510 * Accessor for the event type |
|
511 * |
|
512 * @since 1.0 |
|
513 * @param None |
|
514 * @return A TSvgEngineEventType that is the event type |
|
515 */ |
|
516 TSvgEngineEventType EventType(); |
|
517 |
|
518 /** |
|
519 * Accessor that returns the time of the event |
|
520 * |
|
521 * @since 1.0 |
|
522 * @param None |
|
523 * @return An integer that is the time of the event |
|
524 */ |
|
525 TUint32 Time(); |
|
526 |
|
527 /** |
|
528 * Accessor that sets time of the event |
|
529 * |
|
530 * @since 1.0 |
|
531 * @param TInt32 An integer that is the begin time of the event |
|
532 * @return none |
|
533 */ |
|
534 void SetTime(TInt32 aTime); |
|
535 |
|
536 |
|
537 /** |
|
538 * Accessor that returns the begin time of the event |
|
539 * |
|
540 * @since 1.0 |
|
541 * @param None |
|
542 * @return An integer that is the begin time of the event |
|
543 */ |
|
544 TInt32 BeginTime(); |
|
545 |
|
546 /** |
|
547 * Accessor that sets the begin time of the event |
|
548 * |
|
549 * @since 1.0 |
|
550 * @param aTime - An integer that is the begin time |
|
551 * @return None |
|
552 */ |
|
553 void SetBeginTime( TInt32 aTime ); |
|
554 |
|
555 private: |
|
556 TInt32 iTime; |
|
557 TInt32 iBeginTime; |
|
558 }; |
|
559 |
|
560 class TSvgInternalEvent : public MSvgInternalEvent |
|
561 { |
|
562 public: |
|
563 |
|
564 /** |
|
565 * Constructor |
|
566 * |
|
567 * @since 1.0 |
|
568 * @param aEvent - A TSvgEvent type |
|
569 * @param aElement - A pointer to the target element |
|
570 * @return None |
|
571 */ |
|
572 TSvgInternalEvent( TSvgEvent aEvent, CSvgElementImpl* aElement ); |
|
573 |
|
574 TSvgInternalEvent( TSvgEvent aEvent, CSvgElementImpl* aElement, TInt32 aTime ); |
|
575 |
|
576 TBool UserSeek(); |
|
577 /** |
|
578 * Accessor that returns the event mask |
|
579 * |
|
580 * @since 1.0 |
|
581 * @param None |
|
582 * @return An integer that is the event mask |
|
583 */ |
|
584 TUint8 EventMask(); |
|
585 |
|
586 /** |
|
587 * Accessor for the event type |
|
588 * |
|
589 * @since 1.0 |
|
590 * @param None |
|
591 * @return A TSvgEngineEventType that is the event type |
|
592 */ |
|
593 TSvgEngineEventType EventType(); |
|
594 |
|
595 /** |
|
596 * Return a pointer the element that is the target for the event |
|
597 * |
|
598 * @since 1.0 |
|
599 * @param None |
|
600 * @return A pointer to the target element |
|
601 */ |
|
602 CSvgElementImpl* ObjectAddress(); |
|
603 |
|
604 /** |
|
605 * Return the event description |
|
606 * |
|
607 * @since 1.0 |
|
608 * @param None |
|
609 * @return A TSvgEvent type |
|
610 */ |
|
611 TSvgEvent SvgEvent(); |
|
612 |
|
613 /** |
|
614 * Accessor that returns the time of the event |
|
615 * |
|
616 * @since 1.0 |
|
617 * @param None |
|
618 * @return An integer that is the time of the event |
|
619 */ |
|
620 TInt32 Time(); |
|
621 |
|
622 /** |
|
623 * Accessor that sets the time of the event |
|
624 * |
|
625 * @since 1.0 |
|
626 * @param aTime - An integer that is the time of the event |
|
627 * @return |
|
628 */ |
|
629 void SetTime( TInt32 aTime ); |
|
630 |
|
631 /** |
|
632 * Accessor that returns the begin time of the event |
|
633 * |
|
634 * @since 1.0 |
|
635 * @param None |
|
636 * @return An integer that is the begin time of the event |
|
637 */ |
|
638 TInt32 BeginTime(); |
|
639 |
|
640 /** |
|
641 * Accessor that sets the begin time of the event |
|
642 * |
|
643 * @since 1.0 |
|
644 * @param aTime - An integer that is the begin time |
|
645 * @return None |
|
646 */ |
|
647 void SetBeginTime( TInt32 aTime ); |
|
648 |
|
649 private: |
|
650 TSvgEvent iEvent; |
|
651 TBool iRepeatOnBegin; |
|
652 CSvgElementImpl*iElement; |
|
653 TInt32 iTime; |
|
654 TInt32 iBeginTime; |
|
655 TBool IsUserSeek; |
|
656 }; |
|
657 |
|
658 class TSvgScreenUpdateEvent : public MSvgEvent |
|
659 { |
|
660 public: |
|
661 /** |
|
662 * Accessor that returns the event mask |
|
663 * |
|
664 * @since 1.0 |
|
665 * @param None |
|
666 * @return An integer that is the event mask |
|
667 */ |
|
668 TUint8 EventMask(); |
|
669 |
|
670 /** |
|
671 * Accessor for the event type |
|
672 * |
|
673 * @since 1.0 |
|
674 * @param None |
|
675 * @return A TSvgEngineEventType that is the event type |
|
676 */ |
|
677 TSvgEngineEventType EventType(); |
|
678 }; |
|
679 |
|
680 |
|
681 #endif /* __INC_SvgEvent_H__ */ |