diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-01-16 16:05:17 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-16 21:38:39 +0000 |
commit | 6efd0d7464e1f02ef3cd4f1abe5c6f8e5283fbbb (patch) | |
tree | b99dd792d1a36c1a0175dd89e18d95e286613ff3 /xfa/fde/css/fde_cssstylesheet.h | |
parent | cfb856c4744a9e0ff0f0db5602d0a13c835570ce (diff) | |
download | pdfium-6efd0d7464e1f02ef3cd4f1abe5c6f8e5283fbbb.tar.xz |
Replace remaining CSS interfaces with concrete classes
This Cl moves IFDE_CSSValue and IFDE_CSSRule to concrete classes and moves the
holding of the type into the base class.
Change-Id: Iea29cc55256dd2183b60ca8711367d5dc8daaa24
Reviewed-on: https://pdfium-review.googlesource.com/2178
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/css/fde_cssstylesheet.h')
-rw-r--r-- | xfa/fde/css/fde_cssstylesheet.h | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/xfa/fde/css/fde_cssstylesheet.h b/xfa/fde/css/fde_cssstylesheet.h index 2fc195c9dd..8cedb76526 100644 --- a/xfa/fde/css/fde_cssstylesheet.h +++ b/xfa/fde/css/fde_cssstylesheet.h @@ -11,6 +11,7 @@ #include <unordered_map> #include "core/fxcrt/fx_ext.h" +#include "xfa/fde/css/cfde_cssrule.h" #include "xfa/fde/css/fde_cssdeclaration.h" class CFDE_CSSSyntaxParser; @@ -38,13 +39,10 @@ class CFDE_CSSSelector { CFDE_CSSSelector* m_pNext; }; -class CFDE_CSSStyleRule : public IFDE_CSSRule { +class CFDE_CSSStyleRule : public CFDE_CSSRule { public: CFDE_CSSStyleRule(); - // IFDE_CSSRule - FDE_CSSRuleType GetType() const override; - int32_t CountSelectorLists() const; CFDE_CSSSelector* GetSelectorList(int32_t index) const; CFDE_CSSDeclaration* GetDeclaration(); @@ -57,29 +55,26 @@ class CFDE_CSSStyleRule : public IFDE_CSSRule { int32_t m_iSelectors; }; -class CFDE_CSSMediaRule : public IFDE_CSSRule { +class CFDE_CSSMediaRule : public CFDE_CSSRule { public: explicit CFDE_CSSMediaRule(uint32_t dwMediaList); ~CFDE_CSSMediaRule() override; - // IFDE_CSSValue - FDE_CSSRuleType GetType() const override; - uint32_t GetMediaList() const; int32_t CountRules() const; - IFDE_CSSRule* GetRule(int32_t index); + CFDE_CSSRule* GetRule(int32_t index); - CFX_MassArrayTemplate<IFDE_CSSRule*>& GetArray() { return m_RuleArray; } + CFX_MassArrayTemplate<CFDE_CSSRule*>& GetArray() { return m_RuleArray; } protected: uint32_t m_dwMediaList; - CFX_MassArrayTemplate<IFDE_CSSRule*> m_RuleArray; + CFX_MassArrayTemplate<CFDE_CSSRule*> m_RuleArray; }; -class CFDE_CSSFontFaceRule : public IFDE_CSSRule { +class CFDE_CSSFontFaceRule : public CFDE_CSSRule { public: - // IFDE_CSSRule. - FDE_CSSRuleType GetType() const override; + CFDE_CSSFontFaceRule(); + ~CFDE_CSSFontFaceRule() override; CFDE_CSSDeclaration& GetDeclImp() { return m_Declaration; } @@ -102,26 +97,26 @@ class CFDE_CSSStyleSheet : public IFX_Retainable { uint32_t GetMediaList() const; uint16_t GetCodePage() const; int32_t CountRules() const; - IFDE_CSSRule* GetRule(int32_t index); + CFDE_CSSRule* GetRule(int32_t index); private: void Reset(); bool LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax); FDE_CSSSyntaxStatus LoadStyleRule( CFDE_CSSSyntaxParser* pSyntax, - CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray); + CFX_MassArrayTemplate<CFDE_CSSRule*>& ruleArray); FDE_CSSSyntaxStatus LoadImportRule(CFDE_CSSSyntaxParser* pSyntax); FDE_CSSSyntaxStatus LoadPageRule(CFDE_CSSSyntaxParser* pSyntax); FDE_CSSSyntaxStatus LoadMediaRule(CFDE_CSSSyntaxParser* pSyntax); FDE_CSSSyntaxStatus LoadFontFaceRule( CFDE_CSSSyntaxParser* pSyntax, - CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray); + CFX_MassArrayTemplate<CFDE_CSSRule*>& ruleArray); FDE_CSSSyntaxStatus SkipRuleSet(CFDE_CSSSyntaxParser* pSyntax); uint16_t m_wCodePage; uint16_t m_wRefCount; uint32_t m_dwMediaList; - CFX_MassArrayTemplate<IFDE_CSSRule*> m_RuleArray; + CFX_MassArrayTemplate<CFDE_CSSRule*> m_RuleArray; CFX_WideString m_szUrl; CFX_ArrayTemplate<CFDE_CSSSelector*> m_Selectors; std::unordered_map<uint32_t, FX_WCHAR*> m_StringCache; |