1 // Copyright 2014 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_FXFA_FXFA_BASIC_H_
8 #define XFA_FXFA_FXFA_BASIC_H_
9 
10 #include <stdint.h>
11 
12 class CXFA_Measurement;
13 enum class XFA_ObjectType;
14 struct XFA_SCRIPTATTRIBUTEINFO;
15 
16 enum XFA_HashCode : uint32_t {
17   XFA_HASHCODE_None = 0,
18 
19   XFA_HASHCODE_Config = 0x4e1e39b6,
20   XFA_HASHCODE_ConnectionSet = 0xe14c801c,
21   XFA_HASHCODE_Data = 0xbde9abda,
22   XFA_HASHCODE_DataDescription = 0x2b5df51e,
23   XFA_HASHCODE_Datasets = 0x99b95079,
24   XFA_HASHCODE_DataWindow = 0x83a550d2,
25   XFA_HASHCODE_Event = 0x185e41e2,
26   XFA_HASHCODE_Form = 0xcd309ff4,
27   XFA_HASHCODE_Group = 0xf7f75fcd,
28   XFA_HASHCODE_Host = 0xdb075bde,
29   XFA_HASHCODE_Layout = 0x7e7e845e,
30   XFA_HASHCODE_LocaleSet = 0x5473b6dc,
31   XFA_HASHCODE_Log = 0x0b1b3d22,
32   XFA_HASHCODE_Name = 0x31b19c1,
33   XFA_HASHCODE_Occur = 0xf7eebe1c,
34   XFA_HASHCODE_Pdf = 0xb843dba,
35   XFA_HASHCODE_Record = 0x5779d65f,
36   XFA_HASHCODE_Signature = 0x8b036f32,
37   XFA_HASHCODE_SourceSet = 0x811929d,
38   XFA_HASHCODE_Stylesheet = 0x6038580a,
39   XFA_HASHCODE_Template = 0x803550fc,
40   XFA_HASHCODE_This = 0x2d574d58,
41   XFA_HASHCODE_Xdc = 0xc56afbf,
42   XFA_HASHCODE_XDP = 0xc56afcc,
43   XFA_HASHCODE_Xfa = 0xc56b9ff,
44   XFA_HASHCODE_Xfdf = 0x48d004a8,
45   XFA_HASHCODE_Xmpmeta = 0x132a8fbc
46 };
47 
48 enum class XFA_PacketType : uint8_t {
49 #undef PCKT____
50 #define PCKT____(a, b, c, d, e, f) c,
51 #include "xfa/fxfa/parser/packets.inc"
52 #undef PCKT____
53 };
54 
55 enum XFA_XDPPACKET {
56   XFA_XDPPACKET_UNKNOWN = 0,
57   XFA_XDPPACKET_Config = 1 << static_cast<uint8_t>(XFA_PacketType::Config),
58   XFA_XDPPACKET_Template = 1 << static_cast<uint8_t>(XFA_PacketType::Template),
59   XFA_XDPPACKET_Datasets = 1 << static_cast<uint8_t>(XFA_PacketType::Datasets),
60   XFA_XDPPACKET_Form = 1 << static_cast<uint8_t>(XFA_PacketType::Form),
61   XFA_XDPPACKET_LocaleSet = 1
62                             << static_cast<uint8_t>(XFA_PacketType::LocaleSet),
63   XFA_XDPPACKET_ConnectionSet =
64       1 << static_cast<uint8_t>(XFA_PacketType::ConnectionSet),
65   XFA_XDPPACKET_SourceSet = 1
66                             << static_cast<uint8_t>(XFA_PacketType::SourceSet),
67   XFA_XDPPACKET_Xdc = 1 << static_cast<uint8_t>(XFA_PacketType::Xdc),
68   XFA_XDPPACKET_Pdf = 1 << static_cast<uint8_t>(XFA_PacketType::Pdf),
69   XFA_XDPPACKET_Xfdf = 1 << static_cast<uint8_t>(XFA_PacketType::Xfdf),
70   XFA_XDPPACKET_Xmpmeta = 1 << static_cast<uint8_t>(XFA_PacketType::Xmpmeta),
71   XFA_XDPPACKET_Signature = 1
72                             << static_cast<uint8_t>(XFA_PacketType::Signature),
73   XFA_XDPPACKET_Stylesheet =
74       1 << static_cast<uint8_t>(XFA_PacketType::Stylesheet),
75   XFA_XDPPACKET_USER = 1 << static_cast<uint8_t>(XFA_PacketType::User),
76   XFA_XDPPACKET_XDP = 1 << static_cast<uint8_t>(XFA_PacketType::Xdp)
77 };
78 
79 enum XFA_XDPPACKET_FLAGS {
80   XFA_XDPPACKET_FLAGS_COMPLETEMATCH = 1,
81   XFA_XDPPACKET_FLAGS_PREFIXMATCH = 2,
82   XFA_XDPPACKET_FLAGS_NOMATCH = 4,
83   XFA_XDPPACKET_FLAGS_SUPPORTONE = 8,
84   XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16,
85 };
86 
87 enum class XFA_AttributeValue : uint16_t {
88 #undef VALUE____
89 #define VALUE____(a, b, c) c,
90 #include "xfa/fxfa/parser/attribute_values.inc"
91 #undef VALUE____
92 };
93 
94 enum class XFA_Attribute : int16_t {
95   Unknown = -1,
96 #undef ATTR____
97 #define ATTR____(a, b, c, d) c,
98 #include "xfa/fxfa/parser/attributes.inc"
99 #undef ATTR____
100 };
101 
102 enum class XFA_Element : int16_t {
103   Unknown = -1,
104 #undef ELEM____
105 #define ELEM____(a, b, c, d) c,
106 #include "xfa/fxfa/parser/elements.inc"
107 #undef ELEM____
108 };
109 
110 enum class XFA_AttributeType : uint8_t {
111   Enum,
112   CData,
113   Boolean,
114   Integer,
115   Measure,
116 };
117 
118 #define XFA_PROPERTYFLAG_OneOf 0x01
119 #define XFA_PROPERTYFLAG_DefaultOneOf 0x02
120 
121 enum class XFA_Unit : uint8_t {
122   Percent = 0,
123   Em,
124   Pt,
125   In,
126   Pc,
127   Cm,
128   Mm,
129   Mp,
130 
131   Unknown = 255,
132 };
133 
134 enum class XFA_ScriptType : uint8_t {
135   Basic,
136   Object,
137 };
138 
139 #endif  // XFA_FXFA_FXFA_BASIC_H_
140