|
1 /* |
|
2 * Copyright (c) 2000 - 2001 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 the License "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BOX_FORMATTER_H |
|
20 #define BOX_FORMATTER_H |
|
21 |
|
22 #include <e32def.h> // To avoid NULL redefine warning (no #ifndef NULL) |
|
23 |
|
24 |
|
25 //#include "nw_lmgr_posflowbox.h" |
|
26 #include "nw_lmgr_flowbox.h" |
|
27 #include "nw_lmgr_formatcontext.h" |
|
28 #include "nw_fbox_inputbox.h" |
|
29 #include "nw_lmgr_splittextbox.h" |
|
30 #include "nw_lmgr_textbox.h" |
|
31 #include "nw_lmgr_rootbox.h" |
|
32 #include "nw_text_ucs2.h" |
|
33 #include "nw_lmgr_activecontainerbox.h" |
|
34 #include "nw_lmgr_animatedimagebox.h" |
|
35 #include "nw_lmgr_imgcontainerbox.h" |
|
36 #include "nw_lmgr_marqueebox.h" |
|
37 #include "nwx_settings.h" |
|
38 #include "BrsrStatusCodes.h" |
|
39 #include "nw_lmgr_emptybox.h" |
|
40 #include "nw_lmgr_rulebox.h" |
|
41 #include "nw_lmgr_breakbox.h" |
|
42 #include "nw_lmgr_statictablebox.h" |
|
43 #include "nw_lmgr_statictablerowbox.h" |
|
44 #include "nw_lmgr_statictablecellbox.h" |
|
45 #include "nw_lmgr_cssproperties.h" |
|
46 #include "nw_lmgr_listbullets.h" |
|
47 #include "nw_image_virtualimage.h" |
|
48 #include "nw_image_cannedimages.h" |
|
49 #include "nw_fbox_formbox.h" |
|
50 #include "nwx_string.h" |
|
51 #include "nw_lmgr_imgcontainerbox.h" |
|
52 #include "LMgrObjectBoxOOC.h" |
|
53 #include "nwx_settings.h" |
|
54 |
|
55 #include "BrsrStatusCodes.h" |
|
56 |
|
57 #ifdef __cplusplus |
|
58 extern "C" |
|
59 { |
|
60 #endif /* __cplusplus */ |
|
61 |
|
62 |
|
63 void PartialFormatL(NW_LMgr_Box_t* aFormatBox, TBool aDocumentComplete); |
|
64 void FormatL(NW_LMgr_Box_t* aFormatBox, |
|
65 NW_LMgr_ContainerBox_t *containerBox, |
|
66 NW_LMgr_FormatContext_t* aContext); |
|
67 |
|
68 |
|
69 class TLMgr_BoxFormatter |
|
70 { |
|
71 public: |
|
72 // check if they have to be virtual functions |
|
73 |
|
74 TBrowserStatusCode |
|
75 NW_LMgr_BidiFlowBox_PostFormat(NW_LMgr_Box_t* flow, |
|
76 NW_LMgr_ContainerBox_t *whose, |
|
77 NW_LMgr_FormatContext_t* parentContext); |
|
78 |
|
79 virtual TBrowserStatusCode |
|
80 NW_LMgr_FlowBox_PostFormatBox(NW_LMgr_Box_t* parentFormatBox, |
|
81 NW_LMgr_Box_t* box, |
|
82 NW_LMgr_FormatContext_t* parentContext); |
|
83 |
|
84 virtual TBrowserStatusCode NW_LMgr_FlowBox_FormatBox(NW_LMgr_Box_t* parentFormatBox, |
|
85 NW_LMgr_Box_t* box, |
|
86 NW_LMgr_FormatContext_t* parentContext); |
|
87 // virtual function |
|
88 virtual TBrowserStatusCode |
|
89 NW_LMgr_BidiFlowBox_FlowInline(NW_LMgr_Box_t* flow, |
|
90 NW_LMgr_Box_t* box, |
|
91 NW_LMgr_FormatContext_t* parentContext) ; |
|
92 // virtual function |
|
93 virtual TBrowserStatusCode |
|
94 NW_LMgr_BidiFlowBox_PostFlowInline(NW_LMgr_Box_t* flow, |
|
95 NW_LMgr_Box_t* box, |
|
96 NW_LMgr_FormatContext_t* parentContext); |
|
97 // virtual function |
|
98 virtual TBrowserStatusCode |
|
99 NW_LMgr_BidiFlowBox_FlowBlock(NW_LMgr_Box_t* flow, |
|
100 NW_LMgr_Box_t* box, |
|
101 NW_LMgr_FormatContext_t* parentContext); |
|
102 |
|
103 //virtual function |
|
104 virtual TBrowserStatusCode |
|
105 NW_LMgr_BidiFlowBox_PostFlowBlock(NW_LMgr_Box_t* flow, |
|
106 NW_LMgr_Box_t* box, |
|
107 NW_LMgr_FormatContext_t* parentContext); |
|
108 |
|
109 // virtual function |
|
110 virtual TBrowserStatusCode |
|
111 NW_LMgr_BidiFlowBox_PostFlowFloat(NW_LMgr_Box_t* flow, |
|
112 NW_LMgr_Box_t* box, |
|
113 NW_LMgr_FormatContext_t* parentContext); |
|
114 |
|
115 // virtual function |
|
116 virtual TBrowserStatusCode |
|
117 NW_LMgr_BidiFlowBox_Float(NW_LMgr_Box_t* flow, |
|
118 NW_LMgr_Box_t* box, |
|
119 NW_LMgr_FormatContext_t* parentContext); |
|
120 |
|
121 // virtual function |
|
122 virtual TBrowserStatusCode |
|
123 NW_LMgr_BidiFlowBox_NewLine(NW_LMgr_Box_t* flow, |
|
124 NW_LMgr_FormatContext_t* context, |
|
125 NW_GDI_Metric_t delta, |
|
126 NW_Bool indentNewLine); |
|
127 |
|
128 virtual TBrowserStatusCode |
|
129 NW_LMgr_BidiFlowBox_ListItem(NW_LMgr_Box_t* flow, |
|
130 NW_LMgr_Box_t* item, |
|
131 NW_LMgr_FormatContext_t* context); |
|
132 |
|
133 virtual TBrowserStatusCode |
|
134 NW_LMgr_BidiFlowBox_DirectKey(NW_LMgr_Box_t* flow, |
|
135 NW_LMgr_Box_t* item, |
|
136 NW_LMgr_FormatContext_t* context); |
|
137 |
|
138 // public function |
|
139 TBrowserStatusCode |
|
140 NW_LMgr_BidiFlowBox_Flush(NW_LMgr_Box_t* flow, |
|
141 NW_LMgr_FormatContext_t* parentContext, NW_Bool addLineSpacing); |
|
142 TBrowserStatusCode |
|
143 NW_LMgr_BidiFlowBox_AdvanceToClear(NW_LMgr_Box_t* flow, |
|
144 NW_LMgr_FormatContext_t* parentContext, |
|
145 NW_LMgr_PropertyValueToken_t clearToken); |
|
146 |
|
147 TBrowserStatusCode |
|
148 NW_LMgr_BidiFlowBox_AdvanceToClearReformat(NW_LMgr_Box_t* flow, |
|
149 NW_LMgr_FormatContext_t* parentContext, |
|
150 NW_LMgr_PropertyValueToken_t clearToken); |
|
151 |
|
152 NW_GDI_Metric_t |
|
153 NW_LMgr_FlowBox_GetIndentation(NW_LMgr_Box_t* flow, |
|
154 NW_LMgr_FormatContext_t* parentContext); |
|
155 TBrowserStatusCode |
|
156 NW_LMgr_BidiFlowBox_FlushInlineContainers(NW_LMgr_Box_t* flow, |
|
157 NW_LMgr_FormatContext_t* parentContext); |
|
158 |
|
159 TBrowserStatusCode |
|
160 NW_LMgr_BidiFlowBox_ReformatLine(NW_LMgr_Box_t* flow, |
|
161 NW_LMgr_FormatContext_t* parentContext); |
|
162 |
|
163 NW_LMgr_Box_t* |
|
164 NW_LMgr_BidiFlowBox_GetFirstBlock(NW_LMgr_Box_t* flow); |
|
165 |
|
166 NW_LMgr_Box_t* |
|
167 NW_LMgr_BidiFlowBox_GetLastBlock(NW_LMgr_Box_t* flow); |
|
168 |
|
169 NW_Bool IsClosedTop(NW_LMgr_Box_t *box); |
|
170 |
|
171 NW_Bool IsClosedBottom(NW_LMgr_Box_t *box); |
|
172 |
|
173 TBrowserStatusCode NW_LMgr_BidiFlowBox_CollapseMargins(NW_LMgr_Box_t* flow, |
|
174 NW_LMgr_Box_t* box, NW_LMgr_FormatContext_t* parentContext, NW_ADT_Vector_Metric_t index); |
|
175 |
|
176 NW_GDI_Metric_t NW_LMgr_FlowBox_GetLineStart(NW_LMgr_Box_t* flow, |
|
177 NW_LMgr_FormatContext_t* parentContext, |
|
178 NW_GDI_Metric_t where); |
|
179 |
|
180 NW_GDI_Metric_t NW_LMgr_FlowBox_GetLineEnd(NW_LMgr_Box_t* flow, |
|
181 NW_LMgr_FormatContext_t* parentContext, |
|
182 NW_GDI_Metric_t where); |
|
183 |
|
184 NW_Bool NW_LMgr_BidiFlowBox_AtNewLine(NW_LMgr_Box_t* flow, |
|
185 NW_LMgr_FormatContext_t* parentContext); |
|
186 |
|
187 void NW_LMgr_BidiFlowBox_GetConstraint(NW_LMgr_Box_t *flow, |
|
188 NW_LMgr_FormatContext_t *parentContext, |
|
189 NW_GDI_Metric_t *constraint); |
|
190 |
|
191 void |
|
192 NW_LMgr_BidiFlowBox_GetBlockMargins (NW_LMgr_Box_t* flow, |
|
193 NW_LMgr_Box_t* box, |
|
194 NW_LMgr_FormatContext_t *parentContext, |
|
195 NW_LMgr_FrameInfo_t *margin); |
|
196 |
|
197 void |
|
198 NW_LMgr_BidiFlowBox_PlaceChild(NW_LMgr_Box_t* flow, |
|
199 NW_LMgr_Box_t* box, |
|
200 NW_LMgr_FormatContext_t* parentContext); |
|
201 void |
|
202 NW_LMgr_BidiFlowBox_PlaceChildAt(NW_LMgr_Box_t* flow, |
|
203 NW_LMgr_Box_t* box, |
|
204 NW_GDI_Metric_t x, |
|
205 NW_GDI_Metric_t y); |
|
206 |
|
207 TBrowserStatusCode |
|
208 NW_LMgr_BidiFlowBox_HandleInline(NW_LMgr_Box_t* flow, |
|
209 NW_LMgr_Box_t* box, |
|
210 NW_LMgr_FormatContext_t* parentContext); |
|
211 TBrowserStatusCode |
|
212 NW_LMgr_BidiFlowBox_HandleInlineContainer(NW_LMgr_Box_t* flow, |
|
213 NW_LMgr_ContainerBox_t* container, |
|
214 NW_LMgr_FormatContext_t* parentContext); |
|
215 TBrowserStatusCode |
|
216 NW_LMgr_BidiFlowBox_HandleInlineContainerPost(NW_LMgr_Box_t* flow, |
|
217 NW_LMgr_ContainerBox_t* container, |
|
218 NW_LMgr_FormatContext_t* parentContext); |
|
219 TBrowserStatusCode |
|
220 NW_LMgr_BidiFlowBox_HandleBlock (NW_LMgr_Box_t* flow, |
|
221 NW_LMgr_Box_t* box, |
|
222 NW_LMgr_FormatContext_t* parentContext); |
|
223 |
|
224 TBrowserStatusCode |
|
225 NW_LMgr_BidiFlowBox_HandleBlockPost (NW_LMgr_Box_t* flow, |
|
226 NW_LMgr_Box_t* box, |
|
227 NW_LMgr_FormatContext_t* parentContext); |
|
228 TBrowserStatusCode |
|
229 NW_LMgr_BidiFlowBox_PlaceFloat(NW_LMgr_Box_t* flow, |
|
230 NW_LMgr_Box_t *box, |
|
231 NW_LMgr_FormatContext_t* parentContext); |
|
232 |
|
233 TBrowserStatusCode NW_LMgr_BidiFlowBox_HandleFloat(NW_LMgr_Box_t* flow, |
|
234 NW_LMgr_Box_t* box, |
|
235 NW_LMgr_FormatContext_t* parentContext); |
|
236 |
|
237 TBrowserStatusCode |
|
238 NW_LMgr_BidiFlowBox_HandleBreak(NW_LMgr_Box_t* flow, |
|
239 NW_LMgr_Box_t* box, |
|
240 NW_LMgr_FormatContext_t* parentContext); |
|
241 |
|
242 NW_LMgr_Box_t* NW_LMgr_BidiFlowBox_GetMarker(NW_LMgr_Box_t* flowBox, |
|
243 NW_LMgr_Box_t* item, |
|
244 NW_LMgr_FormatContext_t* context, |
|
245 NW_LMgr_PropertyValueToken_t* markerVerticalAlign, |
|
246 NW_Bool* style); |
|
247 NW_LMgr_Box_t* NW_LMgr_BidiFlowBox_GetDirectKeyMarker(NW_LMgr_Box_t* item); |
|
248 NW_Image_AbstractImage_t* NW_LMgr_BidiFlowBox_GetListStyleImage(NW_LMgr_Box_t* flowBox, |
|
249 NW_LMgr_PropertyValueToken_t token); |
|
250 |
|
251 TBrowserStatusCode NW_LMgr_BidiFlowBox_Initialize(NW_LMgr_BidiFlowBox_t *flow); |
|
252 TBrowserStatusCode NW_LMgr_BidiFlowBox_InitializeSSL(NW_LMgr_BidiFlowBox_t *flow); |
|
253 TBrowserStatusCode NW_LMgr_BidiFlowBox_GetListMargin(NW_LMgr_FlowBox_t* flowBox); |
|
254 TBrowserStatusCode NW_LMgr_ResizeToFloat(NW_LMgr_Box_t* flow, NW_LMgr_FormatContext_t* parentContext); |
|
255 }; |
|
256 |
|
257 |
|
258 class TLMgr_Marquee_Box_Formatter:public TLMgr_BoxFormatter |
|
259 { |
|
260 public: |
|
261 // virtual function |
|
262 virtual TBrowserStatusCode |
|
263 NW_LMgr_BidiFlowBox_FlowInline(NW_LMgr_Box_t* flow, |
|
264 NW_LMgr_Box_t* box, |
|
265 NW_LMgr_FormatContext_t* parentContext) ; |
|
266 // virtual function |
|
267 virtual TBrowserStatusCode |
|
268 NW_LMgr_BidiFlowBox_PostFlowInline(NW_LMgr_Box_t* flow, |
|
269 NW_LMgr_Box_t* box, |
|
270 NW_LMgr_FormatContext_t* parentContext); |
|
271 // virtual function |
|
272 virtual TBrowserStatusCode |
|
273 NW_LMgr_BidiFlowBox_FlowBlock(NW_LMgr_Box_t* flow, |
|
274 NW_LMgr_Box_t* box, |
|
275 NW_LMgr_FormatContext_t* parentContext); |
|
276 |
|
277 //virtual function |
|
278 virtual TBrowserStatusCode |
|
279 NW_LMgr_BidiFlowBox_PostFlowBlock(NW_LMgr_Box_t* flow, |
|
280 NW_LMgr_Box_t* box, |
|
281 NW_LMgr_FormatContext_t* parentContext); |
|
282 |
|
283 // virtual function |
|
284 virtual TBrowserStatusCode |
|
285 NW_LMgr_BidiFlowBox_Float(NW_LMgr_Box_t* flow, |
|
286 NW_LMgr_Box_t* box, |
|
287 NW_LMgr_FormatContext_t* parentContext); |
|
288 |
|
289 virtual TBrowserStatusCode |
|
290 NW_LMgr_BidiFlowBox_ListItem(NW_LMgr_Box_t* flow, |
|
291 NW_LMgr_Box_t* item, |
|
292 NW_LMgr_FormatContext_t* context); |
|
293 |
|
294 virtual TBrowserStatusCode |
|
295 NW_LMgr_BidiFlowBox_DirectKey(NW_LMgr_Box_t* flow, |
|
296 NW_LMgr_Box_t* item, |
|
297 NW_LMgr_FormatContext_t* context); |
|
298 |
|
299 }; |
|
300 |
|
301 |
|
302 class TLMgr_StaticCell_Box_Formatter:public TLMgr_BoxFormatter |
|
303 { |
|
304 public: |
|
305 |
|
306 virtual TBrowserStatusCode |
|
307 NW_LMgr_FlowBox_FormatBox(NW_LMgr_Box_t* parentFormatBox, |
|
308 NW_LMgr_Box_t* box, |
|
309 NW_LMgr_FormatContext_t* parentContext); |
|
310 |
|
311 |
|
312 virtual TBrowserStatusCode |
|
313 NW_LMgr_BidiFlowBox_Float(NW_LMgr_Box_t* flow, |
|
314 NW_LMgr_Box_t* box, |
|
315 NW_LMgr_FormatContext_t* parentContext); |
|
316 |
|
317 virtual TBrowserStatusCode |
|
318 NW_LMgr_BidiFlowBox_NewLine(NW_LMgr_Box_t* flow, |
|
319 NW_LMgr_FormatContext_t* context, |
|
320 NW_GDI_Metric_t delta, |
|
321 NW_Bool indentNewLine); |
|
322 virtual TBrowserStatusCode |
|
323 NW_LMgr_FlowBox_PostFormatBox(NW_LMgr_Box_t* parentFormatBox, |
|
324 NW_LMgr_Box_t* box, |
|
325 NW_LMgr_FormatContext_t* parentContext); |
|
326 |
|
327 |
|
328 }; |
|
329 |
|
330 #ifdef __cplusplus |
|
331 } // extern "C" { |
|
332 #endif /* __cplusplus */ |
|
333 |
|
334 #endif |
|
335 |