cfde_cssselector.h revision 5ae9d0c6fd838a2967cca72aa5751b51dadc2769
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
16class 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
31  void SetNext(std::unique_ptr<CFDE_CSSSelector> pNext) {
32    m_pNext = std::move(pNext);
33  }
34
35 private:
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