7#include "fxjs/xfa/cjx_subform.h"
11#include "fxjs/cfx_v8.h"
13#include "fxjs/js_resources.h"
14#include "fxjs/xfa/cfxjse_engine.h"
15#include "third_party/base/containers/span.h"
16#include "v8/include/v8-object.h"
17#include "xfa/fxfa/cxfa_eventparam.h"
18#include "xfa/fxfa/cxfa_ffnotify.h"
19#include "xfa/fxfa/fxfa.h"
20#include "xfa/fxfa/parser/cxfa_delta.h"
21#include "xfa/fxfa/parser/cxfa_document.h"
24 {
"execCalculate", execCalculate_static},
25 {
"execEvent", execEvent_static},
26 {
"execInitialize", execInitialize_static},
27 {
"execValidate", execValidate_static}};
40 pdfium::span<v8::Local<v8::Value>> params) {
41 if (params.size() != 1)
44 execSingleEventByName(runtime->ToWideString(params[0]).AsStringView(),
45 XFA_Element::Subform);
51 pdfium::span<v8::Local<v8::Value>> params) {
64 pdfium::span<v8::Local<v8::Value>> params) {
77 pdfium::span<v8::Local<v8::Value>> params) {
91void CJX_Subform::locale(
v8::Isolate* pIsolate,
92 v8::Local<v8::Value>* pValue,
97 fxv8::ReentrantToWideStringHelper(pIsolate, *pValue)
, true,
102 WideString wsLocaleName =
GetXFANode()->GetLocaleName().value_or(L"");
104 fxv8::NewStringHelper(pIsolate, wsLocaleName
.ToUTF8().AsStringView());
107void CJX_Subform::instanceManager(
v8::Isolate* pIsolate,
108 v8::Local<v8::Value>* pValue,
119 pNode = pNode->GetPrevSibling()) {
121 WideString wsInstMgrName =
123 if (wsInstMgrName.GetLength() >= 1 && wsInstMgrName
[0
] ==
'_' &&
124 wsInstMgrName.Last(wsInstMgrName.GetLength() - 1) == wsName) {
125 pInstanceMgr = pNode;
130 *pValue = pInstanceMgr ? GetDocument()
132 ->GetOrCreateJSBindingFromMap(pInstanceMgr)
134 : fxv8::NewNullHelper(pIsolate).As<v8::Value>();
friend class EventParamScope
static CJS_Result Success()
static CJS_Result Failure(JSMessage id)
bool DynamicTypeIs(TypeTag eType) const override
CJX_Container(CXFA_Node *node)
void DefineMethods(pdfium::span< const CJX_MethodSpec > methods)
void SetCDataImpl(XFA_Attribute eAttr, const WideString &wsValue, bool bNotify, bool bScriptModify)
void ThrowInvalidPropertyException(v8::Isolate *pIsolate) const
CXFA_Document * GetDocument() const
WideString GetCData(XFA_Attribute eAttr) const
CXFA_Node * GetXFANode() const
XFA_EventError ExecEventByDeepFirst(CXFA_Node *pFormNode, XFA_EVENTTYPE eEventType, bool bIsFormReady, bool bRecursive)
XFA_Element GetElementType() const
ByteString ToUTF8() const
CharType operator[](const size_t index) const