7#include "fxjs/xfa/cjx_object.h"
13#include "core/fxcrt/check.h"
14#include "core/fxcrt/check_op.h"
15#include "core/fxcrt/containers/contains.h"
16#include "core/fxcrt/fx_extension.h"
17#include "core/fxcrt/fx_memory.h"
18#include "core/fxcrt/span.h"
19#include "core/fxcrt/xml/cfx_xmlelement.h"
20#include "core/fxcrt/xml/cfx_xmltext.h"
21#include "fxjs/cjs_result.h"
23#include "fxjs/gc/container_trace.h"
24#include "fxjs/xfa/cfxjse_engine.h"
25#include "fxjs/xfa/cfxjse_mapmodule.h"
26#include "fxjs/xfa/cjx_boolean.h"
27#include "fxjs/xfa/cjx_draw.h"
28#include "fxjs/xfa/cjx_field.h"
29#include "fxjs/xfa/cjx_instancemanager.h"
30#include "v8/include/v8-forward.h"
31#include "v8/include/v8-object.h"
32#include "v8/include/v8-primitive.h"
33#include "xfa/fgas/crt/cfgas_decimal.h"
34#include "xfa/fgas/graphics/cfgas_gecolor.h"
35#include "xfa/fxfa/cxfa_ffnotify.h"
36#include "xfa/fxfa/cxfa_ffwidget.h"
37#include "xfa/fxfa/parser/cxfa_border.h"
38#include "xfa/fxfa/parser/cxfa_datavalue.h"
39#include "xfa/fxfa/parser/cxfa_document.h"
40#include "xfa/fxfa/parser/cxfa_edge.h"
41#include "xfa/fxfa/parser/cxfa_fill.h"
42#include "xfa/fxfa/parser/cxfa_font.h"
43#include "xfa/fxfa/parser/cxfa_measurement.h"
44#include "xfa/fxfa/parser/cxfa_node.h"
45#include "xfa/fxfa/parser/cxfa_object.h"
46#include "xfa/fxfa/parser/cxfa_occur.h"
47#include "xfa/fxfa/parser/cxfa_proto.h"
48#include "xfa/fxfa/parser/cxfa_subform.h"
49#include "xfa/fxfa/parser/cxfa_validate.h"
50#include "xfa/fxfa/parser/cxfa_value.h"
51#include "xfa/fxfa/parser/xfa_basic_data.h"
52#include "xfa/fxfa/parser/xfa_utils.h"
62 uint32_t dwKey = FX_HashCode_GetW(wsKey);
63 return ((dwKey << 1) | XFA_KEYTYPE_Custom);
67 return ((
static_cast<uint32_t>(eType) << 16) |
68 (
static_cast<uint32_t>(eAttribute) << 8) | XFA_KEYTYPE_Element);
71std::tuple<int32_t, int32_t, int32_t> StrToRGB(
const WideString& strRGB) {
77 for (size_t i = 0; i < strRGB.GetLength(); ++i) {
78 wchar_t ch = strRGB[i];
84 int32_t iValue = ch - L'0';
85 if (iValue >= 0 && iValue <= 9) {
102v8::Local<v8::String> ColorToV8String(
v8::Isolate* isolate,
FX_ARGB color) {
103 return fxv8::NewStringHelper(
118 visitor->Trace(object_);
119 visitor->Trace(layout_item_);
120 visitor->Trace(calc_data_);
124 return eType == static_type__;
128 for (
const auto& item : methods)
129 method_specs_[item.pName] = item.pMethodCall;
133 return object_->GetDocument();
141 v8::Local<v8::Value>* pValue,
148 *pValue = fxv8::NewStringHelper(pIsolate,
GetXFAObject()->GetClassName());
151int32_t
CJX_Object::Subform_and_SubformSet_InstanceIndex() {
154 pNode = pNode->GetPrevSibling()) {
165 return pdfium::Contains(method_specs_, func.ToUTF8());
171 auto it = method_specs_.find(func.ToUTF8());
172 if (it == method_specs_.end())
175 return it->second(
this, pScriptContext, params);
183 "] has violated its allowable number of occurrences.")
);
197 v8::Isolate* pIsolate,
208 "Argument mismatch in property or function argument.")
);
214 FXJSE_ThrowMessage(pIsolate, str
.ToUTF8().AsStringView());
219 return HasMapModuleKey(key);
228 XFA_GetAttributeValueByName(wsValue.AsStringView());
230 item.has_value() ? item.value()
241 case XFA_AttributeType::Integer:
243 FXSYS_roundf(FXSYS_wcstof(wsValue.AsStringView(),
nullptr)),
255 if (attr.has_value()) {
259 uint32_t key = GetMapKey_Custom(wsAttr);
260 SetMapModuleString(key, wsValue);
266 if (enum_attr.has_value())
269 result = GetMapModuleStringFollowingChain(GetMapKey_Custom(attr));
278 bool bUseDefault)
const {
282 if (!value.has_value())
287 return TryCData(eAttr, bUseDefault);
290 std::optional<
bool> value = TryBoolean(eAttr, bUseDefault);
291 if (!value.has_value())
293 return WideString(value.value() ? L"1" : L"0");
296 std::optional<int32_t> iValue = TryInteger(eAttr, bUseDefault);
297 if (!iValue.has_value())
303 if (!value.has_value())
305 return value->ToString();
312 RemoveMapModuleKey(GetMapKey_Custom(wsAttr));
316 bool bUseDefault)
const {
318 std::optional<int32_t> value = GetMapModuleValueFollowingChain(key);
319 if (value.has_value())
320 return !!value.value();
327 CFX_XMLElement* elem = SetValue(eAttr,
static_cast<int32_t>(bValue), bNotify);
330 bValue ? L"1" : L"0"
);
335 return TryBoolean(eAttr,
true).value_or(
false);
339 CFX_XMLElement* elem = SetValue(eAttr, iValue, bNotify);
351 bool bUseDefault)
const {
353 std::optional<int32_t> value = GetMapModuleValueFollowingChain(key);
354 if (value.has_value())
355 return value.value();
362 bool bUseDefault)
const {
364 std::optional<int32_t> value = GetMapModuleValueFollowingChain(key);
365 if (value.has_value())
375 CFX_XMLElement* elem = SetValue(eAttr,
static_cast<int32_t>(eValue), bNotify);
383 return TryEnum(eAttr,
true).value_or(XFA_AttributeValue::Unknown);
394 SetMapModuleMeasurement(key, mValue);
396 OnChanged(eAttr,
false);
400 bool bUseDefault)
const {
403 GetMapModuleMeasurementFollowingChain(key);
404 if (result.has_value())
405 return result.value();
413 if (!measure.has_value())
419 return TryMeasure(eAttr,
true).value_or(CXFA_Measurement());
437 bool bScriptModify) {
440 std::optional<
WideString> old_value = GetMapModuleString(key);
441 if (!old_value.has_value() || old_value.value() != wsValue) {
444 SetMapModuleString(key, wsValue);
448 OnChanged(eAttr, bScriptModify);
474 wsAttrName
= L"xfa:"
+ wsAttrName;
486 bool bScriptModify) {
490 std::optional<
WideString> old_value = GetMapModuleString(key);
491 if (!old_value.has_value() || old_value.value() != wsValue) {
494 SetMapModuleString(key, wsValue);
503 bool bUseDefault)
const {
505 std::optional<
WideString> value = GetMapModuleStringFollowingChain(key);
506 if (value.has_value())
519 std::optional<int32_t> old_value = GetMapModuleValue(key);
520 if (!old_value.has_value() || old_value.value() != value) {
523 SetMapModuleValue(key, value);
525 OnChanged(eAttr,
false);
543 GetOrCreateProperty<CXFA_Value>(0,
XFA_Element::Value);
547 CXFA_Node* pChildValue = pValue->GetFirstChild();
548 pChildValue->JSObject()->SetCData(
XFA_Attribute::ContentType,
550 pChildValue->JSObject()->SetContent(wsContent, wsContent, bNotify,
551 bScriptModify,
false);
554 if (bSyncData && pBind) {
555 std::vector<WideString> wsSaveTextArray =
556 fxcrt::Split(wsContent, L'\n');
557 std::vector<CXFA_Node*> valueNodes =
563 while (valueNodes.size() != wsSaveTextArray.size()) {
566 if (valueNodes.size() < wsSaveTextArray.size()) {
567 size_t iAddNodes = wsSaveTextArray.size() - valueNodes.size();
568 while (iAddNodes-- > 0) {
571 pValueNodes->JSObject()->SetCData(
577 size_t iDelNodes = valueNodes.size() - wsSaveTextArray.size();
578 for (size_t i = 0; i < iDelNodes; ++i)
581 valueNodes = pBind->GetNodeListForType(
XFA_Element::DataValue);
583 DCHECK_EQ(valueNodes.size(), wsSaveTextArray.size());
585 for (CXFA_Node* pValueNode : valueNodes) {
586 pValueNode->JSObject()->SetAttributeValue(wsSaveTextArray[i],
590 for (
auto* pArrayNode : pBind->GetBindItemsCopy()) {
591 if (pArrayNode != GetXFANode()) {
592 pArrayNode->JSObject()->SetContent(wsContent, wsContent, bNotify,
593 bScriptModify,
false);
603 GetOrCreateProperty<CXFA_Value>(0,
XFA_Element::Value);
607 CXFA_Node* pChildValue = pValue->GetFirstChild();
609 pChildValue->JSObject()->SetContent(wsContent, wsContent, bNotify,
610 bScriptModify,
false);
614 if (pBindNode && bSyncData) {
615 pBindNode->JSObject()->SetContent(wsContent, wsXMLValue, bNotify,
616 bScriptModify,
false);
617 for (
auto* pArrayNode : pBindNode->GetBindItemsCopy()) {
618 if (pArrayNode != GetXFANode()) {
619 pArrayNode->JSObject()->SetContent(wsContent, wsContent, bNotify,
631 TryAttribute(XFA_Attribute::ContentType,
false);
633 wsContentType = ret.value();
635 wsContentType.clear();
641 if (!pContentRawDataNode) {
647 pContentRawDataNode->JSObject()->SetContent(
648 wsContent, wsXMLValue, bNotify, bScriptModify, bSyncData);
660 pParent = pParent->GetParent();
663 pParent = pParent->GetParent();
667 pBindNode->JSObject()->SetContent(wsContent, wsXMLValue, bNotify,
668 bScriptModify,
false);
685 if (pBindNode && bSyncData) {
686 for (
auto* pArrayNode : pBindNode->GetBindItemsCopy()) {
687 pArrayNode->JSObject()->SetContent(wsContent, wsContent, bNotify,
688 bScriptModify,
false);
710 CXFA_Node* pChildValue = pValue->GetFirstChild();
712 pChildValue->JSObject()->SetAttributeByEnum(
718 return pChildValue->JSObject()->TryContent(bScriptModify, bProto);
723 if (!pContentRawDataNode) {
727 TryAttribute(XFA_Attribute::ContentType,
false);
728 if (contentType.has_value()) {
729 if (contentType.value().EqualsASCII(
"text/html"))
731 else if (contentType.value().EqualsASCII(
"text/xml"))
738 return pContentRawDataNode->JSObject()->TryContent(bScriptModify,
true);
755 return TryCData(XFA_Attribute::Value,
false);
803 map_module_ = std::make_unique<CFXJSE_MapModule>();
804 return map_module_.get();
808 return map_module_.get();
811void CJX_Object::SetMapModuleValue(uint32_t key, int32_t value) {
819void CJX_Object::SetMapModuleMeasurement(uint32_t key,
824std::optional<int32_t>
CJX_Object::GetMapModuleValue(uint32_t key)
const {
839 uint32_t key)
const {
846std::optional<int32_t>
CJX_Object::GetMapModuleValueFollowingChain(
847 uint32_t key)
const {
848 std::set<
const CXFA_Node*> visited;
851 if (!visited.insert(pNode).second)
854 std::optional<int32_t> result = pNode->JSObject()->GetMapModuleValue(key);
855 if (result.has_value())
865 uint32_t key)
const {
866 std::set<
const CXFA_Node*> visited;
869 if (!visited.insert(pNode).second)
873 pNode->JSObject()->GetMapModuleString(key);
874 if (result.has_value())
884CJX_Object::GetMapModuleMeasurementFollowingChain(uint32_t key)
const {
885 std::set<
const CXFA_Node*> visited;
888 if (!visited.insert(pNode).second)
892 pNode->JSObject()->GetMapModuleMeasurement(key);
893 if (result.has_value())
902bool CJX_Object::HasMapModuleKey(uint32_t key)
const {
907void CJX_Object::RemoveMapModuleKey(uint32_t key) {
927 ToNode(pDstObj
)->JSObject()->TakeCalcDataFrom(
this);
938 ToNode(pDstObj
)->JSObject()->SetContent(wsValue, wsFormatValue,
true,
true,
943 if (!pSrcObj || !pDstObj)
948 while (pSrcChild && pDstChild) {
949 MoveBufferMapData(pSrcChild, pDstChild);
950 pSrcChild = pSrcChild->GetNextSibling();
951 pDstChild = pDstChild->GetNextSibling();
953 ToNode(pSrcObj
)->JSObject()->MoveBufferMapData(pDstObj);
977 cppgc::MakeGarbageCollected<CalcData>(heap->GetAllocationHandle());
983 calc_data_ = that->calc_data_;
984 that->calc_data_ =
nullptr;
987void CJX_Object::ScriptAttributeString(
v8::Isolate* pIsolate,
988 v8::Local<v8::Value>* pValue,
992 *pValue = fxv8::NewStringHelper(
997 WideString wsValue = fxv8::ReentrantToWideStringHelper(pIsolate, *pValue);
1006 CXFA_Subform* pSubForm =
1007 pTemplateNode->GetFirstChildByClass<CXFA_Subform>(
XFA_Element::Subform);
1008 CXFA_Proto* pProtoRoot =
1009 pSubForm ? pSubForm->GetFirstChildByClass<CXFA_Proto>(
XFA_Element::Proto)
1014 if (!wsValue.IsEmpty()) {
1015 if (wsValue[0] ==
'#')
1016 wsID = wsValue.Substr(1);
1018 wsSOM =
std::move(wsValue);
1022 if (!wsSOM.IsEmpty()) {
1024 GetDocument()->GetScriptContext()->ResolveObjects(
1025 pProtoRoot, wsSOM.AsStringView(),
1026 Mask<XFA_ResolveFlag>{
1027 XFA_ResolveFlag::kChildren, XFA_ResolveFlag::kAttributes,
1028 XFA_ResolveFlag::kProperties, XFA_ResolveFlag::kParent,
1029 XFA_ResolveFlag::kSiblings});
1030 if (maybeResult.has_value() &&
1031 maybeResult.value().objects.front()->IsNode()) {
1032 pProtoNode = maybeResult.value().objects.front()->AsNode();
1034 }
else if (!wsID.IsEmpty()) {
1041 while (pHeadChild) {
1042 CXFA_Node* pSibling = pHeadChild->GetNextSibling();
1044 pHeadChild = pSibling;
1048 pHeadChild = pProtoForm->GetFirstChild();
1049 while (pHeadChild) {
1050 CXFA_Node* pSibling = pHeadChild->GetNextSibling();
1053 pHeadChild = pSibling;
1057void CJX_Object::ScriptAttributeBool(
v8::Isolate* pIsolate,
1058 v8::Local<v8::Value>* pValue,
1066 *pValue = fxv8::NewStringHelper(pIsolate,
GetBoolean(eAttribute
) ?
"1" :
"0");
1069void CJX_Object::ScriptAttributeInteger(
v8::Isolate* pIsolate,
1070 v8::Local<v8::Value>* pValue,
1078 *pValue = fxv8::NewNumberHelper(pIsolate,
GetInteger(eAttribute
));
1081void CJX_Object::ScriptSomFontColor(
v8::Isolate* pIsolate,
1082 v8::Local<v8::Value>* pValue,
1085 CXFA_Font* font = ToNode(object_.Get())->GetOrCreateFontIfPossible();
1091 StrToRGB(fxv8::ReentrantToWideStringHelper(pIsolate, *pValue));
1092 FX_ARGB color = ArgbEncode(0xff, r, g, b);
1097 *pValue = ColorToV8String(pIsolate, font->GetColor());
1100void CJX_Object::ScriptSomFillColor(
v8::Isolate* pIsolate,
1101 v8::Local<v8::Value>* pValue,
1104 CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorderIfPossible();
1111 StrToRGB(fxv8::ReentrantToWideStringHelper(pIsolate, *pValue));
1112 FX_ARGB color = ArgbEncode(0xff, r, g, b);
1117 *pValue = ColorToV8String(pIsolate, borderfill->GetFillColor());
1120void CJX_Object::ScriptSomBorderColor(
v8::Isolate* pIsolate,
1121 v8::Local<v8::Value>* pValue,
1124 CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorderIfPossible();
1125 int32_t iSize = border->CountEdges();
1128 StrToRGB(fxv8::ReentrantToWideStringHelper(pIsolate, *pValue));
1129 FX_ARGB rgb = ArgbEncode(100, r, g, b);
1130 for (int32_t i = 0; i < iSize; ++i) {
1131 CXFA_Edge* edge = border->GetEdgeIfExists(i);
1139 CXFA_Edge* edge = border->GetEdgeIfExists(0);
1141 *pValue = ColorToV8String(pIsolate, color);
1144void CJX_Object::ScriptSomBorderWidth(
v8::Isolate* pIsolate,
1145 v8::Local<v8::Value>* pValue,
1148 CXFA_Border* border = ToNode(object_.Get())->GetOrCreateBorderIfPossible();
1150 CXFA_Edge* edge = border->GetEdgeIfExists(0);
1153 *pValue = fxv8::NewStringHelper(
1158 if (pValue->IsEmpty())
1161 WideString wsThickness = fxv8::ReentrantToWideStringHelper(pIsolate, *pValue);
1162 for (size_t i = 0; i < border->CountEdges(); ++i) {
1163 CXFA_Edge* edge = border->GetEdgeIfExists(i);
1170 v8::Local<v8::Value>* pValue,
1174 CXFA_Validate* validate = ToNode(object_.Get())->GetValidateIfExists();
1176 validate = ToNode(object_.Get())->GetOrCreateValidateIfPossible();
1182 switch (iMessageType) {
1185 fxv8::ReentrantToWideStringHelper(pIsolate, *pValue)
);
1189 fxv8::ReentrantToWideStringHelper(pIsolate, *pValue)
);
1193 fxv8::ReentrantToWideStringHelper(pIsolate, *pValue)
);
1215 switch (iMessageType) {
1226 *pValue = fxv8::NewStringHelper(pIsolate, wsMessage
.ToUTF8().AsStringView());
1229void CJX_Object::ScriptSomValidationMessage(
v8::Isolate* pIsolate,
1230 v8::Local<v8::Value>* pValue,
1233 ScriptSomMessage(pIsolate, pValue, bSetting,
1234 SOMMessageType::kValidationMessage);
1237void CJX_Object::ScriptSomMandatoryMessage(
v8::Isolate* pIsolate,
1238 v8::Local<v8::Value>* pValue,
1241 ScriptSomMessage(pIsolate, pValue, bSetting,
1242 SOMMessageType::kMandatoryMessage);
1245void CJX_Object::ScriptSomDefaultValue(
v8::Isolate* pIsolate,
1246 v8::Local<v8::Value>* pValue,
1255 static_cast<CJX_Field*>(
this)->defaultValue(pIsolate, pValue, bSetting,
1260 static_cast<CJX_Draw*>(
this)->defaultValue(pIsolate, pValue, bSetting,
1265 static_cast<CJX_Boolean*>(
this)->defaultValue(pIsolate, pValue, bSetting,
1274 wsNewValue = fxv8::ReentrantToWideStringHelper(pIsolate, *pValue);
1281 for (
auto* pFormNode : GetXFANode()->GetBindItemsCopy()) {
1282 if (!pFormNode || pFormNode->HasRemovedChildren())
1285 pContainerNode = pFormNode->GetContainerNode();
1286 if (pContainerNode) {
1288 pContainerNode->GetPictureContent(XFA_ValuePicture::kDataBind);
1290 if (!wsPicture.IsEmpty())
1293 pContainerNode =
nullptr;
1307 if (content.IsEmpty() && eType !=
XFA_Element::Text &&
1309 *pValue = fxv8::NewNullHelper(pIsolate);
1311 *pValue = fxv8::NewNumberHelper(pIsolate, FXSYS_wtoi(content.c_str()));
1314 *pValue = fxv8::NewNumberHelper(pIsolate, decimal
.ToFloat());
1316 *pValue = fxv8::NewStringHelper(pIsolate, content
.ToUTF8().AsStringView());
1320void CJX_Object::ScriptSomDefaultValue_Read(
v8::Isolate* pIsolate,
1321 v8::Local<v8::Value>* pValue,
1330 if (content.IsEmpty()) {
1331 *pValue = fxv8::NewNullHelper(pIsolate);
1334 *pValue = fxv8::NewStringHelper(pIsolate, content
.ToUTF8().AsStringView());
1337void CJX_Object::ScriptSomDataNode(
v8::Isolate* pIsolate,
1338 v8::Local<v8::Value>* pValue,
1348 *pValue = fxv8::NewNullHelper(pIsolate);
1356void CJX_Object::ScriptSomMandatory(
v8::Isolate* pIsolate,
1357 v8::Local<v8::Value>* pValue,
1360 CXFA_Validate* validate =
1361 ToNode(object_.Get())->GetOrCreateValidateIfPossible();
1370 *pValue = fxv8::NewStringHelper(
1374void CJX_Object::ScriptSomInstanceIndex(
v8::Isolate* pIsolate,
1375 v8::Local<v8::Value>* pValue,
1380 fxv8::NewNumberHelper(pIsolate, Subform_and_SubformSet_InstanceIndex());
1384 int32_t iTo = fxv8::ReentrantToInt32Helper(pIsolate, *pValue);
1385 int32_t iFrom = Subform_and_SubformSet_InstanceIndex();
1388 pNode = pNode->GetPrevSibling()) {
1390 pManagerNode = pNode;
1397 auto* mgr =
static_cast<CJX_InstanceManager*>(pManagerNode->JSObject());
1398 mgr->MoveInstance(pIsolate, iTo, iFrom);
1408 auto* pFromInstance =
1414void CJX_Object::ScriptSubmitFormatMode(
v8::Isolate* pIsolate,
1415 v8::Local<v8::Value>* pValue,
1424 ContainerTrace(visitor, m_Globals);
CFX_XMLElement * ToXMLElement(CFX_XMLNode *pNode)
static ByteString ColorToString(FX_ARGB argb)
void AddNodesOfRunScript(CXFA_Node *pNode)
friend class EventParamScope
void MergeDataFrom(const CFXJSE_MapModule *pSrc)
std::optional< int32_t > GetValue(uint32_t key) const
void SetValue(uint32_t key, int32_t value)
void SetMeasurement(uint32_t key, const CXFA_Measurement &measurement)
void SetString(uint32_t key, const WideString &wsString)
std::optional< CXFA_Measurement > GetMeasurement(uint32_t key) const
void RemoveKey(uint32_t key)
bool HasKey(uint32_t key) const
std::optional< WideString > GetString(uint32_t key) const
WideString GetNamespaceURI() const
void SetAttribute(const WideString &name, const WideString &value)
static CJS_Result Failure(JSMessage id)
WideString GetAttributeByString(WideStringView attr) const
void RemoveAttribute(WideStringView wsAttr)
void ScriptSomMessage(v8::Isolate *pIsolate, v8::Local< v8::Value > *pValue, bool bSetting, SOMMessageType iMessageType)
float GetMeasureInUnit(XFA_Attribute eAttr, XFA_Unit unit) const
void DefineMethods(pdfium::span< const CJX_MethodSpec > methods)
std::optional< WideString > TryAttribute(XFA_Attribute eAttr, bool bUseDefault) const
void SetCDataImpl(XFA_Attribute eAttr, const WideString &wsValue, bool bNotify, bool bScriptModify)
WideString GetContent(bool bScriptModify) const
std::optional< CXFA_Measurement > TryMeasure(XFA_Attribute eAttr, bool bUseDefault) const
bool HasMethod(const WideString &func) const
std::optional< WideString > TryContent(bool bScriptModify, bool bProto) const
CJX_Object * AsCJXObject() override
CXFA_Object * GetXFAObject() const
CJS_Result RunMethod(CFXJSE_Engine *pScriptContext, const WideString &func, pdfium::span< v8::Local< v8::Value > > params)
std::optional< float > TryMeasureAsFloat(XFA_Attribute attr) const
std::optional< WideString > TryCData(XFA_Attribute eAttr, bool bUseDefault) const
void ThrowArgumentMismatchException(v8::Isolate *pIsolate) const
void ThrowIndexOutOfBoundsException(v8::Isolate *pIsolate) const
void SetAttributeByEnum(XFA_Attribute eAttr, const WideString &wsValue, bool bNotify)
void ThrowInvalidPropertyException(v8::Isolate *pIsolate) const
CXFA_Document * GetDocument() const
void ThrowParamCountMismatchException(v8::Isolate *pIsolate, const WideString &method) const
void SetCData(XFA_Attribute eAttr, const WideString &wsValue)
void SetBoolean(XFA_Attribute eAttr, bool bValue, bool bNotify)
void SetInteger(XFA_Attribute eAttr, int32_t iValue, bool bNotify)
std::optional< bool > TryBoolean(XFA_Attribute eAttr, bool bUseDefault) const
XFA_AttributeValue GetEnum(XFA_Attribute eAttr) const
void SetAttributeByString(WideStringView wsAttr, const WideString &wsValue)
bool GetBoolean(XFA_Attribute eAttr) const
virtual bool DynamicTypeIs(TypeTag eType) const
void MoveBufferMapData(CXFA_Object *pSrcObj, CXFA_Object *pDstObj)
bool HasAttribute(XFA_Attribute eAttr) const
int32_t GetInteger(XFA_Attribute eAttr) const
WideString GetCData(XFA_Attribute eAttr) const
void TakeCalcDataFrom(CJX_Object *that)
void ThrowException(v8::Isolate *pIsolate, const WideString &str) const
CXFA_Node * GetXFANode() const
void SetEnum(XFA_Attribute eAttr, XFA_AttributeValue eValue, bool bNotify)
void SetContent(const WideString &wsContent, const WideString &wsXMLValue, bool bNotify, bool bScriptModify, bool bSyncData)
std::optional< WideString > TryNamespace() const
std::optional< int32_t > TryInteger(XFA_Attribute eAttr, bool bUseDefault) const
CXFA_Measurement GetMeasure(XFA_Attribute eAttr) const
void SetAttributeValue(const WideString &wsValue, const WideString &wsXMLValue)
void SetMeasure(XFA_Attribute eAttr, const CXFA_Measurement &mValue, bool bNotify)
void MergeAllData(CXFA_Object *pDstObj)
std::optional< XFA_AttributeValue > TryEnum(XFA_Attribute eAttr, bool bUseDefault) const
WideString GetAttributeByEnum(XFA_Attribute attr) const
CalcData * GetOrCreateCalcData(cppgc::Heap *heap)
void SetAttributeValueImpl(const WideString &wsValue, const WideString &wsXMLValue, bool bNotify, bool bScriptModify)
CJX_Object(CXFA_Object *obj)
void ThrowTooManyOccurrencesException(v8::Isolate *pIsolate, const WideString &obj) const
CXFA_Fill * GetOrCreateFillIfPossible()
CXFA_Node * GetNodeByID(CXFA_Node *pRoot, WideStringView wsID) const
CXFA_FFNotify * GetNotify() const
CFXJSE_Engine * GetScriptContext() const
CXFA_Object * GetXFAObject(XFA_HashCode wsNodeNameHash)
static constexpr FX_ARGB kDefaultColor
void OnValueChanging(CXFA_Node *pSender, XFA_Attribute eAttr)
void AddCalcValidate(CXFA_Node *pNode)
void RunSubformIndexChange(CXFA_Subform *pSubformNode)
void SetColor(FX_ARGB color)
void SetColor(FX_ARGB color)
CXFA_Measurement(float fValue, XFA_Unit eUnit)
float ToUnit(XFA_Unit eUnit) const
WideString ToString() const
CFX_XMLNode * GetXMLMappingNode() const
void RemoveChildAndNotify(CXFA_Node *pNode, bool bNotify)
void InsertChildAndNotify(CXFA_Node *pNode, CXFA_Node *pBeforeNode)
CXFA_Node * GetOrCreateProperty(int32_t index, XFA_Element eProperty)
void SendAttributeChangeMessage(XFA_Attribute eAttribute, bool bScriptModify)
WideString GetFormatDataValue(const WideString &wsValue)
std::optional< bool > GetDefaultBoolean(XFA_Attribute attr) const
CXFA_Node * CreateSamePacketNode(XFA_Element eType)
std::optional< WideString > GetDefaultCData(XFA_Attribute attr) const
CXFA_Node * GetTemplateNodeIfExists() const
CXFA_Node * GetBindData()
CFX_XMLNode * CreateXMLMappingNode()
void SetToXML(const WideString &value)
std::pair< CXFA_Node *, int32_t > GetProperty(int32_t index, XFA_Element eProperty) const
CXFA_Node * CloneTemplateToForm(bool bRecursive)
CXFA_Node * GetContainerNode()
std::optional< XFA_AttributeValue > GetDefaultEnum(XFA_Attribute attr) const
XFA_AttributeType GetAttributeType(XFA_Attribute type) const
std::optional< CXFA_Measurement > GetDefaultMeasurement(XFA_Attribute attr) const
XFA_PacketType GetPacketType() const
CXFA_Node * GetItemIfExists(int32_t iIndex)
bool IsNeedSavingXMLNode() const
std::optional< int32_t > GetDefaultInteger(XFA_Attribute attr) const
bool IsInitialized() const
CXFA_Node * GetModelNode()
XFA_Element GetElementType() const
XFA_ObjectType GetObjectType() const
bool IsContainerNode() const
void SetMSThickness(CXFA_Measurement msThinkness)
CXFA_Measurement GetMSThickness() const
void SetColor(FX_ARGB argb)
XFA_AttributeValue GetNullTest()
void SetScriptMessageText(const WideString &wsMessage)
WideString GetNullMessageText()
WideString GetScriptMessageText()
void SetNullTest(const WideString &wsValue)
void SetNullMessageText(const WideString &wsMessage)
WideString GetFormatMessageText()
void SetFormatMessageText(const WideString &wsMessage)
ByteString ToUTF8() const
WideString & operator=(WideString &&that) noexcept
WideString(const WideString &other)=default
static WideString FromASCII(ByteStringView str)
static WideString FormatInteger(int i)
bool EqualsASCII(ByteStringView that) const
CXFA_Node * ToNode(CXFA_Object *pObj)
WideString operator+(const wchar_t *str1, const WideString &str2)
bool IsUndefined(v8::Local< v8::Value > value)
bool IsNull(v8::Local< v8::Value > value)
fxcrt::WideStringView WideStringView
fxcrt::WideString WideString
bool XFA_FDEExtension_ResolveNamespaceQualifier(CFX_XMLElement *pNode, const WideString &wsQualifier, WideString *wsNamespaceURI)
bool XFA_FieldIsMultiListBox(const CXFA_Node *pFieldNode)