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 #include "xfa/fxfa/parser/cxfa_pagearea.h"
8
9 #include "fxjs/xfa/cjx_pagearea.h"
10 #include "third_party/base/ptr_util.h"
11
12 namespace {
13
14 const CXFA_Node::PropertyData kPropertyData[] = {{XFA_Element::Medium, 1, 0},
15 {XFA_Element::Desc, 1, 0},
16 {XFA_Element::Extras, 1, 0},
17 {XFA_Element::Occur, 1, 0},
18 {XFA_Element::Unknown, 0, 0}};
19 const CXFA_Node::AttributeData kAttributeData[] = {
20 {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr},
21 {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr},
22 {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr},
23 {XFA_Attribute::PagePosition, XFA_AttributeType::Enum,
24 (void*)XFA_AttributeEnum::Any},
25 {XFA_Attribute::OddOrEven, XFA_AttributeType::Enum,
26 (void*)XFA_AttributeEnum::Any},
27 {XFA_Attribute::Relevant, XFA_AttributeType::CData, nullptr},
28 {XFA_Attribute::InitialNumber, XFA_AttributeType::Integer, (void*)1},
29 {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr},
30 {XFA_Attribute::Numbered, XFA_AttributeType::Integer, (void*)1},
31 {XFA_Attribute::BlankOrNotBlank, XFA_AttributeType::Enum,
32 (void*)XFA_AttributeEnum::Any},
33 {XFA_Attribute::Unknown, XFA_AttributeType::Integer, nullptr}};
34
35 constexpr wchar_t kName[] = L"pageArea";
36
37 } // namespace
38
CXFA_PageArea(CXFA_Document * doc,XFA_PacketType packet)39 CXFA_PageArea::CXFA_PageArea(CXFA_Document* doc, XFA_PacketType packet)
40 : CXFA_Node(doc,
41 packet,
42 (XFA_XDPPACKET_Template | XFA_XDPPACKET_Form),
43 XFA_ObjectType::ContainerNode,
44 XFA_Element::PageArea,
45 kPropertyData,
46 kAttributeData,
47 kName,
48 pdfium::MakeUnique<CJX_PageArea>(this)) {}
49
~CXFA_PageArea()50 CXFA_PageArea::~CXFA_PageArea() {}
51