diff options
Diffstat (limited to 'xfa/fde/css/fde_cssstyleselector.h')
-rw-r--r-- | xfa/fde/css/fde_cssstyleselector.h | 117 |
1 files changed, 53 insertions, 64 deletions
diff --git a/xfa/fde/css/fde_cssstyleselector.h b/xfa/fde/css/fde_cssstyleselector.h index 185ba75ba3..6c06f0e4e2 100644 --- a/xfa/fde/css/fde_cssstyleselector.h +++ b/xfa/fde/css/fde_cssstyleselector.h @@ -37,7 +37,7 @@ class CFDE_CSSRuleCollection { CFDE_CSSRuleCollection(); ~CFDE_CSSRuleCollection(); - void AddRulesFrom(const CFX_ArrayTemplate<IFDE_CSSStyleSheet*>& sheets, + void AddRulesFrom(const CFX_ArrayTemplate<CFDE_CSSStyleSheet*>& sheets, uint32_t dwMediaList, CFGAS_FontMgr* pFontMgr); void Clear(); @@ -62,7 +62,7 @@ class CFDE_CSSRuleCollection { FDE_CSSRuleData* GetPseudoRuleData() { return m_pPseudoRules; } protected: - void AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet, + void AddRulesFrom(CFDE_CSSStyleSheet* pStyleSheet, IFDE_CSSRule* pRule, uint32_t dwMediaList, CFGAS_FontMgr* pFontMgr); @@ -89,15 +89,15 @@ class CFDE_CSSStyleSelector { void SetDefFontSize(FX_FLOAT fFontSize); - bool SetStyleSheet(FDE_CSSStyleSheetGroup eType, IFDE_CSSStyleSheet* pSheet); + bool SetStyleSheet(FDE_CSSStyleSheetGroup eType, CFDE_CSSStyleSheet* pSheet); bool SetStyleSheets(FDE_CSSStyleSheetGroup eType, - const CFX_ArrayTemplate<IFDE_CSSStyleSheet*>* pArray); + const CFX_ArrayTemplate<CFDE_CSSStyleSheet*>* pArray); void SetStylePriority(FDE_CSSStyleSheetGroup eType, FDE_CSSStyleSheetPriority ePriority); void UpdateStyleIndex(uint32_t dwMediaList); CFDE_CSSAccelerator* InitAccelerator(); - IFDE_CSSComputedStyle* CreateComputedStyle( - IFDE_CSSComputedStyle* pParentStyle); + CFDE_CSSComputedStyle* CreateComputedStyle( + CFDE_CSSComputedStyle* pParentStyle); int32_t MatchDeclarations( CXFA_CSSTagProvider* pTag, CFX_ArrayTemplate<CFDE_CSSDeclaration*>& matchedDecls, @@ -105,7 +105,7 @@ class CFDE_CSSStyleSelector { void ComputeStyle(CXFA_CSSTagProvider* pTag, const CFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount, - IFDE_CSSComputedStyle* pDestStyle); + CFDE_CSSComputedStyle* pDestStyle); protected: void Reset(); @@ -121,7 +121,7 @@ class CFDE_CSSStyleSelector { void ApplyDeclarations(bool bPriority, const CFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount, - IFDE_CSSComputedStyle* pDestStyle); + CFDE_CSSComputedStyle* pDestStyle); void ApplyProperty(FDE_CSSProperty eProperty, IFDE_CSSValue* pValue, CFDE_CSSComputedStyle* pComputedStyle); @@ -131,7 +131,7 @@ class CFDE_CSSStyleSelector { FX_FLOAT fPercentBase); bool SetLengthWithPercent(FDE_CSSLENGTH& width, FDE_CSSPrimitiveType eType, - IFDE_CSSPrimitiveValue* pPrimitive, + CFDE_CSSPrimitiveValue* pPrimitive, FX_FLOAT fFontSize); FX_FLOAT ToFontSize(FDE_CSSPropertyValue eValue, FX_FLOAT fCurFontSize); FDE_CSSDisplay ToDisplay(FDE_CSSPropertyValue eValue); @@ -139,12 +139,12 @@ class CFDE_CSSStyleSelector { uint16_t ToFontWeight(FDE_CSSPropertyValue eValue); FDE_CSSFontStyle ToFontStyle(FDE_CSSPropertyValue eValue); FDE_CSSVerticalAlign ToVerticalAlign(FDE_CSSPropertyValue eValue); - uint32_t ToTextDecoration(IFDE_CSSValueList* pList); + uint32_t ToTextDecoration(CFDE_CSSValueList* pList); FDE_CSSFontVariant ToFontVariant(FDE_CSSPropertyValue eValue); CFGAS_FontMgr* const m_pFontMgr; FX_FLOAT m_fDefFontSize; - CFX_ArrayTemplate<IFDE_CSSStyleSheet*> m_SheetGroups[3]; + CFX_ArrayTemplate<CFDE_CSSStyleSheet*> m_SheetGroups[3]; CFDE_CSSRuleCollection m_RuleCollection[3]; FDE_CSSStyleSheetGroup m_ePriorities[3]; std::unique_ptr<CFDE_CSSAccelerator> m_pAccelerator; @@ -158,7 +158,7 @@ class CFDE_CSSInheritedData { FDE_CSSLENGTH m_LetterSpacing; FDE_CSSLENGTH m_WordSpacing; FDE_CSSLENGTH m_TextIndent; - IFDE_CSSValueList* m_pFontFamily; + CFDE_CSSValueList* m_pFontFamily; FX_FLOAT m_fFontSize; FX_FLOAT m_fLineHeight; FX_ARGB m_dwFontColor; @@ -188,11 +188,7 @@ class CFDE_CSSNonInheritedData { bool m_bHasPadding; }; -class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, - public IFDE_CSSBoundaryStyle, - public IFDE_CSSFontStyle, - public IFDE_CSSPositionStyle, - public IFDE_CSSParagraphStyle { +class CFDE_CSSComputedStyle : public IFX_Retainable { public: CFDE_CSSComputedStyle(); ~CFDE_CSSComputedStyle() override; @@ -201,58 +197,51 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, uint32_t Retain() override; uint32_t Release() override; - // IFDE_CSSComputedStyle - IFDE_CSSFontStyle* GetFontStyles() override; - IFDE_CSSBoundaryStyle* GetBoundaryStyles() override; - IFDE_CSSPositionStyle* GetPositionStyles() override; - IFDE_CSSParagraphStyle* GetParagraphStyles() override; - bool GetCustomStyle(const CFX_WideStringC& wsName, - CFX_WideString& wsValue) const override; - - // IFDE_CSSFontStyle: - int32_t CountFontFamilies() const override; - const FX_WCHAR* GetFontFamily(int32_t index) const override; - uint16_t GetFontWeight() const override; - FDE_CSSFontVariant GetFontVariant() const override; - FDE_CSSFontStyle GetFontStyle() const override; - FX_FLOAT GetFontSize() const override; - FX_ARGB GetColor() const override; - void SetFontWeight(uint16_t wFontWeight) override; - void SetFontVariant(FDE_CSSFontVariant eFontVariant) override; - void SetFontStyle(FDE_CSSFontStyle eFontStyle) override; - void SetFontSize(FX_FLOAT fFontSize) override; - void SetColor(FX_ARGB dwFontColor) override; - - // IFDE_CSSBoundaryStyle: - const FDE_CSSRECT* GetBorderWidth() const override; - const FDE_CSSRECT* GetMarginWidth() const override; - const FDE_CSSRECT* GetPaddingWidth() const override; - void SetMarginWidth(const FDE_CSSRECT& rect) override; - void SetPaddingWidth(const FDE_CSSRECT& rect) override; - - // IFDE_CSSPositionStyle: - FDE_CSSDisplay GetDisplay() const override; - - // IFDE_CSSParagraphStyle: - FX_FLOAT GetLineHeight() const override; - const FDE_CSSLENGTH& GetTextIndent() const override; - FDE_CSSTextAlign GetTextAlign() const override; - FDE_CSSVerticalAlign GetVerticalAlign() const override; - FX_FLOAT GetNumberVerticalAlign() const override; - uint32_t GetTextDecoration() const override; - const FDE_CSSLENGTH& GetLetterSpacing() const override; - void SetLineHeight(FX_FLOAT fLineHeight) override; - void SetTextIndent(const FDE_CSSLENGTH& textIndent) override; - void SetTextAlign(FDE_CSSTextAlign eTextAlign) override; - void SetNumberVerticalAlign(FX_FLOAT fAlign) override; - void SetTextDecoration(uint32_t dwTextDecoration) override; - void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) override; + int32_t CountFontFamilies() const; + const FX_WCHAR* GetFontFamily(int32_t index) const; + uint16_t GetFontWeight() const; + FDE_CSSFontVariant GetFontVariant() const; + FDE_CSSFontStyle GetFontStyle() const; + FX_FLOAT GetFontSize() const; + FX_ARGB GetColor() const; + void SetFontWeight(uint16_t wFontWeight); + void SetFontVariant(FDE_CSSFontVariant eFontVariant); + void SetFontStyle(FDE_CSSFontStyle eFontStyle); + void SetFontSize(FX_FLOAT fFontSize); + void SetColor(FX_ARGB dwFontColor); + + const FDE_CSSRECT* GetBorderWidth() const; + const FDE_CSSRECT* GetMarginWidth() const; + const FDE_CSSRECT* GetPaddingWidth() const; + void SetMarginWidth(const FDE_CSSRECT& rect); + void SetPaddingWidth(const FDE_CSSRECT& rect); + + FDE_CSSDisplay GetDisplay() const; + + FX_FLOAT GetLineHeight() const; + const FDE_CSSLENGTH& GetTextIndent() const; + FDE_CSSTextAlign GetTextAlign() const; + FDE_CSSVerticalAlign GetVerticalAlign() const; + FX_FLOAT GetNumberVerticalAlign() const; + uint32_t GetTextDecoration() const; + const FDE_CSSLENGTH& GetLetterSpacing() const; + void SetLineHeight(FX_FLOAT fLineHeight); + void SetTextIndent(const FDE_CSSLENGTH& textIndent); + void SetTextAlign(FDE_CSSTextAlign eTextAlign); + void SetNumberVerticalAlign(FX_FLOAT fAlign); + void SetTextDecoration(uint32_t dwTextDecoration); + void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing); void AddCustomStyle(const CFX_WideString& wsName, const CFX_WideString& wsValue); - uint32_t m_dwRefCount; + bool GetCustomStyle(const CFX_WideStringC& wsName, + CFX_WideString& wsValue) const; + CFDE_CSSInheritedData m_InheritedData; CFDE_CSSNonInheritedData m_NonInheritedData; + + private: + uint32_t m_dwRefCount; std::vector<CFX_WideString> m_CustomProperties; }; |