Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Side by Side Diff: xfa/src/fde/css/fde_css.h

Issue 1803723002: Move xfa/src up to xfa/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/include/fxfa/fxfa_objectacc.h ('k') | xfa/src/fde/css/fde_csscache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef XFA_SRC_FDE_CSS_FDE_CSS_H_
8 #define XFA_SRC_FDE_CSS_FDE_CSS_H_
9
10 #include "core/include/fxge/fx_dib.h"
11 #include "xfa/src/fgas/font/fgas_font.h"
12 #include "xfa/src/fgas/crt/fgas_stream.h"
13 #include "xfa/src/fgas/crt/fgas_utils.h"
14
15 class IFDE_CSSValue;
16 class IFDE_CSSValueList;
17 class IFDE_CSSDeclaration;
18 class IFDE_CSSSelector;
19 class IFDE_CSSRule;
20 class IFDE_CSSStyleSheet;
21 class IFDE_CSSStyleSheetCache;
22 class IFDE_CSSSyntaxParser;
23 class IFDE_CSSRubyStyle;
24 class IFDE_CSSMultiColumnStyle;
25 class IFDE_CSSGeneratedContentStyle;
26 class IFDE_CSSFontStyle;
27 class IFDE_CSSBoundaryStyle;
28 class IFDE_CSSPositionStyle;
29 class IFDE_CSSParagraphStyle;
30 class IFDE_CSSBackgroundStyle;
31 class IFDE_CSSListStyle;
32 class IFDE_CSSTableStyle;
33 class IFDE_CSSVisualStyle;
34 class IFDE_CSSComputedStyle;
35 class IFDE_CSSTagProvider;
36 class IFDE_CSSAccelerator;
37 class IFDE_CSSStyleSelector;
38
39 enum FDE_CSSVALUETYPE {
40 FDE_CSSVALUETYPE_Primitive = 1,
41 FDE_CSSVALUETYPE_List = 2,
42 FDE_CSSVALUETYPE_Shorthand,
43 };
44 enum FDE_CSSPRIMITIVETYPE {
45 FDE_CSSPRIMITIVETYPE_Unknown = 0,
46 FDE_CSSPRIMITIVETYPE_Number = 1,
47 FDE_CSSPRIMITIVETYPE_Percent = 2,
48 FDE_CSSPRIMITIVETYPE_EMS = 3,
49 FDE_CSSPRIMITIVETYPE_EXS = 4,
50 FDE_CSSPRIMITIVETYPE_PX = 5,
51 FDE_CSSPRIMITIVETYPE_CM = 6,
52 FDE_CSSPRIMITIVETYPE_MM = 7,
53 FDE_CSSPRIMITIVETYPE_IN = 8,
54 FDE_CSSPRIMITIVETYPE_PT = 9,
55 FDE_CSSPRIMITIVETYPE_PC = 10,
56 FDE_CSSPRIMITIVETYPE_String = 19,
57 FDE_CSSPRIMITIVETYPE_URI = 20,
58 FDE_CSSPRIMITIVETYPE_RGB = 25,
59 FDE_CSSPRIMITIVETYPE_Enum,
60 FDE_CSSPRIMITIVETYPE_Function,
61 };
62 enum FDE_CSSPROPERTYVALUE {
63 FDE_CSSPROPERTYVALUE_Bolder,
64 FDE_CSSPROPERTYVALUE_LowerLatin,
65 FDE_CSSPROPERTYVALUE_Lowercase,
66 FDE_CSSPROPERTYVALUE_LowerGreek,
67 FDE_CSSPROPERTYVALUE_Sesame,
68 FDE_CSSPROPERTYVALUE_None,
69 FDE_CSSPROPERTYVALUE_NwResize,
70 FDE_CSSPROPERTYVALUE_WResize,
71 FDE_CSSPROPERTYVALUE_Dot,
72 FDE_CSSPROPERTYVALUE_End,
73 FDE_CSSPROPERTYVALUE_Ltr,
74 FDE_CSSPROPERTYVALUE_Pre,
75 FDE_CSSPROPERTYVALUE_Rtl,
76 FDE_CSSPROPERTYVALUE_Sub,
77 FDE_CSSPROPERTYVALUE_Top,
78 FDE_CSSPROPERTYVALUE_Visible,
79 FDE_CSSPROPERTYVALUE_Filled,
80 FDE_CSSPROPERTYVALUE_SwResize,
81 FDE_CSSPROPERTYVALUE_NoRepeat,
82 FDE_CSSPROPERTYVALUE_Default,
83 FDE_CSSPROPERTYVALUE_Transparent,
84 FDE_CSSPROPERTYVALUE_Ridge,
85 FDE_CSSPROPERTYVALUE_Right,
86 FDE_CSSPROPERTYVALUE_HorizontalTb,
87 FDE_CSSPROPERTYVALUE_DistributeLetter,
88 FDE_CSSPROPERTYVALUE_DoubleCircle,
89 FDE_CSSPROPERTYVALUE_Ruby,
90 FDE_CSSPROPERTYVALUE_Collapse,
91 FDE_CSSPROPERTYVALUE_Normal,
92 FDE_CSSPROPERTYVALUE_Avoid,
93 FDE_CSSPROPERTYVALUE_UpperRoman,
94 FDE_CSSPROPERTYVALUE_Auto,
95 FDE_CSSPROPERTYVALUE_Text,
96 FDE_CSSPROPERTYVALUE_XSmall,
97 FDE_CSSPROPERTYVALUE_Thin,
98 FDE_CSSPROPERTYVALUE_Repeat,
99 FDE_CSSPROPERTYVALUE_Small,
100 FDE_CSSPROPERTYVALUE_NeResize,
101 FDE_CSSPROPERTYVALUE_NoContent,
102 FDE_CSSPROPERTYVALUE_Outside,
103 FDE_CSSPROPERTYVALUE_EResize,
104 FDE_CSSPROPERTYVALUE_TableRow,
105 FDE_CSSPROPERTYVALUE_Bottom,
106 FDE_CSSPROPERTYVALUE_Underline,
107 FDE_CSSPROPERTYVALUE_CjkIdeographic,
108 FDE_CSSPROPERTYVALUE_SeResize,
109 FDE_CSSPROPERTYVALUE_Fixed,
110 FDE_CSSPROPERTYVALUE_Double,
111 FDE_CSSPROPERTYVALUE_Solid,
112 FDE_CSSPROPERTYVALUE_RubyBaseGroup,
113 FDE_CSSPROPERTYVALUE_OpenQuote,
114 FDE_CSSPROPERTYVALUE_Lighter,
115 FDE_CSSPROPERTYVALUE_LowerRoman,
116 FDE_CSSPROPERTYVALUE_Strict,
117 FDE_CSSPROPERTYVALUE_TableCaption,
118 FDE_CSSPROPERTYVALUE_Oblique,
119 FDE_CSSPROPERTYVALUE_Decimal,
120 FDE_CSSPROPERTYVALUE_Loose,
121 FDE_CSSPROPERTYVALUE_Hebrew,
122 FDE_CSSPROPERTYVALUE_Hidden,
123 FDE_CSSPROPERTYVALUE_Dashed,
124 FDE_CSSPROPERTYVALUE_Embed,
125 FDE_CSSPROPERTYVALUE_TableRowGroup,
126 FDE_CSSPROPERTYVALUE_TableColumn,
127 FDE_CSSPROPERTYVALUE_Static,
128 FDE_CSSPROPERTYVALUE_Outset,
129 FDE_CSSPROPERTYVALUE_DecimalLeadingZero,
130 FDE_CSSPROPERTYVALUE_KeepWords,
131 FDE_CSSPROPERTYVALUE_KatakanaIroha,
132 FDE_CSSPROPERTYVALUE_Super,
133 FDE_CSSPROPERTYVALUE_Center,
134 FDE_CSSPROPERTYVALUE_TableHeaderGroup,
135 FDE_CSSPROPERTYVALUE_Inside,
136 FDE_CSSPROPERTYVALUE_XxLarge,
137 FDE_CSSPROPERTYVALUE_Triangle,
138 FDE_CSSPROPERTYVALUE_RubyTextGroup,
139 FDE_CSSPROPERTYVALUE_Circle,
140 FDE_CSSPROPERTYVALUE_Hiragana,
141 FDE_CSSPROPERTYVALUE_RepeatX,
142 FDE_CSSPROPERTYVALUE_RepeatY,
143 FDE_CSSPROPERTYVALUE_Move,
144 FDE_CSSPROPERTYVALUE_HiraganaIroha,
145 FDE_CSSPROPERTYVALUE_RubyBase,
146 FDE_CSSPROPERTYVALUE_Scroll,
147 FDE_CSSPROPERTYVALUE_Smaller,
148 FDE_CSSPROPERTYVALUE_TableFooterGroup,
149 FDE_CSSPROPERTYVALUE_Baseline,
150 FDE_CSSPROPERTYVALUE_Separate,
151 FDE_CSSPROPERTYVALUE_Armenian,
152 FDE_CSSPROPERTYVALUE_Open,
153 FDE_CSSPROPERTYVALUE_Relative,
154 FDE_CSSPROPERTYVALUE_Thick,
155 FDE_CSSPROPERTYVALUE_Justify,
156 FDE_CSSPROPERTYVALUE_Middle,
157 FDE_CSSPROPERTYVALUE_Always,
158 FDE_CSSPROPERTYVALUE_DistributeSpace,
159 FDE_CSSPROPERTYVALUE_LineEdge,
160 FDE_CSSPROPERTYVALUE_PreWrap,
161 FDE_CSSPROPERTYVALUE_Medium,
162 FDE_CSSPROPERTYVALUE_NResize,
163 FDE_CSSPROPERTYVALUE_ListItem,
164 FDE_CSSPROPERTYVALUE_Show,
165 FDE_CSSPROPERTYVALUE_Currentcolor,
166 FDE_CSSPROPERTYVALUE_NoCloseQuote,
167 FDE_CSSPROPERTYVALUE_VerticalLr,
168 FDE_CSSPROPERTYVALUE_VerticalRl,
169 FDE_CSSPROPERTYVALUE_Pointer,
170 FDE_CSSPROPERTYVALUE_XxSmall,
171 FDE_CSSPROPERTYVALUE_Bold,
172 FDE_CSSPROPERTYVALUE_Both,
173 FDE_CSSPROPERTYVALUE_SmallCaps,
174 FDE_CSSPROPERTYVALUE_Katakana,
175 FDE_CSSPROPERTYVALUE_After,
176 FDE_CSSPROPERTYVALUE_Horizontal,
177 FDE_CSSPROPERTYVALUE_Dotted,
178 FDE_CSSPROPERTYVALUE_Disc,
179 FDE_CSSPROPERTYVALUE_Georgian,
180 FDE_CSSPROPERTYVALUE_Inline,
181 FDE_CSSPROPERTYVALUE_Overline,
182 FDE_CSSPROPERTYVALUE_Wait,
183 FDE_CSSPROPERTYVALUE_BreakAll,
184 FDE_CSSPROPERTYVALUE_UpperAlpha,
185 FDE_CSSPROPERTYVALUE_Capitalize,
186 FDE_CSSPROPERTYVALUE_Nowrap,
187 FDE_CSSPROPERTYVALUE_TextBottom,
188 FDE_CSSPROPERTYVALUE_NoOpenQuote,
189 FDE_CSSPROPERTYVALUE_Groove,
190 FDE_CSSPROPERTYVALUE_Progress,
191 FDE_CSSPROPERTYVALUE_Larger,
192 FDE_CSSPROPERTYVALUE_CloseQuote,
193 FDE_CSSPROPERTYVALUE_TableCell,
194 FDE_CSSPROPERTYVALUE_PreLine,
195 FDE_CSSPROPERTYVALUE_Absolute,
196 FDE_CSSPROPERTYVALUE_InlineTable,
197 FDE_CSSPROPERTYVALUE_BidiOverride,
198 FDE_CSSPROPERTYVALUE_InlineBlock,
199 FDE_CSSPROPERTYVALUE_Inset,
200 FDE_CSSPROPERTYVALUE_Crosshair,
201 FDE_CSSPROPERTYVALUE_UpperLatin,
202 FDE_CSSPROPERTYVALUE_Help,
203 FDE_CSSPROPERTYVALUE_Hide,
204 FDE_CSSPROPERTYVALUE_Uppercase,
205 FDE_CSSPROPERTYVALUE_SResize,
206 FDE_CSSPROPERTYVALUE_Table,
207 FDE_CSSPROPERTYVALUE_Blink,
208 FDE_CSSPROPERTYVALUE_Block,
209 FDE_CSSPROPERTYVALUE_Start,
210 FDE_CSSPROPERTYVALUE_TableColumnGroup,
211 FDE_CSSPROPERTYVALUE_Italic,
212 FDE_CSSPROPERTYVALUE_LineThrough,
213 FDE_CSSPROPERTYVALUE_KeepAll,
214 FDE_CSSPROPERTYVALUE_LowerAlpha,
215 FDE_CSSPROPERTYVALUE_RunIn,
216 FDE_CSSPROPERTYVALUE_Square,
217 FDE_CSSPROPERTYVALUE_XLarge,
218 FDE_CSSPROPERTYVALUE_Large,
219 FDE_CSSPROPERTYVALUE_Before,
220 FDE_CSSPROPERTYVALUE_Left,
221 FDE_CSSPROPERTYVALUE_TextTop,
222 FDE_CSSPROPERTYVALUE_RubyText,
223 FDE_CSSPROPERTYVALUE_NoDisplay,
224 FDE_CSSPROPERTYVALUE_MAX
225 };
226 class IFDE_CSSValue {
227 public:
228 virtual ~IFDE_CSSValue() {}
229 virtual FDE_CSSVALUETYPE GetType() const = 0;
230 };
231 class IFDE_CSSPrimitiveValue : public IFDE_CSSValue {
232 public:
233 virtual FDE_CSSVALUETYPE GetType() const {
234 return FDE_CSSVALUETYPE_Primitive;
235 }
236 virtual FDE_CSSPRIMITIVETYPE GetPrimitiveType() const = 0;
237 virtual FX_ARGB GetRGBColor() const = 0;
238 virtual FX_FLOAT GetFloat() const = 0;
239 virtual const FX_WCHAR* GetString(int32_t& iLength) const = 0;
240 virtual FDE_CSSPROPERTYVALUE GetEnum() const = 0;
241 virtual const FX_WCHAR* GetFuncName() const = 0;
242 virtual int32_t CountArgs() const = 0;
243 virtual IFDE_CSSValue* GetArgs(int32_t index) const = 0;
244 };
245 class IFDE_CSSValueList : public IFDE_CSSValue {
246 public:
247 virtual FDE_CSSVALUETYPE GetType() const { return FDE_CSSVALUETYPE_List; }
248 virtual int32_t CountValues() const = 0;
249 virtual IFDE_CSSValue* GetValue(int32_t index) const = 0;
250 };
251 enum FDE_CSSPROPERTY {
252 FDE_CSSPROPERTY_WritingMode,
253 FDE_CSSPROPERTY_ColumnRuleWidth,
254 FDE_CSSPROPERTY_BorderLeft,
255 FDE_CSSPROPERTY_ColumnRule,
256 FDE_CSSPROPERTY_Height,
257 FDE_CSSPROPERTY_CounterReset,
258 FDE_CSSPROPERTY_Content,
259 FDE_CSSPROPERTY_RubyPosition,
260 FDE_CSSPROPERTY_BackgroundColor,
261 FDE_CSSPROPERTY_Width,
262 FDE_CSSPROPERTY_Src,
263 FDE_CSSPROPERTY_Top,
264 FDE_CSSPROPERTY_Margin,
265 FDE_CSSPROPERTY_BorderColor,
266 FDE_CSSPROPERTY_Widows,
267 FDE_CSSPROPERTY_BorderBottomColor,
268 FDE_CSSPROPERTY_TextIndent,
269 FDE_CSSPROPERTY_Right,
270 FDE_CSSPROPERTY_TextEmphasisStyle,
271 FDE_CSSPROPERTY_PaddingLeft,
272 FDE_CSSPROPERTY_ColumnWidth,
273 FDE_CSSPROPERTY_MarginLeft,
274 FDE_CSSPROPERTY_Border,
275 FDE_CSSPROPERTY_BorderTop,
276 FDE_CSSPROPERTY_RubyOverhang,
277 FDE_CSSPROPERTY_PageBreakBefore,
278 FDE_CSSPROPERTY_MaxHeight,
279 FDE_CSSPROPERTY_MinWidth,
280 FDE_CSSPROPERTY_BorderLeftColor,
281 FDE_CSSPROPERTY_Bottom,
282 FDE_CSSPROPERTY_Quotes,
283 FDE_CSSPROPERTY_MaxWidth,
284 FDE_CSSPROPERTY_PaddingRight,
285 FDE_CSSPROPERTY_ListStyleImage,
286 FDE_CSSPROPERTY_WhiteSpace,
287 FDE_CSSPROPERTY_BorderBottom,
288 FDE_CSSPROPERTY_ListStyleType,
289 FDE_CSSPROPERTY_WordBreak,
290 FDE_CSSPROPERTY_OverflowX,
291 FDE_CSSPROPERTY_OverflowY,
292 FDE_CSSPROPERTY_BorderTopColor,
293 FDE_CSSPROPERTY_FontFamily,
294 FDE_CSSPROPERTY_Cursor,
295 FDE_CSSPROPERTY_RubyAlign,
296 FDE_CSSPROPERTY_ColumnRuleColor,
297 FDE_CSSPROPERTY_FontWeight,
298 FDE_CSSPROPERTY_BorderRightStyle,
299 FDE_CSSPROPERTY_MinHeight,
300 FDE_CSSPROPERTY_Color,
301 FDE_CSSPROPERTY_LetterSpacing,
302 FDE_CSSPROPERTY_EmptyCells,
303 FDE_CSSPROPERTY_TextAlign,
304 FDE_CSSPROPERTY_RubySpan,
305 FDE_CSSPROPERTY_Position,
306 FDE_CSSPROPERTY_BorderStyle,
307 FDE_CSSPROPERTY_BorderBottomStyle,
308 FDE_CSSPROPERTY_BorderCollapse,
309 FDE_CSSPROPERTY_ColumnCount,
310 FDE_CSSPROPERTY_BorderRightWidth,
311 FDE_CSSPROPERTY_UnicodeBidi,
312 FDE_CSSPROPERTY_VerticalAlign,
313 FDE_CSSPROPERTY_PaddingTop,
314 FDE_CSSPROPERTY_Columns,
315 FDE_CSSPROPERTY_Overflow,
316 FDE_CSSPROPERTY_TableLayout,
317 FDE_CSSPROPERTY_FontVariant,
318 FDE_CSSPROPERTY_ListStyle,
319 FDE_CSSPROPERTY_BackgroundPosition,
320 FDE_CSSPROPERTY_BorderWidth,
321 FDE_CSSPROPERTY_TextEmphasisColor,
322 FDE_CSSPROPERTY_BorderLeftStyle,
323 FDE_CSSPROPERTY_PageBreakInside,
324 FDE_CSSPROPERTY_TextEmphasis,
325 FDE_CSSPROPERTY_BorderBottomWidth,
326 FDE_CSSPROPERTY_ColumnGap,
327 FDE_CSSPROPERTY_Orphans,
328 FDE_CSSPROPERTY_BorderRight,
329 FDE_CSSPROPERTY_FontSize,
330 FDE_CSSPROPERTY_PageBreakAfter,
331 FDE_CSSPROPERTY_CaptionSide,
332 FDE_CSSPROPERTY_BackgroundRepeat,
333 FDE_CSSPROPERTY_BorderTopStyle,
334 FDE_CSSPROPERTY_BorderSpacing,
335 FDE_CSSPROPERTY_TextTransform,
336 FDE_CSSPROPERTY_FontStyle,
337 FDE_CSSPROPERTY_Font,
338 FDE_CSSPROPERTY_LineHeight,
339 FDE_CSSPROPERTY_MarginRight,
340 FDE_CSSPROPERTY_Float,
341 FDE_CSSPROPERTY_BorderLeftWidth,
342 FDE_CSSPROPERTY_Display,
343 FDE_CSSPROPERTY_Clear,
344 FDE_CSSPROPERTY_ColumnRuleStyle,
345 FDE_CSSPROPERTY_TextCombine,
346 FDE_CSSPROPERTY_ListStylePosition,
347 FDE_CSSPROPERTY_Visibility,
348 FDE_CSSPROPERTY_PaddingBottom,
349 FDE_CSSPROPERTY_BackgroundAttachment,
350 FDE_CSSPROPERTY_BackgroundImage,
351 FDE_CSSPROPERTY_LineBreak,
352 FDE_CSSPROPERTY_Background,
353 FDE_CSSPROPERTY_BorderTopWidth,
354 FDE_CSSPROPERTY_WordSpacing,
355 FDE_CSSPROPERTY_BorderRightColor,
356 FDE_CSSPROPERTY_CounterIncrement,
357 FDE_CSSPROPERTY_Left,
358 FDE_CSSPROPERTY_TextDecoration,
359 FDE_CSSPROPERTY_Padding,
360 FDE_CSSPROPERTY_MarginBottom,
361 FDE_CSSPROPERTY_MarginTop,
362 FDE_CSSPROPERTY_Direction,
363 FDE_CSSPROPERTY_MAX
364 };
365 class IFDE_CSSDeclaration {
366 public:
367 virtual ~IFDE_CSSDeclaration() {}
368 virtual IFDE_CSSValue* GetProperty(FDE_CSSPROPERTY eProperty,
369 FX_BOOL& bImportant) const = 0;
370 virtual FX_POSITION GetStartPosition() const = 0;
371 virtual void GetNextProperty(FX_POSITION& pos,
372 FDE_CSSPROPERTY& eProperty,
373 IFDE_CSSValue*& pValue,
374 FX_BOOL& bImportant) const = 0;
375 virtual FX_POSITION GetStartCustom() const = 0;
376 virtual void GetNextCustom(FX_POSITION& pos,
377 CFX_WideString& wsName,
378 CFX_WideString& wsValue) const = 0;
379 };
380 typedef CFX_ArrayTemplate<IFDE_CSSDeclaration*> CFDE_CSSDeclarationArray;
381 enum FDE_CSSPERSUDO {
382 FDE_CSSPERSUDO_After,
383 FDE_CSSPERSUDO_Before,
384 FDE_CSSPERSUDO_NONE
385 };
386 enum FDE_CSSSELECTORTYPE {
387 FDE_CSSSELECTORTYPE_Element,
388 FDE_CSSSELECTORTYPE_Descendant,
389 FDE_CSSSELECTORTYPE_Class,
390 FDE_CSSSELECTORTYPE_Persudo,
391 FDE_CSSSELECTORTYPE_ID,
392 };
393 class IFDE_CSSSelector {
394 public:
395 virtual ~IFDE_CSSSelector() {}
396 virtual FDE_CSSSELECTORTYPE GetType() const = 0;
397 virtual FX_DWORD GetNameHash() const = 0;
398 virtual IFDE_CSSSelector* GetNextSelector() const = 0;
399 };
400 #define FDE_CSSMEDIATYPE_Braille 0x01
401 #define FDE_CSSMEDIATYPE_Emboss 0x02
402 #define FDE_CSSMEDIATYPE_Handheld 0x04
403 #define FDE_CSSMEDIATYPE_Print 0x08
404 #define FDE_CSSMEDIATYPE_Projection 0x10
405 #define FDE_CSSMEDIATYPE_Screen 0x20
406 #define FDE_CSSMEDIATYPE_TTY 0x40
407 #define FDE_CSSMEDIATYPE_TV 0x80
408 #define FDE_CSSMEDIATYPE_ALL 0xFF
409 enum FDE_CSSRULETYPE {
410 FDE_CSSRULETYPE_Unknown = 0,
411 FDE_CSSRULETYPE_Style = 1,
412 FDE_CSSRULETYPE_Media = 4,
413 FDE_CSSRULETYPE_FontFace = 5,
414 };
415 class IFDE_CSSRule {
416 public:
417 virtual ~IFDE_CSSRule() {}
418 virtual FDE_CSSRULETYPE GetType() const = 0;
419 };
420 typedef CFX_MassArrayTemplate<IFDE_CSSRule*> CFDE_CSSRuleArray;
421 class IFDE_CSSStyleRule : public IFDE_CSSRule {
422 public:
423 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_Style; }
424 virtual int32_t CountSelectorLists() const = 0;
425 virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const = 0;
426 virtual IFDE_CSSDeclaration* GetDeclaration() const = 0;
427 };
428 class IFDE_CSSMediaRule : public IFDE_CSSRule {
429 public:
430 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_Media; }
431 virtual FX_DWORD GetMediaList() const = 0;
432 virtual int32_t CountRules() const = 0;
433 virtual IFDE_CSSRule* GetRule(int32_t index) = 0;
434 };
435 class IFDE_CSSFontFaceRule : public IFDE_CSSRule {
436 public:
437 virtual FDE_CSSRULETYPE GetType() const { return FDE_CSSRULETYPE_FontFace; }
438 virtual IFDE_CSSDeclaration* GetDeclaration() const = 0;
439 };
440 class IFDE_CSSStyleSheet : public IFX_Unknown {
441 public:
442 static IFDE_CSSStyleSheet* LoadHTMLStandardStyleSheet();
443 static IFDE_CSSStyleSheet* LoadFromStream(
444 const CFX_WideString& szUrl,
445 IFX_Stream* pStream,
446 FX_WORD wCodePage,
447 FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
448 static IFDE_CSSStyleSheet* LoadFromBuffer(
449 const CFX_WideString& szUrl,
450 const FX_WCHAR* pBuffer,
451 int32_t iBufSize,
452 FX_WORD wCodePage,
453 FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL);
454 virtual FX_BOOL GetUrl(CFX_WideString& szUrl) = 0;
455 virtual FX_DWORD GetMediaList() const = 0;
456 virtual FX_WORD GetCodePage() const = 0;
457
458 virtual int32_t CountRules() const = 0;
459 virtual IFDE_CSSRule* GetRule(int32_t index) = 0;
460 };
461 typedef CFX_ArrayTemplate<IFDE_CSSStyleSheet*> CFDE_CSSStyleSheetArray;
462 #define FDE_CSSUSERSTYLESHEET (FX_BSTRC("#USERSHEET"))
463 #define FDE_CSSUAGENTSTYLESHEET (FX_BSTRC("#AGENTSHEET"))
464 class IFDE_CSSStyleSheetCache {
465 public:
466 static IFDE_CSSStyleSheetCache* Create();
467 virtual ~IFDE_CSSStyleSheetCache() {}
468 virtual void Release() = 0;
469 virtual void SetMaxItems(int32_t iMaxCount = 5) = 0;
470 virtual void AddStyleSheet(const CFX_ByteStringC& szKey,
471 IFDE_CSSStyleSheet* pStyleSheet) = 0;
472 virtual IFDE_CSSStyleSheet* GetStyleSheet(
473 const CFX_ByteStringC& szKey) const = 0;
474 virtual void RemoveStyleSheet(const CFX_ByteStringC& szKey) = 0;
475 };
476 enum FDE_CSSSYNTAXSTATUS {
477 FDE_CSSSYNTAXSTATUS_Error,
478 FDE_CSSSYNTAXSTATUS_EOS,
479 FDE_CSSSYNTAXSTATUS_None,
480 FDE_CSSSYNTAXSTATUS_Charset,
481 FDE_CSSSYNTAXSTATUS_ImportRule,
482 FDE_CSSSYNTAXSTATUS_ImportClose,
483 FDE_CSSSYNTAXSTATUS_PageRule,
484 FDE_CSSSYNTAXSTATUS_StyleRule,
485 FDE_CSSSYNTAXSTATUS_FontFaceRule,
486 FDE_CSSSYNTAXSTATUS_MediaRule,
487 FDE_CSSSYNTAXSTATUS_MediaType,
488 FDE_CSSSYNTAXSTATUS_URI,
489 FDE_CSSSYNTAXSTATUS_Selector,
490 FDE_CSSSYNTAXSTATUS_DeclOpen,
491 FDE_CSSSYNTAXSTATUS_DeclClose,
492 FDE_CSSSYNTAXSTATUS_PropertyName,
493 FDE_CSSSYNTAXSTATUS_PropertyValue,
494 };
495 class IFDE_CSSSyntaxParser {
496 public:
497 static IFDE_CSSSyntaxParser* Create();
498 virtual ~IFDE_CSSSyntaxParser() {}
499 virtual void Release() = 0;
500 virtual FX_BOOL Init(IFX_Stream* pStream,
501 int32_t iCSSPlaneSize,
502 int32_t iTextDataSize = 32,
503 FX_BOOL bOnlyDeclaration = FALSE) = 0;
504 virtual FX_BOOL Init(const FX_WCHAR* pBuffer,
505 int32_t iBufferSize,
506 int32_t iTextDatSize = 32,
507 FX_BOOL bOnlyDeclaration = FALSE) = 0;
508
509 virtual FDE_CSSSYNTAXSTATUS DoSyntaxParse() = 0;
510 virtual const FX_WCHAR* GetCurrentString(int32_t& iLength) const = 0;
511 };
512 enum FDE_CSSLENGTHUNIT {
513 FDE_CSSLENGTHUNIT_Auto,
514 FDE_CSSLENGTHUNIT_None,
515 FDE_CSSLENGTHUNIT_Normal,
516 FDE_CSSLENGTHUNIT_Point,
517 FDE_CSSLENGTHUNIT_Percent,
518 };
519 #define FDE_CSSUNITBITS (3)
520 #define FDE_CSSUNITMASK ((1 << FDE_CSSUNITBITS) - 1)
521 struct FDE_CSSLENGTH {
522 FDE_CSSLENGTH& Set(FDE_CSSLENGTHUNIT eUnit) {
523 m_iData = eUnit;
524 return *this;
525 }
526 FDE_CSSLENGTH& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue) {
527 m_iData = ((intptr_t)(fValue * 1024.0f) << FDE_CSSUNITBITS) | eUnit;
528 return *this;
529 }
530 FDE_CSSLENGTHUNIT GetUnit() const {
531 return (FDE_CSSLENGTHUNIT)(m_iData & FDE_CSSUNITMASK);
532 }
533 FX_FLOAT GetValue() const { return (m_iData >> FDE_CSSUNITBITS) / 1024.0f; }
534 FX_BOOL NonZero() const { return (m_iData >> FDE_CSSUNITBITS) != 0; }
535
536 private:
537 intptr_t m_iData;
538 };
539 struct FDE_CSSPOINT {
540 FDE_CSSPOINT& Set(FDE_CSSLENGTHUNIT eUnit) {
541 x.Set(eUnit);
542 y.Set(eUnit);
543 return *this;
544 }
545 FDE_CSSPOINT& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue) {
546 x.Set(eUnit, fValue);
547 y.Set(eUnit, fValue);
548 return *this;
549 }
550 FDE_CSSLENGTH x, y;
551 };
552 struct FDE_CSSSIZE {
553 FDE_CSSSIZE& Set(FDE_CSSLENGTHUNIT eUnit) {
554 cx.Set(eUnit);
555 cy.Set(eUnit);
556 return *this;
557 }
558 FDE_CSSSIZE& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue) {
559 cx.Set(eUnit, fValue);
560 cy.Set(eUnit, fValue);
561 return *this;
562 }
563 FDE_CSSLENGTH cx, cy;
564 };
565 struct FDE_CSSRECT {
566 FDE_CSSRECT& Set(FDE_CSSLENGTHUNIT eUnit) {
567 left.Set(eUnit);
568 top.Set(eUnit);
569 right.Set(eUnit);
570 bottom.Set(eUnit);
571 return *this;
572 }
573 FDE_CSSRECT& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue) {
574 left.Set(eUnit, fValue);
575 top.Set(eUnit, fValue);
576 right.Set(eUnit, fValue);
577 bottom.Set(eUnit, fValue);
578 return *this;
579 }
580
581 FDE_CSSLENGTH left, top, right, bottom;
582 };
583 enum FDE_CSSBKGATTACHMENT {
584 FDE_CSSBKGATTACHMENT_Scroll,
585 FDE_CSSBKGATTACHMENT_Fixed,
586 };
587 enum FDE_CSSBKGREPEAT {
588 FDE_CSSBKGREPEAT_Repeat,
589 FDE_CSSBKGREPEAT_RepeatX,
590 FDE_CSSBKGREPEAT_RepeatY,
591 FDE_CSSBKGREPEAT_NoRepeat,
592 };
593 enum FDE_CSSBORDERSTYLE {
594 FDE_CSSBORDERSTYLE_None,
595 FDE_CSSBORDERSTYLE_Hidden,
596 FDE_CSSBORDERSTYLE_Dotted,
597 FDE_CSSBORDERSTYLE_Dashed,
598 FDE_CSSBORDERSTYLE_Solid,
599 FDE_CSSBORDERSTYLE_Double,
600 FDE_CSSBORDERSTYLE_Groove,
601 FDE_CSSBORDERSTYLE_Ridge,
602 FDE_CSSBORDERSTYLE_Inset,
603 FDE_CSSBORDERSTYLE_outset,
604 };
605 enum FDE_CSSCLEAR {
606 FDE_CSSCLEAR_None,
607 FDE_CSSCLEAR_Left,
608 FDE_CSSCLEAR_Right,
609 FDE_CSSCLEAR_Both,
610 };
611 enum FDE_CSSDISPLAY {
612 FDE_CSSDISPLAY_None,
613 FDE_CSSDISPLAY_ListItem,
614 FDE_CSSDISPLAY_RunIn,
615 FDE_CSSDISPLAY_Block,
616 FDE_CSSDISPLAY_Inline,
617 FDE_CSSDISPLAY_InlineBlock,
618 FDE_CSSDISPLAY_InlineTable,
619 FDE_CSSDISPLAY_Table,
620 FDE_CSSDISPLAY_TableRow,
621 FDE_CSSDISPLAY_TableCell,
622 FDE_CSSDISPLAY_TableCaption,
623 FDE_CSSDISPLAY_TableColumn,
624 FDE_CSSDISPLAY_TableRowGroup,
625 FDE_CSSDISPLAY_TableColumnGroup,
626 FDE_CSSDISPLAY_TableHeaderGroup,
627 FDE_CSSDISPLAY_TableFooterGroup,
628 FDE_CSSDISPLAY_Ruby,
629 FDE_CSSDISPLAY_RubyBase,
630 FDE_CSSDISPLAY_RubyText,
631 FDE_CSSDISPLSY_RubyBaseGroup,
632 FDE_CSSDISPLAY_RubyTextGroup,
633 };
634 enum FDE_CSSVISIBILITY {
635 FDE_CSSVISIBILITY_Visible,
636 FDE_CSSVISIBILITY_Hidden,
637 FDE_CSSVISIBILITY_Collapse,
638 };
639 enum FDE_CSSFONTSTYLE {
640 FDE_CSSFONTSTYLE_Normal,
641 FDE_CSSFONTSTYLE_Italic,
642 };
643 enum FDE_CSSFLOAT {
644 FDE_CSSFLOAT_None,
645 FDE_CSSFLOAT_Left,
646 FDE_CSSFLOAT_Right,
647 };
648 enum FDE_CSSWRITINGMODE {
649 FDE_CSSWRITINGMODE_HorizontalTb,
650 FDE_CSSWRITINGMODE_VerticalRl,
651 FDE_CSSWRITINGMODE_VerticalLr,
652 };
653 enum FDE_CSSWORDBREAK {
654 FDE_CSSWORDBREAK_Normal,
655 FDE_CSSWORDBREAK_KeepAll,
656 FDE_CSSWORDBREAK_BreakAll,
657 FDE_CSSWORDBREAK_KeepWords,
658 };
659 enum FDE_CSSPAGEBREAK {
660 FDE_CSSPAGEBREAK_Auto,
661 FDE_CSSPAGEBREAK_Always,
662 FDE_CSSPAGEBREAK_Avoid,
663 FDE_CSSPAGEBREAK_Left,
664 FDE_CSSPAGEBREAK_Right,
665 };
666 enum FDE_CSSOVERFLOW {
667 FDE_CSSOVERFLOW_Visible,
668 FDE_CSSOVERFLOW_Hidden,
669 FDE_CSSOVERFLOW_Scroll,
670 FDE_CSSOVERFLOW_Auto,
671 FDE_CSSOVERFLOW_NoDisplay,
672 FDE_CSSOVERFLOW_NoContent,
673 };
674 enum FDE_CSSLINEBREAK {
675 FDE_CSSLINEBREAK_Auto,
676 FDE_CSSLINEBREAK_Loose,
677 FDE_CSSLINEBREAK_Normal,
678 FDE_CSSLINEBREAK_Strict,
679 };
680 enum FDE_CSSTEXTEMPHASISFILL {
681 FDE_CSSTEXTEMPHASISFILL_Filled,
682 FDE_CSSTEXTEMPHASISFILL_Open,
683 };
684 enum FDE_CSSTEXTEMPHASISMARK {
685 FDE_CSSTEXTEMPHASISMARK_None,
686 FDE_CSSTEXTEMPHASISMARK_Auto,
687 FDE_CSSTEXTEMPHASISMARK_Dot,
688 FDE_CSSTEXTEMPHASISMARK_Circle,
689 FDE_CSSTEXTEMPHASISMARK_DoubleCircle,
690 FDE_CSSTEXTEMPHASISMARK_Triangle,
691 FDE_CSSTEXTEMPHASISMARK_Sesame,
692 FDE_CSSTEXTEMPHASISMARK_Custom,
693 };
694 enum FDE_CSSTEXTCOMBINE {
695 FDE_CSSTEXTCOMBINE_Horizontal,
696 FDE_CSSTEXTCOMBINE_None,
697 };
698 enum FDE_CSSCURSOR {
699 FDE_CSSCURSOR_Auto,
700 FDE_CSSCURSOR_Crosshair,
701 FDE_CSSCURSOR_Default,
702 FDE_CSSCURSOR_Pointer,
703 FDE_CSSCURSOR_Move,
704 FDE_CSSCURSOR_EResize,
705 FDE_CSSCURSOR_NeResize,
706 FDE_CSSCURSOR_NwResize,
707 FDE_CSSCURSOR_NResize,
708 FDE_CSSCURSOR_SeResize,
709 FDE_CSSCURSOR_SwResize,
710 FDE_CSSCURSOR_SResize,
711 FDE_CSSCURSOR_WResize,
712 FDE_CSSCURSOR_Text,
713 FDE_CSSCURSOR_Wait,
714 FDE_CSSCURSOR_Help,
715 FDE_CSSCURSOR_Progress,
716 };
717 enum FDE_CSSPOSITION {
718 FDE_CSSPOSITION_Static,
719 FDE_CSSPOSITION_Relative,
720 FDE_CSSPOSITION_Absolute,
721 FDE_CSSPOSITION_Fixed,
722 };
723 enum FDE_CSSCAPTIONSIDE {
724 FDE_CSSCAPTIONSIDE_Top,
725 FDE_CSSCAPTIONSIDE_Bottom,
726 FDE_CSSCAPTIONSIDE_Left,
727 FDE_CSSCAPTIONSIDE_Right,
728 FDE_CSSCAPTIONSIDE_Before,
729 FDE_CSSCAPTIONSIDE_After,
730 };
731 enum FDE_CSSRUBYALIGN {
732 FDE_CSSRUBYALIGN_Auto,
733 FDE_CSSRUBYALIGN_Start,
734 FDE_CSSRUBYALIGN_Left,
735 FDE_CSSRUBYALIGN_Center,
736 FDE_CSSRUBYALIGN_End,
737 FDE_CSSRUBYALIGN_Right,
738 FDE_CSSRUBYALIGN_DistributeLetter,
739 FDE_CSSRUBYALIGN_DistributeSpace,
740 FDE_CSSRUBYALIGN_LineEdge,
741 };
742 enum FDE_CSSRUBYOVERHANG {
743 FDE_CSSRUBYOVERHANG_Auto,
744 FDE_CSSRUBYOVERHANG_Start,
745 FDE_CSSRUBYOVERHANG_End,
746 FDE_CSSRUBYOVERHANG_None,
747 };
748 enum FDE_CSSRUBYPOSITION {
749 FDE_CSSRUBYPOSITION_Before,
750 FDE_CSSRUBYPOSITION_After,
751 FDE_CSSRUBYPOSITION_Right,
752 FDE_CSSRUBYPOSITION_Inline,
753 };
754 enum FDE_CSSRUBYSPAN {
755 FDE_CSSRUBYSPAN_None,
756 FDE_CSSRUBYSPAN_Attr,
757 };
758 enum FDE_CSSTEXTALIGN {
759 FDE_CSSTEXTALIGN_Left,
760 FDE_CSSTEXTALIGN_Right,
761 FDE_CSSTEXTALIGN_Center,
762 FDE_CSSTEXTALIGN_Justify,
763 FDE_CSSTEXTALIGN_JustifyAll,
764 };
765 enum FDE_CSSVERTICALALIGN {
766 FDE_CSSVERTICALALIGN_Baseline,
767 FDE_CSSVERTICALALIGN_Sub,
768 FDE_CSSVERTICALALIGN_Super,
769 FDE_CSSVERTICALALIGN_Top,
770 FDE_CSSVERTICALALIGN_TextTop,
771 FDE_CSSVERTICALALIGN_Middle,
772 FDE_CSSVERTICALALIGN_Bottom,
773 FDE_CSSVERTICALALIGN_TextBottom,
774 FDE_CSSVERTICALALIGN_Number,
775 };
776 enum FDE_CSSLISTSTYLETYPE {
777 FDE_CSSLISTSTYLETYPE_Disc,
778 FDE_CSSLISTSTYLETYPE_Circle,
779 FDE_CSSLISTSTYLETYPE_Square,
780 FDE_CSSLISTSTYLETYPE_Decimal,
781 FDE_CSSLISTSTYLETYPE_DecimalLeadingZero,
782 FDE_CSSLISTSTYLETYPE_LowerRoman,
783 FDE_CSSLISTSTYLETYPE_UpperRoman,
784 FDE_CSSLISTSTYLETYPE_LowerGreek,
785 FDE_CSSLISTSTYLETYPE_LowerLatin,
786 FDE_CSSLISTSTYLETYPE_UpperLatin,
787 FDE_CSSLISTSTYLETYPE_Armenian,
788 FDE_CSSLISTSTYLETYPE_Georgian,
789 FDE_CSSLISTSTYLETYPE_LowerAlpha,
790 FDE_CSSLISTSTYLETYPE_UpperAlpha,
791 FDE_CSSLISTSTYLETYPE_None,
792 FDE_CSSLISTSTYLETYPE_CjkIdeographic,
793 FDE_CSSLISTSTYLETYPE_Hebrew,
794 FDE_CSSLISTSTYLETYPE_Hiragana,
795 FDE_CSSLISTSTYLETYPE_HiraganaIroha,
796 FDE_CSSLISTSTYLETYPE_Katakana,
797 FDE_CSSLISTSTYLETYPE_KatakanaIroha,
798 };
799 enum FDE_CSSLISTSTYLEPOSITION {
800 FDE_CSSLISTSTYLEPOSITION_Outside,
801 FDE_CSSLISTSTYLEPOSITION_Inside,
802 };
803 enum FDE_CSSWHITESPACE {
804 FDE_CSSWHITESPACE_Normal,
805 FDE_CSSWHITESPACE_Pre,
806 FDE_CSSWHITESPACE_Nowrap,
807 FDE_CSSWHITESPACE_PreWrap,
808 FDE_CSSWHITESPACE_PreLine,
809 };
810 enum FDE_CSSFONTVARIANT {
811 FDE_CSSFONTVARIANT_Normal,
812 FDE_CSSFONTVARIANT_SmallCaps,
813 };
814 enum FDE_CSSTEXTTRANSFORM {
815 FDE_CSSTEXTTRANSFORM_None,
816 FDE_CSSTEXTTRANSFORM_Capitalize,
817 FDE_CSSTEXTTRANSFORM_UpperCase,
818 FDE_CSSTEXTTRANSFORM_LowerCase,
819 };
820 enum FDE_CSSTEXTDECORATION {
821 FDE_CSSTEXTDECORATION_None = 0,
822 FDE_CSSTEXTDECORATION_Underline = 1,
823 FDE_CSSTEXTDECORATION_Overline = 2,
824 FDE_CSSTEXTDECORATION_LineThrough = 4,
825 FDE_CSSTEXTDECORATION_Blink = 8,
826 FDE_CSSTEXTDECORATION_Double = 16,
827 };
828 class IFDE_CSSRubyStyle {
829 public:
830 virtual ~IFDE_CSSRubyStyle() {}
831 virtual FDE_CSSRUBYALIGN GetRubyAlign() const = 0;
832 virtual FDE_CSSRUBYOVERHANG GetRubyOverhang() const = 0;
833 virtual FDE_CSSRUBYPOSITION GetRubyPosition() const = 0;
834 virtual FDE_CSSRUBYSPAN GetRubySpanType() const = 0;
835 virtual IFDE_CSSValue* GetRubySpanAttr() const = 0;
836 };
837 class IFDE_CSSMultiColumnStyle {
838 public:
839 virtual ~IFDE_CSSMultiColumnStyle() {}
840 virtual const FDE_CSSLENGTH& GetColumnCount() const = 0;
841 virtual const FDE_CSSLENGTH& GetColumnGap() const = 0;
842 virtual FX_ARGB GetColumnRuleColor() const = 0;
843 virtual FDE_CSSBORDERSTYLE GetColumnRuleStyle() const = 0;
844 virtual const FDE_CSSLENGTH& GetColumnRuleWidth() const = 0;
845 virtual const FDE_CSSLENGTH& GetColumnWidth() const = 0;
846 virtual void SetColumnCount(const FDE_CSSLENGTH& columnCount) = 0;
847 virtual void SetColumnGap(const FDE_CSSLENGTH& columnGap) = 0;
848 virtual void SetColumnRuleColor(FX_ARGB dwColumnRuleColor) = 0;
849 virtual void SetColumnRuleStyle(FDE_CSSBORDERSTYLE eColumnRuleStyle) = 0;
850 virtual void SetColumnRuleWidth(const FDE_CSSLENGTH& columnRuleWidth) = 0;
851 virtual void SetColumnWidth(const FDE_CSSLENGTH& columnWidth) = 0;
852 };
853 class IFDE_CSSGeneratedContentStyle {
854 public:
855 virtual ~IFDE_CSSGeneratedContentStyle() {}
856 virtual int32_t CountCounters() = 0;
857 virtual const FX_WCHAR* GetCounterIdentifier(int32_t index) = 0;
858 virtual FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) = 0;
859 virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) = 0;
860 virtual IFDE_CSSValueList* GetContent() const = 0;
861 virtual int32_t CountQuotes() const = 0;
862 virtual const FX_WCHAR* GetQuotes(int32_t index) const = 0;
863 };
864 class IFDE_CSSFontStyle {
865 public:
866 virtual ~IFDE_CSSFontStyle() {}
867 virtual int32_t CountFontFamilies() const = 0;
868 virtual const FX_WCHAR* GetFontFamily(int32_t index) const = 0;
869 virtual FX_WORD GetFontWeight() const = 0;
870 virtual FDE_CSSFONTVARIANT GetFontVariant() const = 0;
871 virtual FDE_CSSFONTSTYLE GetFontStyle() const = 0;
872 virtual FX_FLOAT GetFontSize() const = 0;
873 virtual FX_ARGB GetColor() const = 0;
874 virtual void SetFontWeight(FX_WORD wFontWeight) = 0;
875 virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) = 0;
876 virtual void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) = 0;
877 virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
878 virtual void SetColor(FX_ARGB dwFontColor) = 0;
879 };
880 class IFDE_CSSBoundaryStyle {
881 public:
882 virtual ~IFDE_CSSBoundaryStyle() {}
883 virtual FX_ARGB GetBorderLeftColor() const = 0;
884 virtual FX_ARGB GetBorderTopColor() const = 0;
885 virtual FX_ARGB GetBorderRightColor() const = 0;
886 virtual FX_ARGB GetBorderBottomColor() const = 0;
887 virtual FDE_CSSBORDERSTYLE GetBorderLeftStyle() const = 0;
888 virtual FDE_CSSBORDERSTYLE GetBorderTopStyle() const = 0;
889 virtual FDE_CSSBORDERSTYLE GetBorderRightStyle() const = 0;
890 virtual FDE_CSSBORDERSTYLE GetBorderBottomStyle() const = 0;
891 virtual const FDE_CSSRECT* GetBorderWidth() const = 0;
892 virtual const FDE_CSSRECT* GetMarginWidth() const = 0;
893 virtual const FDE_CSSRECT* GetPaddingWidth() const = 0;
894 virtual void SetBorderLeftColor(FX_ARGB dwBorderColor) = 0;
895 virtual void SetBorderTopColor(FX_ARGB dwBorderColor) = 0;
896 virtual void SetBorderRightColor(FX_ARGB dwBorderColor) = 0;
897 virtual void SetBorderBottomColor(FX_ARGB dwBorderColor) = 0;
898
899 virtual void SetBorderLeftStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
900 virtual void SetBorderTopStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
901 virtual void SetBorderRightStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
902 virtual void SetBorderBottomStyle(FDE_CSSBORDERSTYLE eBorderStyle) = 0;
903
904 virtual void SetBorderWidth(const FDE_CSSRECT& rect) = 0;
905 virtual void SetMarginWidth(const FDE_CSSRECT& rect) = 0;
906 virtual void SetPaddingWidth(const FDE_CSSRECT& rect) = 0;
907 };
908 class IFDE_CSSPositionStyle {
909 public:
910 virtual ~IFDE_CSSPositionStyle() {}
911 virtual FDE_CSSDISPLAY GetDisplay() const = 0;
912 virtual const FDE_CSSSIZE& GetBoxSize() const = 0;
913 virtual const FDE_CSSSIZE& GetMinBoxSize() const = 0;
914 virtual const FDE_CSSSIZE& GetMaxBoxSize() const = 0;
915 virtual FDE_CSSFLOAT GetFloat() const = 0;
916 virtual FDE_CSSCLEAR GetClear() const = 0;
917 virtual FDE_CSSPOSITION GetPosition() const = 0;
918 virtual FDE_CSSLENGTH GetTop() const = 0;
919 virtual FDE_CSSLENGTH GetBottom() const = 0;
920 virtual FDE_CSSLENGTH GetLeft() const = 0;
921 virtual FDE_CSSLENGTH GetRight() const = 0;
922 virtual void SetDisplay(FDE_CSSDISPLAY eDisplay) = 0;
923 virtual void SetBoxSize(const FDE_CSSSIZE& boxSize) = 0;
924 virtual void SetMinBoxSize(const FDE_CSSSIZE& minBoxSize) = 0;
925 virtual void SetMaxBoxSize(const FDE_CSSSIZE& maxBoxSize) = 0;
926 virtual void SetFloat(FDE_CSSFLOAT eFloat) = 0;
927 virtual void SetClear(FDE_CSSCLEAR eClear) = 0;
928 };
929 class IFDE_CSSParagraphStyle {
930 public:
931 virtual ~IFDE_CSSParagraphStyle() {}
932 virtual FX_FLOAT GetLineHeight() const = 0;
933 virtual FDE_CSSWHITESPACE GetWhiteSpace() const = 0;
934 virtual const FDE_CSSLENGTH& GetTextIndent() const = 0;
935 virtual FDE_CSSTEXTALIGN GetTextAlign() const = 0;
936 virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const = 0;
937 virtual FX_FLOAT GetNumberVerticalAlign() const = 0;
938 virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const = 0;
939 virtual FX_DWORD GetTextDecoration() const = 0;
940 virtual const FDE_CSSLENGTH& GetLetterSpacing() const = 0;
941 virtual const FDE_CSSLENGTH& GetWordSpacing() const = 0;
942 virtual FDE_CSSWRITINGMODE GetWritingMode() const = 0;
943 virtual FDE_CSSWORDBREAK GetWordBreak() const = 0;
944 virtual int32_t GetWidows() const = 0;
945 virtual FX_ARGB GetTextEmphasisColor() const = 0;
946 virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const = 0;
947 virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const = 0;
948 virtual FDE_CSSPAGEBREAK GetPageBreakInside() const = 0;
949 virtual int32_t GetOrphans() const = 0;
950 virtual FDE_CSSLINEBREAK GetLineBreak() const = 0;
951 virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const = 0;
952 virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const = 0;
953 virtual const FX_WCHAR* GetTextEmphasisCustom() const = 0;
954 virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const = 0;
955 virtual FX_BOOL HasTextCombineNumber() const = 0;
956 virtual FX_FLOAT GetTextCombineNumber() const = 0;
957 virtual void SetLineHeight(FX_FLOAT fLineHeight) = 0;
958 virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) = 0;
959 virtual void SetTextIndent(const FDE_CSSLENGTH& textIndent) = 0;
960 virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) = 0;
961 virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) = 0;
962 virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) = 0;
963 virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) = 0;
964 virtual void SetTextDecoration(FX_DWORD dwTextDecoration) = 0;
965 virtual void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) = 0;
966 virtual void SetWordSpacing(const FDE_CSSLENGTH& wordSpacing) = 0;
967 virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) = 0;
968 virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) = 0;
969 virtual void SetWidows(int32_t iWidows) = 0;
970 virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) = 0;
971 virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) = 0;
972 virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) = 0;
973 virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) = 0;
974 virtual void SetOrphans(int32_t iOrphans) = 0;
975 virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) = 0;
976 };
977 class IFDE_CSSBackgroundStyle {
978 public:
979 virtual ~IFDE_CSSBackgroundStyle() {}
980 virtual FX_ARGB GetBKGColor() const = 0;
981 virtual const FX_WCHAR* GetBKGImage() const = 0;
982 virtual FDE_CSSBKGREPEAT GetBKGRepeat() const = 0;
983 virtual FDE_CSSBKGATTACHMENT GetBKGAttachment() const = 0;
984 virtual const FDE_CSSPOINT& GetBKGPosition() const = 0;
985 virtual void SetBKGColor(FX_ARGB dwBKGColor) = 0;
986 virtual void SetBKGPosition(const FDE_CSSPOINT& bkgPosition) = 0;
987 };
988 class IFDE_CSSListStyle {
989 public:
990 virtual ~IFDE_CSSListStyle() {}
991 virtual FDE_CSSLISTSTYLETYPE GetListStyleType() const = 0;
992 virtual FDE_CSSLISTSTYLEPOSITION GetListStylePosition() const = 0;
993 virtual const FX_WCHAR* GetListStyleImage() const = 0;
994 virtual void SetListStyleType(FDE_CSSLISTSTYLETYPE eListStyleType) = 0;
995 virtual void SetListStylePosition(
996 FDE_CSSLISTSTYLEPOSITION eListStylePosition) = 0;
997 };
998 class IFDE_CSSTableStyle {
999 public:
1000 virtual ~IFDE_CSSTableStyle() {}
1001 virtual FDE_CSSCAPTIONSIDE GetCaptionSide() const = 0;
1002 };
1003 class IFDE_CSSVisualStyle {
1004 public:
1005 virtual ~IFDE_CSSVisualStyle() {}
1006 virtual FDE_CSSVISIBILITY GetVisibility() const = 0;
1007 virtual FDE_CSSOVERFLOW GetOverflowX() const = 0;
1008 virtual FDE_CSSOVERFLOW GetOverflowY() const = 0;
1009 virtual void SetVisibility(FDE_CSSVISIBILITY eVisibility) = 0;
1010 };
1011 class IFDE_CSSComputedStyle : public IFX_Unknown {
1012 public:
1013 virtual void Reset() = 0;
1014 virtual IFDE_CSSFontStyle* GetFontStyles() const = 0;
1015 virtual IFDE_CSSBoundaryStyle* GetBoundaryStyles() const = 0;
1016 virtual IFDE_CSSPositionStyle* GetPositionStyles() const = 0;
1017 virtual IFDE_CSSParagraphStyle* GetParagraphStyles() const = 0;
1018 virtual IFDE_CSSBackgroundStyle* GetBackgroundStyles() const = 0;
1019 virtual IFDE_CSSVisualStyle* GetVisualStyles() const = 0;
1020 virtual IFDE_CSSListStyle* GetListStyles() const = 0;
1021 virtual IFDE_CSSMultiColumnStyle* GetMultiColumnStyle() const = 0;
1022 virtual IFDE_CSSTableStyle* GetTableStyle() const = 0;
1023 virtual IFDE_CSSGeneratedContentStyle* GetGeneratedContentStyle() const = 0;
1024 virtual IFDE_CSSRubyStyle* GetRubyStyle() const = 0;
1025 virtual FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName,
1026 CFX_WideString& wsValue) const = 0;
1027 };
1028 enum FDE_CSSSTYLESHEETGROUP {
1029 FDE_CSSSTYLESHEETGROUP_UserAgent,
1030 FDE_CSSSTYLESHEETGROUP_User,
1031 FDE_CSSSTYLESHEETGROUP_Author,
1032 FDE_CSSSTYLESHEETGROUP_MAX,
1033 };
1034 enum FDE_CSSSTYLESHEETPRIORITY {
1035 FDE_CSSSTYLESHEETPRIORITY_High,
1036 FDE_CSSSTYLESHEETPRIORITY_Mid,
1037 FDE_CSSSTYLESHEETPRIORITY_Low,
1038 FDE_CSSSTYLESHEETPRIORITY_MAX,
1039 };
1040 class IFDE_CSSTagProvider {
1041 public:
1042 virtual ~IFDE_CSSTagProvider() {}
1043 virtual CFX_WideStringC GetTagName() = 0;
1044 virtual FX_POSITION GetFirstAttribute() = 0;
1045 virtual void GetNextAttribute(FX_POSITION& pos,
1046 CFX_WideStringC& wsAttr,
1047 CFX_WideStringC& wsValue) = 0;
1048 };
1049 class IFDE_CSSAccelerator {
1050 public:
1051 virtual ~IFDE_CSSAccelerator() {}
1052 virtual void OnEnterTag(IFDE_CSSTagProvider* pTag) = 0;
1053 virtual void OnLeaveTag(IFDE_CSSTagProvider* pTag) = 0;
1054 };
1055 class IFDE_CSSStyleSelector {
1056 public:
1057 static IFDE_CSSStyleSelector* Create();
1058 virtual ~IFDE_CSSStyleSelector() {}
1059 virtual void Release() = 0;
1060 virtual void SetFontMgr(IFX_FontMgr* pFontMgr) = 0;
1061 virtual void SetDefFontSize(FX_FLOAT fFontSize) = 0;
1062 virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType,
1063 IFDE_CSSStyleSheet* pSheet) = 0;
1064 virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType,
1065 const CFDE_CSSStyleSheetArray* pArray) = 0;
1066 virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType,
1067 FDE_CSSSTYLESHEETPRIORITY ePriority) = 0;
1068 virtual void UpdateStyleIndex(FX_DWORD dwMediaList) = 0;
1069 virtual IFDE_CSSAccelerator* InitAccelerator() = 0;
1070 virtual IFDE_CSSComputedStyle* CreateComputedStyle(
1071 IFDE_CSSComputedStyle* pParentStyle) = 0;
1072 virtual int32_t MatchDeclarations(
1073 IFDE_CSSTagProvider* pTag,
1074 CFDE_CSSDeclarationArray& matchedDecls,
1075 FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0;
1076 virtual void ComputeStyle(IFDE_CSSTagProvider* pTag,
1077 const IFDE_CSSDeclaration** ppDeclArray,
1078 int32_t iDeclCount,
1079 IFDE_CSSComputedStyle* pDestStyle) = 0;
1080 };
1081
1082 #endif // XFA_SRC_FDE_CSS_FDE_CSS_H_
OLDNEW
« no previous file with comments | « xfa/include/fxfa/fxfa_objectacc.h ('k') | xfa/src/fde/css/fde_csscache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698