7#include "fxjs/xfa/cjx_form.h"
9#include "core/fxcrt/span.h"
11#include "fxjs/js_resources.h"
12#include "fxjs/xfa/cfxjse_engine.h"
13#include "v8/include/cppgc/allocation.h"
14#include "v8/include/v8-object.h"
15#include "v8/include/v8-primitive.h"
16#include "xfa/fxfa/cxfa_eventparam.h"
17#include "xfa/fxfa/cxfa_ffnotify.h"
18#include "xfa/fxfa/parser/cxfa_arraynodelist.h"
19#include "xfa/fxfa/parser/cxfa_document.h"
20#include "xfa/fxfa/parser/cxfa_form.h"
23 {
"execCalculate", execCalculate_static},
24 {
"execInitialize", execInitialize_static},
25 {
"execValidate", execValidate_static},
26 {
"formNodes", formNodes_static},
27 {
"recalculate", recalculate_static},
28 {
"remerge", remerge_static}};
30CJX_Form::CJX_Form(CXFA_Form* form) :
CJX_Model(form) {
31 DefineMethods(MethodSpecs);
41 pdfium::span<v8::Local<v8::Value>> params) {
42 if (params.size() != 1)
45 CXFA_Node* pDataNode = ToNode(runtime->ToXFAObject(params[0]));
50 auto* pFormNodes = cppgc::MakeGarbageCollected<CXFA_ArrayNodeList>(
51 pDoc->GetHeap()->GetAllocationHandle(), pDoc);
54 v8::Local<v8::Value> value = runtime->GetOrCreateJSBindingFromMap(pFormNodes);
55 return CJS_Result::Success(value);
59 pdfium::span<v8::Local<v8::Value>> params) {
68 pdfium::span<v8::Local<v8::Value>> params) {
80 pdfium::span<v8::Local<v8::Value>> params) {
86 if (params.size() != 1)
90 if (!pNotify || runtime->ToInt32(params[0]) != 0)
100 pdfium::span<v8::Local<v8::Value>> params) {
112 pdfium::span<v8::Local<v8::Value>> params) {
113 if (params.size() != 0)
126void CJX_Form::checksumS(
v8::Isolate* pIsolate,
127 v8::Local<v8::Value>* pValue,
132 fxv8::ReentrantToWideStringHelper(pIsolate, *pValue)
,
138 TryAttribute(XFA_Attribute::Checksum,
false);
139 *pValue = fxv8::NewStringHelper(
141 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 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
fxcrt::WideString WideString