7#include "fxjs/xfa/cjx_form.h"
12#include "fxjs/js_resources.h"
13#include "fxjs/xfa/cfxjse_engine.h"
14#include "third_party/base/containers/span.h"
15#include "v8/include/cppgc/allocation.h"
16#include "v8/include/v8-object.h"
17#include "v8/include/v8-primitive.h"
18#include "xfa/fxfa/cxfa_eventparam.h"
19#include "xfa/fxfa/cxfa_ffnotify.h"
20#include "xfa/fxfa/parser/cxfa_arraynodelist.h"
21#include "xfa/fxfa/parser/cxfa_document.h"
22#include "xfa/fxfa/parser/cxfa_form.h"
25 {
"execCalculate", execCalculate_static},
26 {
"execInitialize", execInitialize_static},
27 {
"execValidate", execValidate_static},
28 {
"formNodes", formNodes_static},
29 {
"recalculate", recalculate_static},
30 {
"remerge", remerge_static}};
32CJX_Form::CJX_Form(CXFA_Form* form) :
CJX_Model(form) {
43 pdfium::span<v8::Local<v8::Value>> params) {
44 if (params.size() != 1)
47 CXFA_Node* pDataNode = ToNode(runtime->ToXFAObject(params[0]));
52 auto* pFormNodes = cppgc::MakeGarbageCollected<CXFA_ArrayNodeList>(
53 pDoc->GetHeap()->GetAllocationHandle(), pDoc);
56 v8::Local<v8::Value> value = runtime->GetOrCreateJSBindingFromMap(pFormNodes);
57 return CJS_Result::Success(value);
61 pdfium::span<v8::Local<v8::Value>> params) {
70 pdfium::span<v8::Local<v8::Value>> params) {
82 pdfium::span<v8::Local<v8::Value>> params) {
88 if (params.size() != 1)
92 if (!pNotify || runtime->ToInt32(params[0]) != 0)
102 pdfium::span<v8::Local<v8::Value>> params) {
114 pdfium::span<v8::Local<v8::Value>> params) {
115 if (params.size() != 0)
128void CJX_Form::checksumS(
v8::Isolate* pIsolate,
129 v8::Local<v8::Value>* pValue,
134 fxv8::ReentrantToWideStringHelper(pIsolate, *pValue)
,
139 absl::optional<WideString> checksum =
140 TryAttribute(XFA_Attribute::Checksum,
false);
141 *pValue = fxv8::NewStringHelper(
143 checksum.has_value() ? checksum.value().ToUTF8().AsStringView() :
"");
CXFA_EventParam * GetEventParam() const
friend class EventParamScope
static CJS_Result Success()
static CJS_Result Failure(JSMessage id)
bool DynamicTypeIs(TypeTag eType) const override
void DefineMethods(pdfium::span< const CJX_MethodSpec > methods)
void SetAttributeByEnum(XFA_Attribute eAttr, const WideString &wsValue, bool bNotify)
CXFA_Document * GetDocument() const
CXFA_Node * GetXFANode() const
CXFA_NodeOwner * GetNodeOwner()
XFA_EventError ExecEventByDeepFirst(CXFA_Node *pFormNode, XFA_EVENTTYPE eEventType, bool bIsFormReady, bool bRecursive)
void PersistList(CXFA_List *list)
@ XFA_EVENT_InitCalculate