xref: /aosp_15_r20/external/pdfium/core/fxcrt/css/cfx_cssdata.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2018 The PDFium Authors
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/widestring.h"
14 #include "core/fxge/dib/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     CFX_CSSValueTypeMask dwTypes;
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;  // Raw, POD struct.
31     CFX_CSSNumberValue::Unit type;
32   };
33 
34   struct Color {
35     const wchar_t* name;  // Raw, POD struct.
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