1 // Copyright 2018 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 CORE_FXCRT_CSS_CFX_CSSDATA_H_
8 #define CORE_FXCRT_CSS_CFX_CSSDATA_H_
9 
10 #include "core/fxcrt/css/cfx_css.h"
11 #include "core/fxcrt/css/cfx_cssnumbervalue.h"
12 #include "core/fxcrt/css/cfx_cssvalue.h"
13 #include "core/fxcrt/fx_string.h"
14 #include "core/fxge/fx_dib.h"
15 
16 class CFX_CSSData {
17  public:
18   struct Property {
19     CFX_CSSProperty eName;
20     uint32_t dwHash;  // Hashed as wide string.
21     uint32_t dwType;
22   };
23 
24   struct PropertyValue {
25     CFX_CSSPropertyValue eName;
26     uint32_t dwHash;  // Hashed as wide string.
27   };
28 
29   struct LengthUnit {
30     const wchar_t* value;
31     CFX_CSSNumberType type;
32   };
33 
34   struct Color {
35     const wchar_t* name;
36     FX_ARGB value;
37   };
38 
39   static const Property* GetPropertyByName(WideStringView name);
40   static const Property* GetPropertyByEnum(CFX_CSSProperty property);
41   static const PropertyValue* GetPropertyValueByName(WideStringView wsName);
42   static const LengthUnit* GetLengthUnitByName(WideStringView wsName);
43   static const Color* GetColorByName(WideStringView wsName);
44 };
45 
46 #endif  // CORE_FXCRT_CSS_CFX_CSSDATA_H_
47