|
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 // TSvgPointLexer: |
|
20 // Parse a text string and returns a set of coordinates and the last character |
|
21 // before the coordinates. e.g. " M100, 30.2" -> 'M', 100.0 and 30.2 |
|
22 // |
|
23 #ifndef __TSVGPOINTLEXER_H__ |
|
24 #define __TSVGPOINTLEXER_H__ |
|
25 |
|
26 #include <e32std.h> |
|
27 #include "GfxFloatFixPt.h" |
|
28 |
|
29 |
|
30 /** |
|
31 * Class description goes here. |
|
32 * |
|
33 * @lib SVGEngine.lib |
|
34 * @since 1.0 |
|
35 */ |
|
36 class TSvgPointLexer |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Need method description |
|
42 * |
|
43 * @since 1.0 |
|
44 * @param |
|
45 * @return |
|
46 */ |
|
47 TSvgPointLexer( const TDesC& aDes ); |
|
48 |
|
49 /** |
|
50 * Need method description |
|
51 * |
|
52 * @since 1.0 |
|
53 * @param |
|
54 * @return |
|
55 */ |
|
56 TInt32 GetNextPoint( TChar& aCommand, TFloatFixPt& aX, TFloatFixPt& aY ); |
|
57 |
|
58 /** |
|
59 * Need method description |
|
60 * |
|
61 * @since 1.0 |
|
62 * @param |
|
63 * @return |
|
64 */ |
|
65 TInt32 GetNext( TChar& aCommand, TFloatFixPt& aVal ); |
|
66 |
|
67 /** |
|
68 * Need method description |
|
69 * |
|
70 * @since 1.0 |
|
71 * @param |
|
72 * @return |
|
73 */ |
|
74 TBool GetNextWithNumOfPoints( TFloatFixPt *aVal, TInt NoOfPoints); |
|
75 /** |
|
76 * Need method description |
|
77 * |
|
78 * @since 1.0 |
|
79 * @param |
|
80 * @return |
|
81 */ |
|
82 TBool GetCommand(TUint8 &a); |
|
83 |
|
84 |
|
85 /** |
|
86 * Need method description |
|
87 * |
|
88 * @since 1.0 |
|
89 * @param |
|
90 * @return |
|
91 */ |
|
92 TBool IsDone() |
|
93 { |
|
94 // skip any space to see that this is the last character. ADDED BY RAVINDER |
|
95 iLex.SkipSpace(); |
|
96 // END OF ADDITION. |
|
97 return iLex.Eos(); |
|
98 }; |
|
99 |
|
100 void Cleanup(); |
|
101 private: |
|
102 TLex iLex; |
|
103 |
|
104 /** |
|
105 * Need method description |
|
106 * |
|
107 * @since 1.0 |
|
108 * @param |
|
109 * @return |
|
110 */ |
|
111 TChar SkipUntilNum(); |
|
112 |
|
113 /** |
|
114 * Need method description |
|
115 * |
|
116 * @since 1.0 |
|
117 * @param |
|
118 * @return |
|
119 */ |
|
120 TBool SkipToNumEndWithoutLex(TReal32 &aNum); |
|
121 |
|
122 /** |
|
123 * Need method description |
|
124 * |
|
125 * @since 1.0 |
|
126 * @param |
|
127 * @return |
|
128 */ |
|
129 TBool SkipToNumEnd(); |
|
130 /** |
|
131 * Need method description |
|
132 * |
|
133 * @since 1.0 |
|
134 * @param |
|
135 * @return |
|
136 */ |
|
137 TBool iNegativeNumber; |
|
138 TUint16 *iData; |
|
139 TUint16 *iDataEnd; |
|
140 |
|
141 HBufC* iDataCopy; |
|
142 }; |
|
143 |
|
144 #endif // __TSvgPointLexer_H__ |