| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ | 7 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ |
| 8 #define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ | 8 #define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 uint32_t dwPos); | 27 uint32_t dwPos); |
| 28 | 28 |
| 29 CFDE_CSSSelector* pSelector; | 29 CFDE_CSSSelector* pSelector; |
| 30 CFDE_CSSDeclaration* pDeclaration; | 30 CFDE_CSSDeclaration* pDeclaration; |
| 31 uint32_t dwPriority; | 31 uint32_t dwPriority; |
| 32 FDE_CSSRuleData* pNext; | 32 FDE_CSSRuleData* pNext; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class CFDE_CSSRuleCollection : public CFX_Target { | 35 class CFDE_CSSRuleCollection : public CFX_Target { |
| 36 public: | 36 public: |
| 37 CFDE_CSSRuleCollection() | 37 CFDE_CSSRuleCollection(); |
| 38 : m_pStaticStore(nullptr), | 38 ~CFDE_CSSRuleCollection() override; |
| 39 m_pUniversalRules(nullptr), | |
| 40 m_pPersudoRules(nullptr), | |
| 41 m_iSelectors(0) {} | |
| 42 ~CFDE_CSSRuleCollection() { Clear(); } | |
| 43 | 39 |
| 44 void AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets, | 40 void AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets, |
| 45 uint32_t dwMediaList, | 41 uint32_t dwMediaList, |
| 46 IFGAS_FontMgr* pFontMgr); | 42 IFGAS_FontMgr* pFontMgr); |
| 47 void Clear(); | 43 void Clear(); |
| 48 | 44 |
| 49 int32_t CountSelectors() const { return m_iSelectors; } | 45 int32_t CountSelectors() const { return m_iSelectors; } |
| 50 FDE_CSSRuleData* GetIDRuleData(uint32_t dwIDHash) { | 46 FDE_CSSRuleData* GetIDRuleData(uint32_t dwIDHash) { |
| 51 void* pData; | 47 void* pData; |
| 52 return m_IDRules.Lookup((void*)(uintptr_t)dwIDHash, pData) | 48 return m_IDRules.Lookup((void*)(uintptr_t)dwIDHash, pData) |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 200 |
| 205 const FX_WCHAR* m_pszIdent; | 201 const FX_WCHAR* m_pszIdent; |
| 206 FX_BOOL m_bIncrement; | 202 FX_BOOL m_bIncrement; |
| 207 FX_BOOL m_bReset; | 203 FX_BOOL m_bReset; |
| 208 int32_t m_iIncVal; | 204 int32_t m_iIncVal; |
| 209 int32_t m_iResetVal; | 205 int32_t m_iResetVal; |
| 210 }; | 206 }; |
| 211 | 207 |
| 212 class CFDE_CSSCounterStyle { | 208 class CFDE_CSSCounterStyle { |
| 213 public: | 209 public: |
| 214 CFDE_CSSCounterStyle() : m_pCounterInc(nullptr), m_pCounterReset(nullptr) {} | 210 CFDE_CSSCounterStyle(); |
| 211 ~CFDE_CSSCounterStyle(); |
| 215 | 212 |
| 216 void SetCounterIncrementList(IFDE_CSSValueList* pList) { | 213 void SetCounterIncrementList(IFDE_CSSValueList* pList) { |
| 217 m_pCounterInc = pList; | 214 m_pCounterInc = pList; |
| 218 m_bIndexDirty = TRUE; | 215 m_bIndexDirty = TRUE; |
| 219 } | 216 } |
| 220 | |
| 221 void SetCounterResetList(IFDE_CSSValueList* pList) { | 217 void SetCounterResetList(IFDE_CSSValueList* pList) { |
| 222 m_pCounterReset = pList; | 218 m_pCounterReset = pList; |
| 223 m_bIndexDirty = TRUE; | 219 m_bIndexDirty = TRUE; |
| 224 } | 220 } |
| 225 | |
| 226 int32_t CountCounters() { | 221 int32_t CountCounters() { |
| 227 UpdateIndex(); | 222 UpdateIndex(); |
| 228 return m_arrCounterData.GetSize(); | 223 return m_arrCounterData.GetSize(); |
| 229 } | 224 } |
| 230 | |
| 231 FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) { | 225 FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) { |
| 232 UpdateIndex(); | 226 UpdateIndex(); |
| 233 return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue); | 227 return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue); |
| 234 } | 228 } |
| 235 | |
| 236 FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) { | 229 FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) { |
| 237 UpdateIndex(); | 230 UpdateIndex(); |
| 238 return m_arrCounterData.ElementAt(index).GetCounterReset(iValue); | 231 return m_arrCounterData.ElementAt(index).GetCounterReset(iValue); |
| 239 } | 232 } |
| 240 | |
| 241 const FX_WCHAR* GetCounterIdentifier(int32_t index) { | 233 const FX_WCHAR* GetCounterIdentifier(int32_t index) { |
| 242 UpdateIndex(); | 234 UpdateIndex(); |
| 243 return m_arrCounterData.ElementAt(index).m_pszIdent; | 235 return m_arrCounterData.ElementAt(index).m_pszIdent; |
| 244 } | 236 } |
| 245 | 237 |
| 246 protected: | 238 protected: |
| 247 void UpdateIndex(); | 239 void UpdateIndex(); |
| 248 void DoUpdateIndex(IFDE_CSSValueList* pList); | 240 void DoUpdateIndex(IFDE_CSSValueList* pList); |
| 249 int32_t FindIndex(const FX_WCHAR* pszIdentifier); | 241 int32_t FindIndex(const FX_WCHAR* pszIdentifier); |
| 250 | 242 |
| 251 IFDE_CSSValueList* m_pCounterInc; | 243 IFDE_CSSValueList* m_pCounterInc; |
| 252 IFDE_CSSValueList* m_pCounterReset; | 244 IFDE_CSSValueList* m_pCounterReset; |
| 253 CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData; | 245 CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData; |
| 254 FX_BOOL m_bIndexDirty; | 246 FX_BOOL m_bIndexDirty; |
| 255 }; | 247 }; |
| 256 | 248 |
| 257 class CFDE_CSSInheritedData { | 249 class CFDE_CSSInheritedData { |
| 258 public: | 250 public: |
| 259 void Reset() { | 251 CFDE_CSSInheritedData(); |
| 260 FXSYS_memset(this, 0, sizeof(CFDE_CSSInheritedData)); | 252 |
| 261 m_LetterSpacing.Set(FDE_CSSLENGTHUNIT_Normal); | 253 void Reset(); |
| 262 m_WordSpacing.Set(FDE_CSSLENGTHUNIT_Normal); | |
| 263 m_TextIndent.Set(FDE_CSSLENGTHUNIT_Point, 0); | |
| 264 m_fFontSize = 12.0f; | |
| 265 m_fLineHeight = 14.0f; | |
| 266 m_wFontWeight = 400; | |
| 267 m_dwFontColor = 0xFF000000; | |
| 268 m_iWidows = 2; | |
| 269 m_bTextEmphasisColorCurrent = TRUE; | |
| 270 m_iOrphans = 2; | |
| 271 } | |
| 272 | 254 |
| 273 const FX_WCHAR* m_pszListStyleImage; | 255 const FX_WCHAR* m_pszListStyleImage; |
| 274 FDE_CSSLENGTH m_LetterSpacing; | 256 FDE_CSSLENGTH m_LetterSpacing; |
| 275 FDE_CSSLENGTH m_WordSpacing; | 257 FDE_CSSLENGTH m_WordSpacing; |
| 276 FDE_CSSLENGTH m_TextIndent; | 258 FDE_CSSLENGTH m_TextIndent; |
| 277 IFDE_CSSValueList* m_pFontFamily; | 259 IFDE_CSSValueList* m_pFontFamily; |
| 278 IFDE_CSSValueList* m_pQuotes; | 260 IFDE_CSSValueList* m_pQuotes; |
| 279 IFDE_CSSValueList* m_pCursorUris; | 261 IFDE_CSSValueList* m_pCursorUris; |
| 280 FDE_CSSCURSOR m_eCursor; | 262 FDE_CSSCURSOR m_eCursor; |
| 281 FX_FLOAT m_fFontSize; | 263 FX_FLOAT m_fFontSize; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 299 uint32_t m_eTextEmphasisFill : 1; | 281 uint32_t m_eTextEmphasisFill : 1; |
| 300 uint32_t m_eTextEmphasisMark : 3; | 282 uint32_t m_eTextEmphasisMark : 3; |
| 301 uint32_t m_eCaptionSide : 3; | 283 uint32_t m_eCaptionSide : 3; |
| 302 uint8_t m_eRubyAlign : 4; | 284 uint8_t m_eRubyAlign : 4; |
| 303 uint8_t m_eRubyOverhang : 2; | 285 uint8_t m_eRubyOverhang : 2; |
| 304 uint8_t m_eRubyPosition : 2; | 286 uint8_t m_eRubyPosition : 2; |
| 305 }; | 287 }; |
| 306 | 288 |
| 307 class CFDE_CSSNonInheritedData { | 289 class CFDE_CSSNonInheritedData { |
| 308 public: | 290 public: |
| 309 void Reset() { | 291 CFDE_CSSNonInheritedData(); |
| 310 FXSYS_memset(this, 0, sizeof(CFDE_CSSNonInheritedData)); | 292 |
| 311 m_MarginWidth = m_BorderWidth = | 293 void Reset(); |
| 312 m_PaddingWidth.Set(FDE_CSSLENGTHUNIT_Point, 0); | |
| 313 m_MinBoxSize.Set(FDE_CSSLENGTHUNIT_Point, 0); | |
| 314 m_MaxBoxSize.Set(FDE_CSSLENGTHUNIT_None); | |
| 315 m_eDisplay = FDE_CSSDISPLAY_Inline; | |
| 316 m_fVerticalAlign = 0.0f; | |
| 317 m_ColumnCount.Set(FDE_CSSLENGTHUNIT_Auto); | |
| 318 m_ColumnGap.Set(FDE_CSSLENGTHUNIT_Normal); | |
| 319 m_bColumnRuleColorSame = TRUE; | |
| 320 m_ColumnWidth.Set(FDE_CSSLENGTHUNIT_Auto); | |
| 321 m_ColumnRuleWidth.Set(FDE_CSSLENGTHUNIT_Auto); | |
| 322 m_eTextCombine = FDE_CSSTEXTCOMBINE_None; | |
| 323 } | |
| 324 | 294 |
| 325 IFDE_CSSValueList* m_pContentList; | 295 IFDE_CSSValueList* m_pContentList; |
| 326 CFDE_CSSCounterStyle* m_pCounterStyle; | 296 CFDE_CSSCounterStyle* m_pCounterStyle; |
| 327 FDE_CSSRECT m_MarginWidth; | 297 FDE_CSSRECT m_MarginWidth; |
| 328 FDE_CSSRECT m_BorderWidth; | 298 FDE_CSSRECT m_BorderWidth; |
| 329 FDE_CSSRECT m_PaddingWidth; | 299 FDE_CSSRECT m_PaddingWidth; |
| 330 FDE_CSSSIZE m_BoxSize; | 300 FDE_CSSSIZE m_BoxSize; |
| 331 FDE_CSSSIZE m_MinBoxSize; | 301 FDE_CSSSIZE m_MinBoxSize; |
| 332 FDE_CSSSIZE m_MaxBoxSize; | 302 FDE_CSSSIZE m_MaxBoxSize; |
| 333 FDE_CSSPOINT m_BKGPosition; | 303 FDE_CSSPOINT m_BKGPosition; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 uint32_t m_bHasTextCombineNumber : 1; | 348 uint32_t m_bHasTextCombineNumber : 1; |
| 379 }; | 349 }; |
| 380 | 350 |
| 381 class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, | 351 class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, |
| 382 public IFDE_CSSBoundaryStyle, | 352 public IFDE_CSSBoundaryStyle, |
| 383 public IFDE_CSSFontStyle, | 353 public IFDE_CSSFontStyle, |
| 384 public IFDE_CSSPositionStyle, | 354 public IFDE_CSSPositionStyle, |
| 385 public IFDE_CSSParagraphStyle, | 355 public IFDE_CSSParagraphStyle, |
| 386 public CFX_Target { | 356 public CFX_Target { |
| 387 public: | 357 public: |
| 388 CFDE_CSSComputedStyle(IFX_MemoryAllocator* pAlloc) | 358 CFDE_CSSComputedStyle(IFX_MemoryAllocator* pAlloc); |
| 389 : m_dwRefCount(1), m_pAllocator(pAlloc) {} | 359 ~CFDE_CSSComputedStyle() override; |
| 390 | 360 |
| 391 ~CFDE_CSSComputedStyle() override {} | 361 // IFX_Retainable |
| 362 uint32_t Retain() override; |
| 363 uint32_t Release() override; |
| 392 | 364 |
| 393 // IFX_Retainable: | 365 // IFDE_CSSComputedStyle |
| 394 uint32_t Retain() override { return ++m_dwRefCount; } | 366 void Reset() override; |
| 395 uint32_t Release() override { | 367 IFDE_CSSFontStyle* GetFontStyles() override; |
| 396 uint32_t dwRefCount = --m_dwRefCount; | 368 IFDE_CSSBoundaryStyle* GetBoundaryStyles() override; |
| 397 if (dwRefCount == 0) { | 369 IFDE_CSSPositionStyle* GetPositionStyles() override; |
| 398 delete m_NonInheritedData.m_pCounterStyle; | 370 IFDE_CSSParagraphStyle* GetParagraphStyles() override; |
| 399 FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this); | |
| 400 } | |
| 401 return dwRefCount; | |
| 402 } | |
| 403 | |
| 404 // IFDE_CSSComputedStyle: | |
| 405 void Reset() override { | |
| 406 m_InheritedData.Reset(); | |
| 407 m_NonInheritedData.Reset(); | |
| 408 } | |
| 409 | |
| 410 IFDE_CSSFontStyle* GetFontStyles() override { | |
| 411 return static_cast<IFDE_CSSFontStyle*>(this); | |
| 412 } | |
| 413 | |
| 414 IFDE_CSSBoundaryStyle* GetBoundaryStyles() override { | |
| 415 return static_cast<IFDE_CSSBoundaryStyle*>(this); | |
| 416 } | |
| 417 | |
| 418 IFDE_CSSPositionStyle* GetPositionStyles() override { | |
| 419 return static_cast<IFDE_CSSPositionStyle*>(this); | |
| 420 } | |
| 421 | |
| 422 IFDE_CSSParagraphStyle* GetParagraphStyles() override { | |
| 423 return static_cast<IFDE_CSSParagraphStyle*>(this); | |
| 424 } | |
| 425 | |
| 426 FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName, | 371 FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName, |
| 427 CFX_WideString& wsValue) const override { | 372 CFX_WideString& wsValue) const override; |
| 428 for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) { | |
| 429 if (wsName == m_CustomProperties[i]) { | |
| 430 wsValue = m_CustomProperties[i + 1]; | |
| 431 return TRUE; | |
| 432 } | |
| 433 } | |
| 434 return FALSE; | |
| 435 } | |
| 436 | 373 |
| 437 // IFDE_CSSFontStyle: | 374 // IFDE_CSSFontStyle: |
| 438 int32_t CountFontFamilies() const override { | 375 int32_t CountFontFamilies() const override; |
| 439 return m_InheritedData.m_pFontFamily | 376 const FX_WCHAR* GetFontFamily(int32_t index) const override; |
| 440 ? m_InheritedData.m_pFontFamily->CountValues() | 377 uint16_t GetFontWeight() const override; |
| 441 : 0; | 378 FDE_CSSFONTVARIANT GetFontVariant() const override; |
| 442 } | 379 FDE_CSSFONTSTYLE GetFontStyle() const override; |
| 443 | 380 FX_FLOAT GetFontSize() const override; |
| 444 const FX_WCHAR* GetFontFamily(int32_t index) const override { | 381 FX_ARGB GetColor() const override; |
| 445 return (static_cast<IFDE_CSSPrimitiveValue*>( | 382 void SetFontWeight(uint16_t wFontWeight) override; |
| 446 m_InheritedData.m_pFontFamily->GetValue(index))) | 383 void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) override; |
| 447 ->GetString(index); | 384 void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) override; |
| 448 } | 385 void SetFontSize(FX_FLOAT fFontSize) override; |
| 449 | 386 void SetColor(FX_ARGB dwFontColor) override; |
| 450 uint16_t GetFontWeight() const override { | |
| 451 return m_InheritedData.m_wFontWeight; | |
| 452 } | |
| 453 | |
| 454 FDE_CSSFONTVARIANT GetFontVariant() const override { | |
| 455 return static_cast<FDE_CSSFONTVARIANT>(m_InheritedData.m_eFontVariant); | |
| 456 } | |
| 457 | |
| 458 FDE_CSSFONTSTYLE GetFontStyle() const override { | |
| 459 return static_cast<FDE_CSSFONTSTYLE>(m_InheritedData.m_eFontStyle); | |
| 460 } | |
| 461 | |
| 462 FX_FLOAT GetFontSize() const override { return m_InheritedData.m_fFontSize; } | |
| 463 | |
| 464 FX_ARGB GetColor() const override { return m_InheritedData.m_dwFontColor; } | |
| 465 | |
| 466 void SetFontWeight(uint16_t wFontWeight) override { | |
| 467 m_InheritedData.m_wFontWeight = wFontWeight; | |
| 468 } | |
| 469 | |
| 470 void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) override { | |
| 471 m_InheritedData.m_eFontVariant = eFontVariant; | |
| 472 } | |
| 473 | |
| 474 void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) override { | |
| 475 m_InheritedData.m_eFontStyle = eFontStyle; | |
| 476 } | |
| 477 | |
| 478 void SetFontSize(FX_FLOAT fFontSize) override { | |
| 479 m_InheritedData.m_fFontSize = fFontSize; | |
| 480 } | |
| 481 | |
| 482 void SetColor(FX_ARGB dwFontColor) override { | |
| 483 m_InheritedData.m_dwFontColor = dwFontColor; | |
| 484 } | |
| 485 | 387 |
| 486 // IFDE_CSSBoundaryStyle: | 388 // IFDE_CSSBoundaryStyle: |
| 487 const FDE_CSSRECT* GetBorderWidth() const override { | 389 const FDE_CSSRECT* GetBorderWidth() const override; |
| 488 return m_NonInheritedData.m_bHasBorder ? &(m_NonInheritedData.m_BorderWidth) | 390 const FDE_CSSRECT* GetMarginWidth() const override; |
| 489 : nullptr; | 391 const FDE_CSSRECT* GetPaddingWidth() const override; |
| 490 } | 392 void SetMarginWidth(const FDE_CSSRECT& rect) override; |
| 491 | 393 void SetPaddingWidth(const FDE_CSSRECT& rect) override; |
| 492 const FDE_CSSRECT* GetMarginWidth() const override { | |
| 493 return m_NonInheritedData.m_bHasMargin ? &(m_NonInheritedData.m_MarginWidth) | |
| 494 : nullptr; | |
| 495 } | |
| 496 | |
| 497 const FDE_CSSRECT* GetPaddingWidth() const override { | |
| 498 return m_NonInheritedData.m_bHasPadding | |
| 499 ? &(m_NonInheritedData.m_PaddingWidth) | |
| 500 : nullptr; | |
| 501 } | |
| 502 | |
| 503 void SetMarginWidth(const FDE_CSSRECT& rect) override { | |
| 504 m_NonInheritedData.m_MarginWidth = rect; | |
| 505 m_NonInheritedData.m_bHasMargin = TRUE; | |
| 506 } | |
| 507 | |
| 508 void SetPaddingWidth(const FDE_CSSRECT& rect) override { | |
| 509 m_NonInheritedData.m_PaddingWidth = rect; | |
| 510 m_NonInheritedData.m_bHasPadding = TRUE; | |
| 511 } | |
| 512 | 394 |
| 513 // IFDE_CSSPositionStyle: | 395 // IFDE_CSSPositionStyle: |
| 514 FDE_CSSDISPLAY GetDisplay() const override { | 396 FDE_CSSDISPLAY GetDisplay() const override; |
| 515 return static_cast<FDE_CSSDISPLAY>(m_NonInheritedData.m_eDisplay); | |
| 516 } | |
| 517 | 397 |
| 518 // IFDE_CSSParagraphStyle: | 398 // IFDE_CSSParagraphStyle: |
| 519 FX_FLOAT GetLineHeight() const override { | 399 FX_FLOAT GetLineHeight() const override; |
| 520 return m_InheritedData.m_fLineHeight; | 400 const FDE_CSSLENGTH& GetTextIndent() const override; |
| 521 } | 401 FDE_CSSTEXTALIGN GetTextAlign() const override; |
| 522 | 402 FDE_CSSVERTICALALIGN GetVerticalAlign() const override; |
| 523 const FDE_CSSLENGTH& GetTextIndent() const override { | 403 FX_FLOAT GetNumberVerticalAlign() const override; |
| 524 return m_InheritedData.m_TextIndent; | 404 uint32_t GetTextDecoration() const override; |
| 525 } | 405 const FDE_CSSLENGTH& GetLetterSpacing() const override; |
| 526 | 406 void SetLineHeight(FX_FLOAT fLineHeight) override; |
| 527 FDE_CSSTEXTALIGN GetTextAlign() const override { | 407 void SetTextIndent(const FDE_CSSLENGTH& textIndent) override; |
| 528 return static_cast<FDE_CSSTEXTALIGN>(m_InheritedData.m_eTextAligh); | 408 void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) override; |
| 529 } | 409 void SetNumberVerticalAlign(FX_FLOAT fAlign) override; |
| 530 | 410 void SetTextDecoration(uint32_t dwTextDecoration) override; |
| 531 FDE_CSSVERTICALALIGN GetVerticalAlign() const override { | 411 void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) override; |
| 532 return static_cast<FDE_CSSVERTICALALIGN>( | |
| 533 m_NonInheritedData.m_eVerticalAlign); | |
| 534 } | |
| 535 | |
| 536 FX_FLOAT GetNumberVerticalAlign() const override { | |
| 537 return m_NonInheritedData.m_fVerticalAlign; | |
| 538 } | |
| 539 | |
| 540 uint32_t GetTextDecoration() const override { | |
| 541 return m_NonInheritedData.m_dwTextDecoration; | |
| 542 } | |
| 543 | |
| 544 const FDE_CSSLENGTH& GetLetterSpacing() const override { | |
| 545 return m_InheritedData.m_LetterSpacing; | |
| 546 } | |
| 547 | |
| 548 void SetLineHeight(FX_FLOAT fLineHeight) override { | |
| 549 m_InheritedData.m_fLineHeight = fLineHeight; | |
| 550 } | |
| 551 | |
| 552 void SetTextIndent(const FDE_CSSLENGTH& textIndent) override { | |
| 553 m_InheritedData.m_TextIndent = textIndent; | |
| 554 } | |
| 555 | |
| 556 void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) override { | |
| 557 m_InheritedData.m_eTextAligh = eTextAlign; | |
| 558 } | |
| 559 | |
| 560 void SetNumberVerticalAlign(FX_FLOAT fAlign) override { | |
| 561 m_NonInheritedData.m_eVerticalAlign = FDE_CSSVERTICALALIGN_Number, | |
| 562 m_NonInheritedData.m_fVerticalAlign = fAlign; | |
| 563 } | |
| 564 | |
| 565 void SetTextDecoration(uint32_t dwTextDecoration) override { | |
| 566 m_NonInheritedData.m_dwTextDecoration = dwTextDecoration; | |
| 567 } | |
| 568 | |
| 569 void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) override { | |
| 570 m_InheritedData.m_LetterSpacing = letterSpacing; | |
| 571 } | |
| 572 | |
| 573 void AddCustomStyle(const CFX_WideString& wsName, | 412 void AddCustomStyle(const CFX_WideString& wsName, |
| 574 const CFX_WideString& wsValue) { | 413 const CFX_WideString& wsValue); |
| 575 m_CustomProperties.Add(wsName); | |
| 576 m_CustomProperties.Add(wsValue); | |
| 577 } | |
| 578 | 414 |
| 579 uint32_t m_dwRefCount; | 415 uint32_t m_dwRefCount; |
| 580 IFX_MemoryAllocator* m_pAllocator; | 416 IFX_MemoryAllocator* m_pAllocator; |
| 581 CFDE_CSSInheritedData m_InheritedData; | 417 CFDE_CSSInheritedData m_InheritedData; |
| 582 CFDE_CSSNonInheritedData m_NonInheritedData; | 418 CFDE_CSSNonInheritedData m_NonInheritedData; |
| 583 CFX_WideStringArray m_CustomProperties; | 419 CFX_WideStringArray m_CustomProperties; |
| 584 }; | 420 }; |
| 585 | 421 |
| 586 #endif // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ | 422 #endif // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ |
| OLD | NEW |