OLD | NEW |
| (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_CSSSTYLESELECTOR_H_ | |
8 #define XFA_SRC_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ | |
9 | |
10 #include <vector> | |
11 | |
12 #include "core/include/fxcrt/fx_ext.h" | |
13 #include "xfa/src/fde/css/fde_css.h" | |
14 #include "xfa/src/fde/css/fde_csscache.h" | |
15 #include "xfa/src/fde/css/fde_cssdeclaration.h" | |
16 #include "xfa/src/fgas/crt/fgas_memory.h" | |
17 #include "xfa/src/fgas/crt/fgas_system.h" | |
18 | |
19 #define FDE_CSSUNIVERSALHASH ('*') | |
20 | |
21 class FDE_CSSRuleData : public CFX_Target { | |
22 public: | |
23 FDE_CSSRuleData(IFDE_CSSSelector* pSel, | |
24 IFDE_CSSDeclaration* pDecl, | |
25 FX_DWORD dwPos); | |
26 | |
27 IFDE_CSSSelector* pSelector; | |
28 IFDE_CSSDeclaration* pDeclaration; | |
29 FX_DWORD dwPriority; | |
30 FDE_CSSRuleData* pNext; | |
31 }; | |
32 | |
33 class CFDE_CSSRuleCollection : public CFX_Target { | |
34 public: | |
35 CFDE_CSSRuleCollection() | |
36 : m_pStaticStore(nullptr), | |
37 m_pUniversalRules(nullptr), | |
38 m_pPersudoRules(nullptr), | |
39 m_iSelectors(0) {} | |
40 ~CFDE_CSSRuleCollection() { Clear(); } | |
41 void AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets, | |
42 FX_DWORD dwMediaList, | |
43 IFX_FontMgr* pFontMgr); | |
44 void Clear(); | |
45 | |
46 int32_t CountSelectors() const { return m_iSelectors; } | |
47 FDE_CSSRuleData* GetIDRuleData(FX_DWORD dwIDHash) { | |
48 void* pData; | |
49 return m_IDRules.Lookup((void*)(uintptr_t)dwIDHash, pData) | |
50 ? (FDE_CSSRuleData*)pData | |
51 : NULL; | |
52 } | |
53 FDE_CSSRuleData* GetTagRuleData(FX_DWORD dwTagHasn) { | |
54 void* pData; | |
55 return m_TagRules.Lookup((void*)(uintptr_t)dwTagHasn, pData) | |
56 ? (FDE_CSSRuleData*)pData | |
57 : NULL; | |
58 } | |
59 FDE_CSSRuleData* GetClassRuleData(FX_DWORD dwIDHash) { | |
60 void* pData; | |
61 return m_ClassRules.Lookup((void*)(uintptr_t)dwIDHash, pData) | |
62 ? (FDE_CSSRuleData*)pData | |
63 : NULL; | |
64 } | |
65 FDE_CSSRuleData* GetUniversalRuleData() { return m_pUniversalRules; } | |
66 FDE_CSSRuleData* GetPersudoRuleData() { return m_pPersudoRules; } | |
67 IFX_MEMAllocator* m_pStaticStore; | |
68 | |
69 protected: | |
70 void AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet, | |
71 IFDE_CSSRule* pRule, | |
72 FX_DWORD dwMediaList, | |
73 IFX_FontMgr* pFontMgr); | |
74 void AddRuleTo(CFX_MapPtrToPtr& map, | |
75 FX_DWORD dwKey, | |
76 IFDE_CSSSelector* pSel, | |
77 IFDE_CSSDeclaration* pDecl); | |
78 FX_BOOL AddRuleTo(FDE_CSSRuleData*& pList, FDE_CSSRuleData* pData); | |
79 FDE_CSSRuleData* NewRuleData(IFDE_CSSSelector* pSel, | |
80 IFDE_CSSDeclaration* pDecl); | |
81 CFX_MapPtrToPtr m_IDRules; | |
82 CFX_MapPtrToPtr m_TagRules; | |
83 CFX_MapPtrToPtr m_ClassRules; | |
84 FDE_CSSRuleData* m_pUniversalRules; | |
85 FDE_CSSRuleData* m_pPersudoRules; | |
86 int32_t m_iSelectors; | |
87 }; | |
88 class CFDE_CSSAccelerator; | |
89 class CFDE_CSSComputedStyle; | |
90 class CFDE_CSSStyleSelector : public IFDE_CSSStyleSelector, public CFX_Target { | |
91 public: | |
92 CFDE_CSSStyleSelector(); | |
93 ~CFDE_CSSStyleSelector(); | |
94 virtual void Release() { delete this; } | |
95 | |
96 virtual void SetFontMgr(IFX_FontMgr* pFontMgr); | |
97 virtual void SetDefFontSize(FX_FLOAT fFontSize); | |
98 | |
99 virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, | |
100 IFDE_CSSStyleSheet* pSheet); | |
101 virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType, | |
102 const CFDE_CSSStyleSheetArray* pArray); | |
103 virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType, | |
104 FDE_CSSSTYLESHEETPRIORITY ePriority); | |
105 virtual void UpdateStyleIndex(FX_DWORD dwMediaList); | |
106 virtual IFDE_CSSAccelerator* InitAccelerator(); | |
107 virtual IFDE_CSSComputedStyle* CreateComputedStyle( | |
108 IFDE_CSSComputedStyle* pParentStyle); | |
109 virtual int32_t MatchDeclarations( | |
110 IFDE_CSSTagProvider* pTag, | |
111 CFDE_CSSDeclarationArray& matchedDecls, | |
112 FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE); | |
113 virtual void ComputeStyle(IFDE_CSSTagProvider* pTag, | |
114 const IFDE_CSSDeclaration** ppDeclArray, | |
115 int32_t iDeclCount, | |
116 IFDE_CSSComputedStyle* pDestStyle); | |
117 | |
118 protected: | |
119 void Reset(); | |
120 void MatchRules(FDE_CSSTagCache* pCache, | |
121 FDE_CSSRuleData* pList, | |
122 FDE_CSSPERSUDO ePersudoType); | |
123 FX_BOOL MatchSelector(FDE_CSSTagCache* pCache, | |
124 IFDE_CSSSelector* pSel, | |
125 FDE_CSSPERSUDO ePersudoType); | |
126 void AppendInlineStyle(CFDE_CSSDeclaration* pDecl, | |
127 const FX_WCHAR* psz, | |
128 int32_t iLen); | |
129 void ApplyDeclarations(FX_BOOL bPriority, | |
130 const IFDE_CSSDeclaration** ppDeclArray, | |
131 int32_t iDeclCount, | |
132 IFDE_CSSComputedStyle* pDestStyle); | |
133 void ApplyProperty(FDE_CSSPROPERTY eProperty, | |
134 IFDE_CSSValue* pValue, | |
135 CFDE_CSSComputedStyle* pComputedStyle); | |
136 | |
137 FX_FLOAT ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit, | |
138 FX_FLOAT fValue, | |
139 FX_FLOAT fPercentBase); | |
140 FX_BOOL SetLengthWithPercent(FDE_CSSLENGTH& width, | |
141 FDE_CSSPRIMITIVETYPE eType, | |
142 IFDE_CSSPrimitiveValue* pPrimitive, | |
143 FX_FLOAT fFontSize); | |
144 FX_FLOAT ToFontSize(FDE_CSSPROPERTYVALUE eValue, FX_FLOAT fCurFontSize); | |
145 FDE_CSSDISPLAY ToDisplay(FDE_CSSPROPERTYVALUE eValue); | |
146 FDE_CSSTEXTALIGN ToTextAlign(FDE_CSSPROPERTYVALUE eValue); | |
147 FX_WORD ToFontWeight(FDE_CSSPROPERTYVALUE eValue); | |
148 FDE_CSSFONTSTYLE ToFontStyle(FDE_CSSPROPERTYVALUE eValue); | |
149 FDE_CSSBORDERSTYLE ToBorderStyle(FDE_CSSPROPERTYVALUE eValue); | |
150 FDE_CSSVERTICALALIGN ToVerticalAlign(FDE_CSSPROPERTYVALUE eValue); | |
151 FDE_CSSLISTSTYLETYPE ToListStyleType(FDE_CSSPROPERTYVALUE eValue); | |
152 FDE_CSSLISTSTYLEPOSITION ToListStylePosition(FDE_CSSPROPERTYVALUE eValue); | |
153 FDE_CSSVISIBILITY ToVisibility(FDE_CSSPROPERTYVALUE eValue); | |
154 FDE_CSSWHITESPACE ToWhiteSpace(FDE_CSSPROPERTYVALUE eValue); | |
155 FX_DWORD ToTextDecoration(IFDE_CSSValueList* pList); | |
156 FDE_CSSTEXTTRANSFORM ToTextTransform(FDE_CSSPROPERTYVALUE eValue); | |
157 FDE_CSSFONTVARIANT ToFontVariant(FDE_CSSPROPERTYVALUE eValue); | |
158 FDE_CSSFLOAT ToFloat(FDE_CSSPROPERTYVALUE eValue); | |
159 FDE_CSSCLEAR ToClear(FDE_CSSPROPERTYVALUE eValue); | |
160 FDE_CSSWRITINGMODE ToWritingMode(FDE_CSSPROPERTYVALUE eValue); | |
161 FDE_CSSWORDBREAK ToWordBreak(FDE_CSSPROPERTYVALUE eValue); | |
162 FDE_CSSPAGEBREAK ToPageBreak(FDE_CSSPROPERTYVALUE eValue); | |
163 FDE_CSSOVERFLOW ToOverflow(FDE_CSSPROPERTYVALUE eValue); | |
164 FDE_CSSLINEBREAK ToLineBreak(FDE_CSSPROPERTYVALUE eValue); | |
165 FDE_CSSTEXTCOMBINE ToTextCombine(FDE_CSSPROPERTYVALUE eValue); | |
166 FX_BOOL ToTextEmphasisMark(FDE_CSSPROPERTYVALUE eValue, | |
167 FDE_CSSTEXTEMPHASISMARK& eMark); | |
168 FX_BOOL ToTextEmphasisFill(FDE_CSSPROPERTYVALUE eValue, | |
169 FDE_CSSTEXTEMPHASISFILL& eFill); | |
170 FDE_CSSCURSOR ToCursor(FDE_CSSPROPERTYVALUE eValue); | |
171 FDE_CSSPOSITION ToPosition(FDE_CSSPROPERTYVALUE eValue); | |
172 FDE_CSSCAPTIONSIDE ToCaptionSide(FDE_CSSPROPERTYVALUE eValue); | |
173 FDE_CSSBKGREPEAT ToBKGRepeat(FDE_CSSPROPERTYVALUE eValue); | |
174 FDE_CSSBKGATTACHMENT ToBKGAttachment(FDE_CSSPROPERTYVALUE eValue); | |
175 FDE_CSSRUBYALIGN ToRubyAlign(FDE_CSSPROPERTYVALUE eValue); | |
176 FDE_CSSRUBYOVERHANG ToRubyOverhang(FDE_CSSPROPERTYVALUE eValue); | |
177 FDE_CSSRUBYPOSITION ToRubyPosition(FDE_CSSPROPERTYVALUE eValue); | |
178 FDE_CSSRUBYSPAN ToRubySpan(FDE_CSSPROPERTYVALUE eValue); | |
179 IFX_FontMgr* m_pFontMgr; | |
180 FX_FLOAT m_fDefFontSize; | |
181 IFX_MEMAllocator* m_pRuleDataStore; | |
182 CFDE_CSSStyleSheetArray m_SheetGroups[FDE_CSSSTYLESHEETGROUP_MAX]; | |
183 CFDE_CSSRuleCollection m_RuleCollection[FDE_CSSSTYLESHEETGROUP_MAX]; | |
184 FDE_CSSSTYLESHEETGROUP m_ePriorities[FDE_CSSSTYLESHEETPRIORITY_MAX]; | |
185 IFX_MEMAllocator* m_pInlineStyleStore; | |
186 IFX_MEMAllocator* m_pFixedStyleStore; | |
187 CFDE_CSSAccelerator* m_pAccelerator; | |
188 std::vector<FDE_CSSRuleData*> m_MatchedRules; | |
189 }; | |
190 | |
191 struct FDE_CSSCOUNTERDATA { | |
192 public: | |
193 FDE_CSSCOUNTERDATA() { FXSYS_memset(this, 0, sizeof(FDE_CSSCOUNTERDATA)); } | |
194 FX_BOOL GetCounterIncrement(int32_t& iValue) { | |
195 iValue = m_iIncVal; | |
196 return m_bIncrement; | |
197 } | |
198 FX_BOOL GetCounterReset(int32_t& iValue) { | |
199 iValue = m_iResetVal; | |
200 return m_bReset; | |
201 } | |
202 | |
203 const FX_WCHAR* m_pszIdent; | |
204 FX_BOOL m_bIncrement; | |
205 FX_BOOL m_bReset; | |
206 int32_t m_iIncVal; | |
207 int32_t m_iResetVal; | |
208 }; | |
209 | |
210 class CFDE_CSSCounterStyle { | |
211 public: | |
212 CFDE_CSSCounterStyle() : m_pCounterInc(NULL), m_pCounterReset(NULL) {} | |
213 void SetCounterIncrementList(IFDE_CSSValueList* pList) { | |
214 m_pCounterInc = pList; | |
215 m_bIndexDirty = TRUE; | |
216 } | |
217 void SetCounterResetList(IFDE_CSSValueList* pList) { | |
218 m_pCounterReset = pList; | |
219 m_bIndexDirty = TRUE; | |
220 } | |
221 int32_t CountCounters() { | |
222 UpdateIndex(); | |
223 return m_arrCounterData.GetSize(); | |
224 } | |
225 FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) { | |
226 UpdateIndex(); | |
227 return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue); | |
228 } | |
229 FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) { | |
230 UpdateIndex(); | |
231 return m_arrCounterData.ElementAt(index).GetCounterReset(iValue); | |
232 } | |
233 const FX_WCHAR* GetCounterIdentifier(int32_t index) { | |
234 UpdateIndex(); | |
235 return m_arrCounterData.ElementAt(index).m_pszIdent; | |
236 } | |
237 | |
238 protected: | |
239 void UpdateIndex(); | |
240 void DoUpdateIndex(IFDE_CSSValueList* pList); | |
241 int32_t FindIndex(const FX_WCHAR* pszIdentifier); | |
242 IFDE_CSSValueList* m_pCounterInc; | |
243 IFDE_CSSValueList* m_pCounterReset; | |
244 CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData; | |
245 FX_BOOL m_bIndexDirty; | |
246 }; | |
247 class CFDE_CSSInheritedData { | |
248 public: | |
249 void Reset() { | |
250 FXSYS_memset(this, 0, sizeof(CFDE_CSSInheritedData)); | |
251 m_LetterSpacing.Set(FDE_CSSLENGTHUNIT_Normal); | |
252 m_WordSpacing.Set(FDE_CSSLENGTHUNIT_Normal); | |
253 m_TextIndent.Set(FDE_CSSLENGTHUNIT_Point, 0); | |
254 m_fFontSize = 12.0f; | |
255 m_fLineHeight = 14.0f; | |
256 m_wFontWeight = 400; | |
257 m_dwFontColor = 0xFF000000; | |
258 m_iWidows = 2; | |
259 m_bTextEmphasisColorCurrent = TRUE; | |
260 m_iOrphans = 2; | |
261 } | |
262 const FX_WCHAR* m_pszListStyleImage; | |
263 FDE_CSSLENGTH m_LetterSpacing; | |
264 FDE_CSSLENGTH m_WordSpacing; | |
265 FDE_CSSLENGTH m_TextIndent; | |
266 IFDE_CSSValueList* m_pFontFamily; | |
267 IFDE_CSSValueList* m_pQuotes; | |
268 IFDE_CSSValueList* m_pCursorUris; | |
269 FDE_CSSCURSOR m_eCursor; | |
270 FX_FLOAT m_fFontSize; | |
271 FX_FLOAT m_fLineHeight; | |
272 FX_ARGB m_dwFontColor; | |
273 FX_ARGB m_dwTextEmphasisColor; | |
274 FX_WORD m_wFontWeight; | |
275 int32_t m_iWidows; | |
276 int32_t m_iOrphans; | |
277 const FX_WCHAR* m_pszTextEmphasisCustomMark; | |
278 FX_WORD m_eFontVariant : 1; | |
279 FX_WORD m_eFontStyle : 1; | |
280 FX_WORD m_bTextEmphasisColorCurrent : 1; | |
281 FX_WORD m_eTextAligh : 2; | |
282 FX_WORD m_eVisibility : 2; | |
283 FX_WORD m_eWhiteSpace : 3; | |
284 FX_WORD m_eTextTransform : 2; | |
285 FX_WORD m_eWritingMode : 2; | |
286 FX_WORD m_eWordBreak : 2; | |
287 FX_WORD m_eLineBreak : 2; | |
288 FX_WORD m_eTextEmphasisFill : 1; | |
289 FX_WORD m_eTextEmphasisMark : 3; | |
290 FX_WORD m_eCaptionSide : 3; | |
291 | |
292 FX_WORD m_eRubyAlign : 4; | |
293 FX_WORD m_eRubyOverhang : 2; | |
294 FX_WORD m_eRubyPosition : 2; | |
295 }; | |
296 class CFDE_CSSNonInheritedData { | |
297 public: | |
298 void Reset() { | |
299 FXSYS_memset(this, 0, sizeof(CFDE_CSSNonInheritedData)); | |
300 m_MarginWidth = m_BorderWidth = | |
301 m_PaddingWidth.Set(FDE_CSSLENGTHUNIT_Point, 0); | |
302 m_MinBoxSize.Set(FDE_CSSLENGTHUNIT_Point, 0); | |
303 m_MaxBoxSize.Set(FDE_CSSLENGTHUNIT_None); | |
304 m_eDisplay = FDE_CSSDISPLAY_Inline; | |
305 m_fVerticalAlign = 0.0f; | |
306 m_ColumnCount.Set(FDE_CSSLENGTHUNIT_Auto); | |
307 m_ColumnGap.Set(FDE_CSSLENGTHUNIT_Normal); | |
308 m_bColumnRuleColorSame = TRUE; | |
309 m_ColumnWidth.Set(FDE_CSSLENGTHUNIT_Auto); | |
310 m_ColumnRuleWidth.Set(FDE_CSSLENGTHUNIT_Auto); | |
311 m_eTextCombine = FDE_CSSTEXTCOMBINE_None; | |
312 } | |
313 | |
314 IFDE_CSSValueList* m_pContentList; | |
315 CFDE_CSSCounterStyle* m_pCounterStyle; | |
316 FDE_CSSRECT m_MarginWidth; | |
317 FDE_CSSRECT m_BorderWidth; | |
318 FDE_CSSRECT m_PaddingWidth; | |
319 FDE_CSSSIZE m_BoxSize; | |
320 FDE_CSSSIZE m_MinBoxSize; | |
321 FDE_CSSSIZE m_MaxBoxSize; | |
322 FDE_CSSPOINT m_BKGPosition; | |
323 const FX_WCHAR* m_pszBKGImage; | |
324 FX_ARGB m_dwBKGColor; | |
325 FX_ARGB m_dwBDRLeftColor; | |
326 FX_ARGB m_dwBDRTopColor; | |
327 FX_ARGB m_dwBDRRightColor; | |
328 FX_ARGB m_dwBDRBottomColor; | |
329 IFDE_CSSValue* m_pRubySpan; | |
330 FDE_CSSLENGTH m_ColumnCount; | |
331 FDE_CSSLENGTH m_ColumnGap; | |
332 FDE_CSSLENGTH m_ColumnRuleWidth; | |
333 FDE_CSSLENGTH m_ColumnWidth; | |
334 FX_ARGB m_dwColumnRuleColor; | |
335 FDE_CSSLENGTH m_Top; | |
336 FDE_CSSLENGTH m_Bottom; | |
337 FDE_CSSLENGTH m_Left; | |
338 FDE_CSSLENGTH m_Right; | |
339 | |
340 FX_FLOAT m_fVerticalAlign; | |
341 FX_FLOAT m_fTextCombineNumber; | |
342 FX_DWORD m_eBDRLeftStyle : 4; | |
343 FX_DWORD m_eBDRTopStyle : 4; | |
344 FX_DWORD m_eBDRRightStyle : 4; | |
345 FX_DWORD m_eBDRBottomStyle : 4; | |
346 FX_DWORD m_eDisplay : 5; | |
347 FX_DWORD m_eVerticalAlign : 4; | |
348 FX_DWORD m_eListStyleType : 5; | |
349 FX_DWORD m_eColumnRuleStyle : 4; | |
350 FX_DWORD m_ePageBreakInside : 3; | |
351 FX_DWORD m_ePageBreakAfter : 3; | |
352 FX_DWORD m_ePageBreakBefore : 3; | |
353 FX_DWORD m_ePosition : 2; | |
354 FX_DWORD m_eBKGRepeat : 2; | |
355 FX_DWORD m_eFloat : 2; | |
356 FX_DWORD m_eClear : 2; | |
357 FX_DWORD m_eOverflowX : 3; | |
358 FX_DWORD m_eOverflowY : 3; | |
359 FX_DWORD m_eListStylePosition : 1; | |
360 FX_DWORD m_eBKGAttachment : 1; | |
361 FX_DWORD m_bHasMargin : 1; | |
362 FX_DWORD m_bHasBorder : 1; | |
363 FX_DWORD m_bHasPadding : 1; | |
364 FX_DWORD m_dwTextDecoration : 5; | |
365 FX_DWORD m_eTextCombine : 1; | |
366 FX_DWORD m_bColumnRuleColorSame : 1; | |
367 FX_DWORD m_bHasTextCombineNumber : 1; | |
368 }; | |
369 class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, | |
370 public IFDE_CSSFontStyle, | |
371 public IFDE_CSSBoundaryStyle, | |
372 public IFDE_CSSPositionStyle, | |
373 public IFDE_CSSParagraphStyle, | |
374 public IFDE_CSSBackgroundStyle, | |
375 public IFDE_CSSVisualStyle, | |
376 public IFDE_CSSListStyle, | |
377 public IFDE_CSSMultiColumnStyle, | |
378 public IFDE_CSSGeneratedContentStyle, | |
379 public IFDE_CSSTableStyle, | |
380 public IFDE_CSSRubyStyle, | |
381 public CFX_Target { | |
382 public: | |
383 CFDE_CSSComputedStyle(IFX_MEMAllocator* pAlloc) | |
384 : m_dwRefCount(1), m_pAllocator(pAlloc) {} | |
385 ~CFDE_CSSComputedStyle() {} | |
386 virtual FX_DWORD AddRef() { return ++m_dwRefCount; } | |
387 virtual FX_DWORD Release() { | |
388 FX_DWORD dwRefCount = --m_dwRefCount; | |
389 if (dwRefCount == 0) { | |
390 if (m_NonInheritedData.m_pCounterStyle != NULL) { | |
391 delete m_NonInheritedData.m_pCounterStyle; | |
392 } | |
393 FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this); | |
394 } | |
395 return dwRefCount; | |
396 } | |
397 | |
398 virtual void Reset() { | |
399 m_InheritedData.Reset(); | |
400 m_NonInheritedData.Reset(); | |
401 } | |
402 virtual IFDE_CSSFontStyle* GetFontStyles() const { | |
403 return (IFDE_CSSFontStyle * const) this; | |
404 } | |
405 virtual IFDE_CSSBoundaryStyle* GetBoundaryStyles() const { | |
406 return (IFDE_CSSBoundaryStyle * const) this; | |
407 } | |
408 virtual IFDE_CSSPositionStyle* GetPositionStyles() const { | |
409 return (IFDE_CSSPositionStyle * const) this; | |
410 } | |
411 virtual IFDE_CSSParagraphStyle* GetParagraphStyles() const { | |
412 return (IFDE_CSSParagraphStyle * const) this; | |
413 } | |
414 virtual IFDE_CSSBackgroundStyle* GetBackgroundStyles() const { | |
415 return (IFDE_CSSBackgroundStyle * const) this; | |
416 } | |
417 virtual IFDE_CSSVisualStyle* GetVisualStyles() const { | |
418 return (IFDE_CSSVisualStyle * const) this; | |
419 } | |
420 virtual IFDE_CSSListStyle* GetListStyles() const { | |
421 return (IFDE_CSSListStyle * const) this; | |
422 } | |
423 virtual IFDE_CSSTableStyle* GetTableStyle() const { | |
424 return (IFDE_CSSTableStyle * const) this; | |
425 } | |
426 virtual IFDE_CSSMultiColumnStyle* GetMultiColumnStyle() const { | |
427 return (IFDE_CSSMultiColumnStyle * const) this; | |
428 } | |
429 virtual IFDE_CSSGeneratedContentStyle* GetGeneratedContentStyle() const { | |
430 return (IFDE_CSSGeneratedContentStyle * const) this; | |
431 } | |
432 virtual IFDE_CSSRubyStyle* GetRubyStyle() const { | |
433 return (IFDE_CSSRubyStyle * const) this; | |
434 } | |
435 virtual FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName, | |
436 CFX_WideString& wsValue) const { | |
437 for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) { | |
438 if (wsName == m_CustomProperties[i]) { | |
439 wsValue = m_CustomProperties[i + 1]; | |
440 return TRUE; | |
441 } | |
442 } | |
443 return FALSE; | |
444 } | |
445 virtual FDE_CSSRUBYALIGN GetRubyAlign() const { | |
446 return (FDE_CSSRUBYALIGN)m_InheritedData.m_eRubyAlign; | |
447 } | |
448 virtual FDE_CSSRUBYPOSITION GetRubyPosition() const { | |
449 return (FDE_CSSRUBYPOSITION)m_InheritedData.m_eRubyPosition; | |
450 } | |
451 virtual FDE_CSSRUBYOVERHANG GetRubyOverhang() const { | |
452 return (FDE_CSSRUBYOVERHANG)m_InheritedData.m_eRubyOverhang; | |
453 } | |
454 virtual FDE_CSSRUBYSPAN GetRubySpanType() const { | |
455 return m_NonInheritedData.m_pRubySpan == NULL ? FDE_CSSRUBYSPAN_None | |
456 : FDE_CSSRUBYSPAN_Attr; | |
457 } | |
458 virtual IFDE_CSSValue* GetRubySpanAttr() const { | |
459 return m_NonInheritedData.m_pRubySpan; | |
460 } | |
461 virtual FDE_CSSCAPTIONSIDE GetCaptionSide() const { | |
462 return (FDE_CSSCAPTIONSIDE)m_InheritedData.m_eCaptionSide; | |
463 } | |
464 virtual int32_t CountCounters() { | |
465 return (m_NonInheritedData.m_pCounterStyle == NULL) | |
466 ? 0 | |
467 : m_NonInheritedData.m_pCounterStyle->CountCounters(); | |
468 } | |
469 virtual const FX_WCHAR* GetCounterIdentifier(int32_t index) { | |
470 return m_NonInheritedData.m_pCounterStyle->GetCounterIdentifier(index); | |
471 } | |
472 virtual FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) { | |
473 return m_NonInheritedData.m_pCounterStyle->GetCounterReset(index, iValue); | |
474 } | |
475 virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) { | |
476 return m_NonInheritedData.m_pCounterStyle->GetCounterIncrement(index, | |
477 iValue); | |
478 } | |
479 virtual IFDE_CSSValueList* GetContent() const { | |
480 return m_NonInheritedData.m_pContentList; | |
481 } | |
482 virtual int32_t CountQuotes() const { | |
483 return m_InheritedData.m_pQuotes == NULL | |
484 ? 0 | |
485 : m_InheritedData.m_pQuotes->CountValues(); | |
486 } | |
487 virtual const FX_WCHAR* GetQuotes(int32_t index) const { | |
488 FXSYS_assert(m_InheritedData.m_pQuotes != NULL && | |
489 m_InheritedData.m_pQuotes->CountValues() > index); | |
490 return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pQuotes->GetValue( | |
491 index))) | |
492 ->GetString(index); | |
493 } | |
494 virtual const FDE_CSSLENGTH& GetColumnCount() const { | |
495 return m_NonInheritedData.m_ColumnCount; | |
496 } | |
497 virtual const FDE_CSSLENGTH& GetColumnGap() const { | |
498 return m_NonInheritedData.m_ColumnGap; | |
499 } | |
500 virtual FX_ARGB GetColumnRuleColor() const { | |
501 return m_NonInheritedData.m_bColumnRuleColorSame | |
502 ? m_InheritedData.m_dwFontColor | |
503 : m_NonInheritedData.m_dwColumnRuleColor; | |
504 } | |
505 virtual FDE_CSSBORDERSTYLE GetColumnRuleStyle() const { | |
506 return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eColumnRuleStyle; | |
507 } | |
508 virtual const FDE_CSSLENGTH& GetColumnRuleWidth() const { | |
509 return m_NonInheritedData.m_ColumnRuleWidth; | |
510 } | |
511 virtual const FDE_CSSLENGTH& GetColumnWidth() const { | |
512 return m_NonInheritedData.m_ColumnWidth; | |
513 } | |
514 virtual void SetColumnCount(const FDE_CSSLENGTH& columnCount) { | |
515 m_NonInheritedData.m_ColumnCount = columnCount; | |
516 } | |
517 virtual void SetColumnGap(const FDE_CSSLENGTH& columnGap) { | |
518 m_NonInheritedData.m_ColumnGap = columnGap; | |
519 } | |
520 virtual void SetColumnRuleColor(FX_ARGB dwColumnRuleColor) { | |
521 m_NonInheritedData.m_dwColumnRuleColor = dwColumnRuleColor, | |
522 m_NonInheritedData.m_bColumnRuleColorSame = FALSE; | |
523 } | |
524 virtual void SetColumnRuleStyle(FDE_CSSBORDERSTYLE eColumnRuleStyle) { | |
525 m_NonInheritedData.m_eColumnRuleStyle = eColumnRuleStyle; | |
526 } | |
527 virtual void SetColumnRuleWidth(const FDE_CSSLENGTH& columnRuleWidth) { | |
528 m_NonInheritedData.m_ColumnRuleWidth = columnRuleWidth; | |
529 } | |
530 virtual void SetColumnWidth(const FDE_CSSLENGTH& columnWidth) { | |
531 m_NonInheritedData.m_ColumnWidth = columnWidth; | |
532 } | |
533 virtual int32_t CountFontFamilies() const { | |
534 return m_InheritedData.m_pFontFamily | |
535 ? m_InheritedData.m_pFontFamily->CountValues() | |
536 : 0; | |
537 } | |
538 virtual const FX_WCHAR* GetFontFamily(int32_t index) const { | |
539 return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pFontFamily->GetValue( | |
540 index))) | |
541 ->GetString(index); | |
542 } | |
543 virtual FX_WORD GetFontWeight() const { | |
544 return m_InheritedData.m_wFontWeight; | |
545 } | |
546 virtual FDE_CSSFONTVARIANT GetFontVariant() const { | |
547 return (FDE_CSSFONTVARIANT)m_InheritedData.m_eFontVariant; | |
548 } | |
549 virtual FDE_CSSFONTSTYLE GetFontStyle() const { | |
550 return (FDE_CSSFONTSTYLE)m_InheritedData.m_eFontStyle; | |
551 } | |
552 virtual FX_FLOAT GetFontSize() const { return m_InheritedData.m_fFontSize; } | |
553 virtual FX_ARGB GetColor() const { return m_InheritedData.m_dwFontColor; } | |
554 virtual void SetFontWeight(FX_WORD wFontWeight) { | |
555 m_InheritedData.m_wFontWeight = wFontWeight; | |
556 } | |
557 virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) { | |
558 m_InheritedData.m_eFontVariant = eFontVariant; | |
559 } | |
560 virtual void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) { | |
561 m_InheritedData.m_eFontStyle = eFontStyle; | |
562 } | |
563 virtual void SetFontSize(FX_FLOAT fFontSize) { | |
564 m_InheritedData.m_fFontSize = fFontSize; | |
565 } | |
566 virtual void SetColor(FX_ARGB dwFontColor) { | |
567 m_InheritedData.m_dwFontColor = dwFontColor; | |
568 } | |
569 virtual FX_ARGB GetBorderLeftColor() const { | |
570 return m_NonInheritedData.m_dwBDRLeftColor; | |
571 } | |
572 virtual FX_ARGB GetBorderTopColor() const { | |
573 return m_NonInheritedData.m_dwBDRTopColor; | |
574 } | |
575 virtual FX_ARGB GetBorderRightColor() const { | |
576 return m_NonInheritedData.m_dwBDRRightColor; | |
577 } | |
578 virtual FX_ARGB GetBorderBottomColor() const { | |
579 return m_NonInheritedData.m_dwBDRBottomColor; | |
580 } | |
581 | |
582 virtual FDE_CSSBORDERSTYLE GetBorderLeftStyle() const { | |
583 return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRLeftStyle; | |
584 } | |
585 virtual FDE_CSSBORDERSTYLE GetBorderTopStyle() const { | |
586 return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRTopStyle; | |
587 } | |
588 virtual FDE_CSSBORDERSTYLE GetBorderRightStyle() const { | |
589 return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRRightStyle; | |
590 } | |
591 virtual FDE_CSSBORDERSTYLE GetBorderBottomStyle() const { | |
592 return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRBottomStyle; | |
593 } | |
594 | |
595 virtual const FDE_CSSRECT* GetBorderWidth() const { | |
596 return m_NonInheritedData.m_bHasBorder ? &(m_NonInheritedData.m_BorderWidth) | |
597 : NULL; | |
598 } | |
599 virtual const FDE_CSSRECT* GetMarginWidth() const { | |
600 return m_NonInheritedData.m_bHasMargin ? &(m_NonInheritedData.m_MarginWidth) | |
601 : NULL; | |
602 } | |
603 virtual const FDE_CSSRECT* GetPaddingWidth() const { | |
604 return m_NonInheritedData.m_bHasPadding | |
605 ? &(m_NonInheritedData.m_PaddingWidth) | |
606 : NULL; | |
607 } | |
608 virtual void SetBorderLeftColor(FX_ARGB dwBorderColor) { | |
609 m_NonInheritedData.m_dwBDRLeftColor = dwBorderColor; | |
610 } | |
611 virtual void SetBorderTopColor(FX_ARGB dwBorderColor) { | |
612 m_NonInheritedData.m_dwBDRTopColor = dwBorderColor; | |
613 } | |
614 virtual void SetBorderRightColor(FX_ARGB dwBorderColor) { | |
615 m_NonInheritedData.m_dwBDRRightColor = dwBorderColor; | |
616 } | |
617 virtual void SetBorderBottomColor(FX_ARGB dwBorderColor) { | |
618 m_NonInheritedData.m_dwBDRBottomColor = dwBorderColor; | |
619 } | |
620 | |
621 virtual void SetBorderLeftStyle(FDE_CSSBORDERSTYLE eBorderStyle) { | |
622 m_NonInheritedData.m_eBDRLeftStyle = eBorderStyle; | |
623 } | |
624 virtual void SetBorderTopStyle(FDE_CSSBORDERSTYLE eBorderStyle) { | |
625 m_NonInheritedData.m_eBDRTopStyle = eBorderStyle; | |
626 } | |
627 virtual void SetBorderRightStyle(FDE_CSSBORDERSTYLE eBorderStyle) { | |
628 m_NonInheritedData.m_eBDRRightStyle = eBorderStyle; | |
629 } | |
630 virtual void SetBorderBottomStyle(FDE_CSSBORDERSTYLE eBorderStyle) { | |
631 m_NonInheritedData.m_eBDRBottomStyle = eBorderStyle; | |
632 } | |
633 | |
634 virtual void SetBorderWidth(const FDE_CSSRECT& rect) { | |
635 m_NonInheritedData.m_BorderWidth = rect; | |
636 m_NonInheritedData.m_bHasBorder = TRUE; | |
637 } | |
638 virtual void SetMarginWidth(const FDE_CSSRECT& rect) { | |
639 m_NonInheritedData.m_MarginWidth = rect; | |
640 m_NonInheritedData.m_bHasMargin = TRUE; | |
641 } | |
642 virtual void SetPaddingWidth(const FDE_CSSRECT& rect) { | |
643 m_NonInheritedData.m_PaddingWidth = rect; | |
644 m_NonInheritedData.m_bHasPadding = TRUE; | |
645 } | |
646 virtual FDE_CSSDISPLAY GetDisplay() const { | |
647 return (FDE_CSSDISPLAY)m_NonInheritedData.m_eDisplay; | |
648 } | |
649 virtual const FDE_CSSSIZE& GetBoxSize() const { | |
650 return m_NonInheritedData.m_BoxSize; | |
651 } | |
652 virtual const FDE_CSSSIZE& GetMinBoxSize() const { | |
653 return m_NonInheritedData.m_MinBoxSize; | |
654 } | |
655 virtual const FDE_CSSSIZE& GetMaxBoxSize() const { | |
656 return m_NonInheritedData.m_MaxBoxSize; | |
657 } | |
658 virtual FDE_CSSFLOAT GetFloat() const { | |
659 return (FDE_CSSFLOAT)m_NonInheritedData.m_eFloat; | |
660 } | |
661 virtual FDE_CSSCLEAR GetClear() const { | |
662 return (FDE_CSSCLEAR)m_NonInheritedData.m_eClear; | |
663 } | |
664 virtual FDE_CSSPOSITION GetPosition() const { | |
665 return (FDE_CSSPOSITION)m_NonInheritedData.m_ePosition; | |
666 } | |
667 virtual FDE_CSSLENGTH GetTop() const { return m_NonInheritedData.m_Top; } | |
668 virtual FDE_CSSLENGTH GetBottom() const { | |
669 return m_NonInheritedData.m_Bottom; | |
670 } | |
671 virtual FDE_CSSLENGTH GetLeft() const { return m_NonInheritedData.m_Left; } | |
672 virtual FDE_CSSLENGTH GetRight() const { return m_NonInheritedData.m_Right; } | |
673 | |
674 virtual void SetDisplay(FDE_CSSDISPLAY eDisplay) { | |
675 m_NonInheritedData.m_eDisplay = eDisplay; | |
676 } | |
677 virtual void SetBoxSize(const FDE_CSSSIZE& size) { | |
678 m_NonInheritedData.m_BoxSize = size; | |
679 } | |
680 virtual void SetMinBoxSize(const FDE_CSSSIZE& size) { | |
681 m_NonInheritedData.m_MinBoxSize = size; | |
682 } | |
683 virtual void SetMaxBoxSize(const FDE_CSSSIZE& size) { | |
684 m_NonInheritedData.m_MaxBoxSize = size; | |
685 } | |
686 virtual void SetFloat(FDE_CSSFLOAT eFloat) { | |
687 m_NonInheritedData.m_eFloat = eFloat; | |
688 } | |
689 virtual void SetClear(FDE_CSSCLEAR eClear) { | |
690 m_NonInheritedData.m_eClear = eClear; | |
691 } | |
692 virtual FX_FLOAT GetLineHeight() const { | |
693 return m_InheritedData.m_fLineHeight; | |
694 } | |
695 virtual FDE_CSSWHITESPACE GetWhiteSpace() const { | |
696 return (FDE_CSSWHITESPACE)m_InheritedData.m_eWhiteSpace; | |
697 } | |
698 virtual const FDE_CSSLENGTH& GetTextIndent() const { | |
699 return m_InheritedData.m_TextIndent; | |
700 } | |
701 virtual FDE_CSSTEXTALIGN GetTextAlign() const { | |
702 return (FDE_CSSTEXTALIGN)m_InheritedData.m_eTextAligh; | |
703 } | |
704 virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const { | |
705 return (FDE_CSSVERTICALALIGN)m_NonInheritedData.m_eVerticalAlign; | |
706 } | |
707 virtual FX_FLOAT GetNumberVerticalAlign() const { | |
708 return m_NonInheritedData.m_fVerticalAlign; | |
709 } | |
710 virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const { | |
711 return (FDE_CSSTEXTTRANSFORM)m_InheritedData.m_eTextTransform; | |
712 } | |
713 virtual FX_DWORD GetTextDecoration() const { | |
714 return m_NonInheritedData.m_dwTextDecoration; | |
715 } | |
716 virtual const FDE_CSSLENGTH& GetLetterSpacing() const { | |
717 return m_InheritedData.m_LetterSpacing; | |
718 } | |
719 virtual const FDE_CSSLENGTH& GetWordSpacing() const { | |
720 return m_InheritedData.m_WordSpacing; | |
721 } | |
722 virtual FDE_CSSWRITINGMODE GetWritingMode() const { | |
723 return (FDE_CSSWRITINGMODE)m_InheritedData.m_eWritingMode; | |
724 } | |
725 virtual FDE_CSSWORDBREAK GetWordBreak() const { | |
726 return (FDE_CSSWORDBREAK)m_InheritedData.m_eWordBreak; | |
727 } | |
728 virtual int32_t GetWidows() const { return m_InheritedData.m_iWidows; } | |
729 virtual FX_ARGB GetTextEmphasisColor() const { | |
730 return m_InheritedData.m_bTextEmphasisColorCurrent | |
731 ? m_InheritedData.m_dwFontColor | |
732 : m_InheritedData.m_dwTextEmphasisColor; | |
733 } | |
734 virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const { | |
735 return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakBefore; | |
736 } | |
737 virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const { | |
738 return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakAfter; | |
739 } | |
740 virtual FDE_CSSPAGEBREAK GetPageBreakInside() const { | |
741 return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakInside; | |
742 } | |
743 virtual int32_t GetOrphans() const { return m_InheritedData.m_iOrphans; } | |
744 virtual FDE_CSSLINEBREAK GetLineBreak() const { | |
745 return (FDE_CSSLINEBREAK)m_InheritedData.m_eLineBreak; | |
746 } | |
747 virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const; | |
748 virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const { | |
749 return (FDE_CSSTEXTEMPHASISFILL)m_InheritedData.m_eTextEmphasisFill; | |
750 } | |
751 virtual const FX_WCHAR* GetTextEmphasisCustom() const { | |
752 FXSYS_assert(m_InheritedData.m_eTextEmphasisMark == | |
753 FDE_CSSTEXTEMPHASISMARK_Custom); | |
754 return m_InheritedData.m_pszTextEmphasisCustomMark; | |
755 } | |
756 virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const { | |
757 return (FDE_CSSTEXTCOMBINE)m_NonInheritedData.m_eTextCombine; | |
758 } | |
759 virtual FX_BOOL HasTextCombineNumber() const { | |
760 return m_NonInheritedData.m_bHasTextCombineNumber; | |
761 } | |
762 virtual FX_FLOAT GetTextCombineNumber() const { | |
763 FXSYS_assert(m_NonInheritedData.m_eTextCombine == | |
764 FDE_CSSTEXTCOMBINE_Horizontal); | |
765 return m_NonInheritedData.m_fTextCombineNumber; | |
766 } | |
767 virtual void SetLineHeight(FX_FLOAT fLineHeight) { | |
768 m_InheritedData.m_fLineHeight = fLineHeight; | |
769 } | |
770 virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) { | |
771 m_InheritedData.m_eWhiteSpace = eWhiteSpace; | |
772 } | |
773 virtual void SetTextIndent(const FDE_CSSLENGTH& textIndent) { | |
774 m_InheritedData.m_TextIndent = textIndent; | |
775 } | |
776 virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) { | |
777 m_InheritedData.m_eTextAligh = eTextAlign; | |
778 } | |
779 virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) { | |
780 m_NonInheritedData.m_eVerticalAlign = eVerticalAlign; | |
781 } | |
782 virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) { | |
783 m_NonInheritedData.m_eVerticalAlign = FDE_CSSVERTICALALIGN_Number, | |
784 m_NonInheritedData.m_fVerticalAlign = fAlign; | |
785 } | |
786 virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) { | |
787 m_InheritedData.m_eTextTransform = eTextTransform; | |
788 } | |
789 virtual void SetTextDecoration(FX_DWORD dwTextDecoration) { | |
790 m_NonInheritedData.m_dwTextDecoration = dwTextDecoration; | |
791 } | |
792 virtual void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) { | |
793 m_InheritedData.m_LetterSpacing = letterSpacing; | |
794 } | |
795 virtual void SetWordSpacing(const FDE_CSSLENGTH& wordSpacing) { | |
796 m_InheritedData.m_WordSpacing = wordSpacing; | |
797 } | |
798 virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) { | |
799 m_InheritedData.m_eWritingMode = eWritingMode; | |
800 } | |
801 virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) { | |
802 m_InheritedData.m_eWordBreak = eWordBreak; | |
803 } | |
804 virtual void SetWidows(int32_t iWidows) { | |
805 m_InheritedData.m_iWidows = iWidows; | |
806 } | |
807 virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) { | |
808 m_InheritedData.m_dwTextEmphasisColor = dwTextEmphasisColor, | |
809 m_InheritedData.m_bTextEmphasisColorCurrent = FALSE; | |
810 } | |
811 virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) { | |
812 m_NonInheritedData.m_ePageBreakBefore = ePageBreakBefore; | |
813 } | |
814 virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) { | |
815 m_NonInheritedData.m_ePageBreakAfter = ePageBreakAfter; | |
816 } | |
817 virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) { | |
818 m_NonInheritedData.m_ePageBreakInside = ePageBreakInside; | |
819 } | |
820 virtual void SetOrphans(int32_t iOrphans) { | |
821 m_InheritedData.m_iOrphans = iOrphans; | |
822 } | |
823 virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) { | |
824 m_InheritedData.m_eLineBreak = eLineBreak; | |
825 } | |
826 virtual FX_ARGB GetBKGColor() const { | |
827 return m_NonInheritedData.m_dwBKGColor; | |
828 } | |
829 virtual const FX_WCHAR* GetBKGImage() const { | |
830 return m_NonInheritedData.m_pszBKGImage; | |
831 } | |
832 virtual const FDE_CSSPOINT& GetBKGPosition() const { | |
833 return m_NonInheritedData.m_BKGPosition; | |
834 } | |
835 virtual FDE_CSSBKGREPEAT GetBKGRepeat() const { | |
836 return (FDE_CSSBKGREPEAT)m_NonInheritedData.m_eBKGRepeat; | |
837 } | |
838 virtual FDE_CSSBKGATTACHMENT GetBKGAttachment() const { | |
839 return (FDE_CSSBKGATTACHMENT)m_NonInheritedData.m_eBKGAttachment; | |
840 } | |
841 virtual void SetBKGColor(FX_ARGB dwBKGColor) { | |
842 m_NonInheritedData.m_dwBKGColor = dwBKGColor; | |
843 } | |
844 virtual void SetBKGPosition(const FDE_CSSPOINT& bkgPosition) { | |
845 m_NonInheritedData.m_BKGPosition = bkgPosition; | |
846 } | |
847 virtual FDE_CSSVISIBILITY GetVisibility() const { | |
848 return (FDE_CSSVISIBILITY)m_InheritedData.m_eVisibility; | |
849 } | |
850 virtual FDE_CSSOVERFLOW GetOverflowX() const { | |
851 return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowX; | |
852 } | |
853 virtual FDE_CSSOVERFLOW GetOverflowY() const { | |
854 return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowY; | |
855 } | |
856 virtual int32_t CountCursorUrls() const { | |
857 return m_InheritedData.m_pCursorUris == NULL | |
858 ? 0 | |
859 : m_InheritedData.m_pCursorUris->CountValues(); | |
860 } | |
861 virtual const FX_WCHAR* GetCursorUrl(int32_t index) const { | |
862 FXSYS_assert(m_InheritedData.m_pCursorUris != NULL); | |
863 return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pCursorUris->GetValue( | |
864 index))) | |
865 ->GetString(index); | |
866 } | |
867 virtual FDE_CSSCURSOR GetCursorType() const { | |
868 return m_InheritedData.m_eCursor; | |
869 } | |
870 virtual void SetVisibility(FDE_CSSVISIBILITY eVisibility) { | |
871 m_InheritedData.m_eVisibility = eVisibility; | |
872 } | |
873 virtual FDE_CSSLISTSTYLETYPE GetListStyleType() const { | |
874 return (FDE_CSSLISTSTYLETYPE)m_NonInheritedData.m_eListStyleType; | |
875 } | |
876 virtual FDE_CSSLISTSTYLEPOSITION GetListStylePosition() const { | |
877 return (FDE_CSSLISTSTYLEPOSITION)m_NonInheritedData.m_eListStylePosition; | |
878 } | |
879 virtual const FX_WCHAR* GetListStyleImage() const { | |
880 return m_InheritedData.m_pszListStyleImage; | |
881 } | |
882 virtual void SetListStyleType(FDE_CSSLISTSTYLETYPE eListStyleType) { | |
883 m_NonInheritedData.m_eListStyleType = eListStyleType; | |
884 } | |
885 virtual void SetListStylePosition( | |
886 FDE_CSSLISTSTYLEPOSITION eListStylePosition) { | |
887 m_NonInheritedData.m_eListStylePosition = eListStylePosition; | |
888 } | |
889 void AddCustomStyle(const CFX_WideString& wsName, | |
890 const CFX_WideString& wsValue) { | |
891 m_CustomProperties.Add(wsName); | |
892 m_CustomProperties.Add(wsValue); | |
893 } | |
894 FX_DWORD m_dwRefCount; | |
895 IFX_MEMAllocator* m_pAllocator; | |
896 CFDE_CSSInheritedData m_InheritedData; | |
897 CFDE_CSSNonInheritedData m_NonInheritedData; | |
898 CFX_WideStringArray m_CustomProperties; | |
899 }; | |
900 | |
901 #endif // XFA_SRC_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ | |
OLD | NEW |