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_CSSSTYLESHEET_H_ | 7 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ |
8 #define XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ | 8 #define XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target { | 97 class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target { |
98 public: | 98 public: |
99 CFDE_CSSStyleSheet(uint32_t dwMediaList); | 99 CFDE_CSSStyleSheet(uint32_t dwMediaList); |
100 ~CFDE_CSSStyleSheet() override; | 100 ~CFDE_CSSStyleSheet() override; |
101 | 101 |
102 // IFX_Retainable: | 102 // IFX_Retainable: |
103 uint32_t Retain() override; | 103 uint32_t Retain() override; |
104 uint32_t Release() override; | 104 uint32_t Release() override; |
105 | 105 |
106 // IFDE_CSSStyleSheet: | 106 // IFDE_CSSStyleSheet: |
107 FX_BOOL GetUrl(CFX_WideString& szUrl) override; | 107 bool GetUrl(CFX_WideString& szUrl) override; |
108 uint32_t GetMediaList() const override; | 108 uint32_t GetMediaList() const override; |
109 uint16_t GetCodePage() const override; | 109 uint16_t GetCodePage() const override; |
110 int32_t CountRules() const override; | 110 int32_t CountRules() const override; |
111 IFDE_CSSRule* GetRule(int32_t index) override; | 111 IFDE_CSSRule* GetRule(int32_t index) override; |
112 | 112 |
113 FX_BOOL LoadFromStream(const CFX_WideString& szUrl, | 113 bool LoadFromStream(const CFX_WideString& szUrl, |
114 IFX_Stream* pStream, | 114 IFX_Stream* pStream, |
115 uint16_t wCodePage); | 115 uint16_t wCodePage); |
116 FX_BOOL LoadFromBuffer(const CFX_WideString& szUrl, | 116 bool LoadFromBuffer(const CFX_WideString& szUrl, |
117 const FX_WCHAR* pBuffer, | 117 const FX_WCHAR* pBuffer, |
118 int32_t iBufSize, | 118 int32_t iBufSize, |
119 uint16_t wCodePage); | 119 uint16_t wCodePage); |
120 | 120 |
121 protected: | 121 protected: |
122 void Reset(); | 122 void Reset(); |
123 FX_BOOL LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax); | 123 bool LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax); |
124 FDE_CSSSYNTAXSTATUS LoadStyleRule( | 124 FDE_CSSSYNTAXSTATUS LoadStyleRule( |
125 CFDE_CSSSyntaxParser* pSyntax, | 125 CFDE_CSSSyntaxParser* pSyntax, |
126 CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray); | 126 CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray); |
127 FDE_CSSSYNTAXSTATUS LoadImportRule(CFDE_CSSSyntaxParser* pSyntax); | 127 FDE_CSSSYNTAXSTATUS LoadImportRule(CFDE_CSSSyntaxParser* pSyntax); |
128 FDE_CSSSYNTAXSTATUS LoadPageRule(CFDE_CSSSyntaxParser* pSyntax); | 128 FDE_CSSSYNTAXSTATUS LoadPageRule(CFDE_CSSSyntaxParser* pSyntax); |
129 FDE_CSSSYNTAXSTATUS LoadMediaRule(CFDE_CSSSyntaxParser* pSyntax); | 129 FDE_CSSSYNTAXSTATUS LoadMediaRule(CFDE_CSSSyntaxParser* pSyntax); |
130 FDE_CSSSYNTAXSTATUS LoadFontFaceRule( | 130 FDE_CSSSYNTAXSTATUS LoadFontFaceRule( |
131 CFDE_CSSSyntaxParser* pSyntax, | 131 CFDE_CSSSyntaxParser* pSyntax, |
132 CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray); | 132 CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray); |
133 FDE_CSSSYNTAXSTATUS SkipRuleSet(CFDE_CSSSyntaxParser* pSyntax); | 133 FDE_CSSSYNTAXSTATUS SkipRuleSet(CFDE_CSSSyntaxParser* pSyntax); |
134 uint16_t m_wCodePage; | 134 uint16_t m_wCodePage; |
135 uint16_t m_wRefCount; | 135 uint16_t m_wRefCount; |
136 uint32_t m_dwMediaList; | 136 uint32_t m_dwMediaList; |
137 std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; | 137 std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; |
138 CFX_MassArrayTemplate<IFDE_CSSRule*> m_RuleArray; | 138 CFX_MassArrayTemplate<IFDE_CSSRule*> m_RuleArray; |
139 CFX_WideString m_szUrl; | 139 CFX_WideString m_szUrl; |
140 CFX_ArrayTemplate<CFDE_CSSSelector*> m_Selectors; | 140 CFX_ArrayTemplate<CFDE_CSSSelector*> m_Selectors; |
141 std::unordered_map<uint32_t, FX_WCHAR*> m_StringCache; | 141 std::unordered_map<uint32_t, FX_WCHAR*> m_StringCache; |
142 }; | 142 }; |
143 | 143 |
144 #endif // XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ | 144 #endif // XFA_FDE_CSS_FDE_CSSSTYLESHEET_H_ |
OLD | NEW |