Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 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_encryptionmethods.h" |
| 8 | |
Tom Sepez | 148c144 | 2019-01-25 18:56:26 +0000 | [diff] [blame] | 9 | #include "fxjs/xfa/cjx_node.h" |
| 10 | #include "third_party/base/ptr_util.h" |
| 11 | |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 12 | namespace { |
| 13 | |
Lei Zhang | ec7d8e2 | 2018-02-07 19:57:25 +0000 | [diff] [blame] | 14 | const CXFA_Node::AttributeData kEncryptionMethodsAttributeData[] = { |
Dan Sinclair | 21b0827 | 2017-11-30 20:22:20 +0000 | [diff] [blame] | 15 | {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, |
| 16 | {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, |
Dan Sinclair | 5fda35f | 2017-11-30 20:21:00 +0000 | [diff] [blame] | 17 | {XFA_Attribute::Type, XFA_AttributeType::Enum, |
Tom Sepez | 1498ab8 | 2018-12-06 17:56:28 +0000 | [diff] [blame] | 18 | (void*)XFA_AttributeValue::Optional}, |
Dan Sinclair | 21b0827 | 2017-11-30 20:22:20 +0000 | [diff] [blame] | 19 | {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, |
Tom Sepez | a8c86c2 | 2019-01-25 22:06:03 +0000 | [diff] [blame] | 20 | }; |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 21 | |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 22 | } // namespace |
| 23 | |
| 24 | CXFA_EncryptionMethods::CXFA_EncryptionMethods(CXFA_Document* doc, |
Dan Sinclair | c40c5aa | 2017-11-30 21:29:11 +0000 | [diff] [blame] | 25 | XFA_PacketType packet) |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 26 | : CXFA_Node(doc, |
| 27 | packet, |
| 28 | (XFA_XDPPACKET_Template | XFA_XDPPACKET_Form), |
| 29 | XFA_ObjectType::Node, |
| 30 | XFA_Element::EncryptionMethods, |
Tom Sepez | c0fa5f6 | 2019-01-25 20:07:27 +0000 | [diff] [blame] | 31 | {}, |
Tom Sepez | 148c144 | 2019-01-25 18:56:26 +0000 | [diff] [blame] | 32 | kEncryptionMethodsAttributeData, |
| 33 | pdfium::MakeUnique<CJX_Node>(this)) {} |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 34 | |
Tom Sepez | 7fc43dd | 2018-12-13 17:54:26 +0000 | [diff] [blame] | 35 | CXFA_EncryptionMethods::~CXFA_EncryptionMethods() = default; |