K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2017 The PDFium Authors |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 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_execute.h" |
| 8 | |
Tom Sepez | ef6c19f | 2019-01-24 23:30:26 +0000 | [diff] [blame] | 9 | #include "fxjs/xfa/cjx_node.h" |
Tom Sepez | 757a6bf | 2020-09-17 17:22:38 +0000 | [diff] [blame] | 10 | #include "xfa/fxfa/parser/cxfa_document.h" |
Dan Sinclair | fe9d640 | 2017-12-14 19:45:53 +0000 | [diff] [blame] | 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 kExecuteAttributeData[] = { |
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}, |
| 17 | {XFA_Attribute::Connection, XFA_AttributeType::CData, nullptr}, |
Dan Sinclair | 5fda35f | 2017-11-30 20:21:00 +0000 | [diff] [blame] | 18 | {XFA_Attribute::RunAt, XFA_AttributeType::Enum, |
Tom Sepez | 1498ab8 | 2018-12-06 17:56:28 +0000 | [diff] [blame] | 19 | (void*)XFA_AttributeValue::Client}, |
Dan Sinclair | 5fda35f | 2017-11-30 20:21:00 +0000 | [diff] [blame] | 20 | {XFA_Attribute::ExecuteType, XFA_AttributeType::Enum, |
Tom Sepez | 1498ab8 | 2018-12-06 17:56:28 +0000 | [diff] [blame] | 21 | (void*)XFA_AttributeValue::Import}, |
Dan Sinclair | 21b0827 | 2017-11-30 20:22:20 +0000 | [diff] [blame] | 22 | {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, |
Tom Sepez | a8c86c2 | 2019-01-25 22:06:03 +0000 | [diff] [blame] | 23 | }; |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 24 | |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 25 | } // namespace |
| 26 | |
Dan Sinclair | c40c5aa | 2017-11-30 21:29:11 +0000 | [diff] [blame] | 27 | CXFA_Execute::CXFA_Execute(CXFA_Document* doc, XFA_PacketType packet) |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 28 | : CXFA_Node(doc, |
| 29 | packet, |
Tom Sepez | 0c05758 | 2021-08-17 17:37:23 +0000 | [diff] [blame] | 30 | {XFA_XDPPACKET::kTemplate, XFA_XDPPACKET::kForm}, |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 31 | XFA_ObjectType::Node, |
| 32 | XFA_Element::Execute, |
Tom Sepez | c0fa5f6 | 2019-01-25 20:07:27 +0000 | [diff] [blame] | 33 | {}, |
Lei Zhang | ec7d8e2 | 2018-02-07 19:57:25 +0000 | [diff] [blame] | 34 | kExecuteAttributeData, |
Tom Sepez | 757a6bf | 2020-09-17 17:22:38 +0000 | [diff] [blame] | 35 | cppgc::MakeGarbageCollected<CJX_Node>( |
| 36 | doc->GetHeap()->GetAllocationHandle(), |
| 37 | this)) {} |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 38 | |
Tom Sepez | 7fc43dd | 2018-12-13 17:54:26 +0000 | [diff] [blame] | 39 | CXFA_Execute::~CXFA_Execute() = default; |