|
1 /* |
|
2 * Copyright (c) 2007 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: xhtmlstack declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef XHTMLSTACK_H |
|
21 #define XHTMLSTACK_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <txtfrmat.h> |
|
25 |
|
26 /** |
|
27 * Class defining a style info. |
|
28 * |
|
29 * @code |
|
30 * ?good_class_usage_example(s) |
|
31 * @endcode |
|
32 * |
|
33 * @lib ?library |
|
34 * @since S60 v3.2 |
|
35 */ |
|
36 NONSHARABLE_CLASS( TXhtmlStyleInfo ) |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Constructor. |
|
42 * |
|
43 * @since S60 v3.2 |
|
44 * @param aStyleStart Start position of the style |
|
45 * @param aPrevAlign Previous alignment |
|
46 * @return ?description |
|
47 */ |
|
48 TXhtmlStyleInfo( TInt aStyleStart, CParaFormat::TAlignment aPrevAlign ); |
|
49 |
|
50 /** |
|
51 * Start position of the style |
|
52 */ |
|
53 TInt iStyleStart; |
|
54 |
|
55 /** |
|
56 * True if current style has been changed. |
|
57 * This is set to true in CXhtmlparser::ChangeCurrentStyleL |
|
58 */ |
|
59 TBool iStyleChanged; |
|
60 |
|
61 /** |
|
62 * True if alignment has been changed. |
|
63 */ |
|
64 TBool iAlignmentChanged; |
|
65 |
|
66 /** |
|
67 * Stores previous alignment. |
|
68 */ |
|
69 CParaFormat::TAlignment iPrevAlign; |
|
70 }; |
|
71 |
|
72 /** |
|
73 * Class defining a paragraph info. |
|
74 * |
|
75 * @code |
|
76 * ?good_class_usage_example(s) |
|
77 * @endcode |
|
78 * |
|
79 * @lib ?library |
|
80 * @since S60 v3.2 |
|
81 */ |
|
82 NONSHARABLE_CLASS( TXhtmlParaInfo ) |
|
83 { |
|
84 public: |
|
85 |
|
86 /** |
|
87 * Constructor. |
|
88 * |
|
89 * @since S60 v3.2 |
|
90 * @param aParaStart Start position of the paragraph |
|
91 * @param aAlignment Alignment |
|
92 * @return ?description |
|
93 */ |
|
94 TXhtmlParaInfo( TInt aParaStart, CParaFormat::TAlignment aAlignment ); |
|
95 |
|
96 /** |
|
97 * Start position of the paragraph |
|
98 */ |
|
99 TInt iParaStart; |
|
100 |
|
101 /** |
|
102 * Alignment |
|
103 */ |
|
104 CParaFormat::TAlignment iAlignment; |
|
105 }; |
|
106 |
|
107 /** |
|
108 * Class defining a list info. |
|
109 * |
|
110 * @code |
|
111 * ?good_class_usage_example(s) |
|
112 * @endcode |
|
113 * |
|
114 * @lib ?library |
|
115 * @since S60 v3.2 |
|
116 */ |
|
117 NONSHARABLE_CLASS( TXhtmlListInfo ) |
|
118 { |
|
119 public: |
|
120 |
|
121 /** |
|
122 * Constructor. |
|
123 * |
|
124 * @since S60 v3.2 |
|
125 * @param aListContext List context, ordered or unordered |
|
126 * @return ?description |
|
127 */ |
|
128 TXhtmlListInfo( TInt aListContext ); |
|
129 |
|
130 /** |
|
131 * List index, tells the number of list items in current list |
|
132 */ |
|
133 TInt iListIndex; |
|
134 |
|
135 /** |
|
136 * List context, ordered or unordered |
|
137 */ |
|
138 TInt iListContext; |
|
139 }; |
|
140 |
|
141 |
|
142 /** |
|
143 * Class defining a stack. Methods implemented in XhtmlStack.inl. |
|
144 * |
|
145 * @code |
|
146 * ?good_class_usage_example(s) |
|
147 * @endcode |
|
148 * |
|
149 * @lib ?library |
|
150 * @since S60 v3.2 |
|
151 */ |
|
152 template <typename T> |
|
153 NONSHARABLE_CLASS( CXhtmlStack ) : public CBase |
|
154 { |
|
155 public: |
|
156 |
|
157 /** |
|
158 * CXhtmlStack phase one constructor |
|
159 * |
|
160 * @since S60 v3.2 |
|
161 * @return Created CXhtmlStack instance |
|
162 */ |
|
163 static inline CXhtmlStack* NewL(); |
|
164 |
|
165 /** |
|
166 * Destructor. |
|
167 */ |
|
168 virtual inline ~CXhtmlStack(); |
|
169 |
|
170 /** |
|
171 * Removes item from top of the stack. |
|
172 * |
|
173 * @since S60 v3.2 |
|
174 */ |
|
175 inline void Pop(); |
|
176 |
|
177 /** |
|
178 * Adds item to top of the stack. |
|
179 * |
|
180 * @since S60 v3.2 |
|
181 * @param aInfo Pointer to item |
|
182 */ |
|
183 inline void PushL( T* aInfo ); |
|
184 |
|
185 /** |
|
186 * Returns item on top of the stack. |
|
187 * |
|
188 * @since S60 v3.2 |
|
189 * @return Pointer to item |
|
190 */ |
|
191 inline T* Top(); |
|
192 |
|
193 /** |
|
194 * Returns number of items on the stack. |
|
195 * |
|
196 * @since S60 v3.2 |
|
197 * @return Number of items |
|
198 */ |
|
199 inline TInt Count() { return iStack->Count(); }; |
|
200 |
|
201 protected: |
|
202 void ConstructL(); |
|
203 CXhtmlStack(); |
|
204 |
|
205 private: |
|
206 /** |
|
207 * Array of pointers to stack items. |
|
208 * Owns |
|
209 */ |
|
210 RPointerArray<T>* iStack; |
|
211 }; |
|
212 |
|
213 |
|
214 #include "xhtmlstack.inl" |
|
215 |
|
216 #endif |
|
217 |