1 // Copyright 2017 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_FDE_CSS_CFDE_CSSSELECTOR_H_ 8 #define XFA_FDE_CSS_CFDE_CSSSELECTOR_H_ 9 10 #include <memory> 11 #include <utility> 12 13 #include "core/fxcrt/fx_string.h" 14 #include "xfa/fde/css/fde_css.h" 15 16 class CFDE_CSSSelector { 17 public: 18 static std::unique_ptr<CFDE_CSSSelector> FromString( 19 const CFX_WideStringC& str); 20 21 CFDE_CSSSelector(FDE_CSSSelectorType eType, 22 const FX_WCHAR* psz, 23 int32_t iLen, 24 bool bIgnoreCase); 25 ~CFDE_CSSSelector(); 26 27 FDE_CSSSelectorType GetType() const; 28 uint32_t GetNameHash() const; 29 CFDE_CSSSelector* GetNextSelector() const; 30 SetNext(std::unique_ptr<CFDE_CSSSelector> pNext)31 void SetNext(std::unique_ptr<CFDE_CSSSelector> pNext) { 32 m_pNext = std::move(pNext); 33 } 34 35 private: SetType(FDE_CSSSelectorType eType)36 void SetType(FDE_CSSSelectorType eType) { m_eType = eType; } 37 38 FDE_CSSSelectorType m_eType; 39 uint32_t m_dwHash; 40 std::unique_ptr<CFDE_CSSSelector> m_pNext; 41 }; 42 43 #endif // XFA_FDE_CSS_CFDE_CSSSELECTOR_H_ 44