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_pdf.h"
8 
9 #include "fxjs/xfa/cjx_node.h"
10 #include "third_party/base/ptr_util.h"
11 
12 namespace {
13 
14 const CXFA_Node::PropertyData kPdfPropertyData[] = {
15     {XFA_Element::AdobeExtensionLevel, 1, 0},
16     {XFA_Element::FontInfo, 1, 0},
17     {XFA_Element::Xdc, 1, 0},
18     {XFA_Element::Pdfa, 1, 0},
19     {XFA_Element::BatchOutput, 1, 0},
20     {XFA_Element::ViewerPreferences, 1, 0},
21     {XFA_Element::ScriptModel, 1, 0},
22     {XFA_Element::Version, 1, 0},
23     {XFA_Element::SubmitFormat, 1, 0},
24     {XFA_Element::SilentPrint, 1, 0},
25     {XFA_Element::Producer, 1, 0},
26     {XFA_Element::Compression, 1, 0},
27     {XFA_Element::Interactive, 1, 0},
28     {XFA_Element::Encryption, 1, 0},
29     {XFA_Element::RenderPolicy, 1, 0},
30     {XFA_Element::OpenAction, 1, 0},
31     {XFA_Element::Creator, 1, 0},
32     {XFA_Element::Linearized, 1, 0},
33     {XFA_Element::Tagged, 1, 0},
34 };
35 
36 const CXFA_Node::AttributeData kPdfAttributeData[] = {
37     {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr},
38     {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr},
39     {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0},
40 };
41 
42 }  // namespace
43 
CXFA_Pdf(CXFA_Document * doc,XFA_PacketType packet)44 CXFA_Pdf::CXFA_Pdf(CXFA_Document* doc, XFA_PacketType packet)
45     : CXFA_Node(doc,
46                 packet,
47                 XFA_XDPPACKET_Config,
48                 XFA_ObjectType::Node,
49                 XFA_Element::Pdf,
50                 kPdfPropertyData,
51                 kPdfAttributeData,
52                 pdfium::MakeUnique<CJX_Node>(this)) {}
53 
54 CXFA_Pdf::~CXFA_Pdf() = default;
55