chromium/third_party/pdfium/fxjs/xfa/cjx_object.cpp

// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#include "fxjs/xfa/cjx_object.h"

#include <set>
#include <tuple>
#include <utility>

#include "core/fxcrt/check.h"
#include "core/fxcrt/check_op.h"
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/xml/cfx_xmlelement.h"
#include "core/fxcrt/xml/cfx_xmltext.h"
#include "fxjs/cjs_result.h"
#include "fxjs/fxv8.h"
#include "fxjs/gc/container_trace.h"
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_mapmodule.h"
#include "fxjs/xfa/cjx_boolean.h"
#include "fxjs/xfa/cjx_draw.h"
#include "fxjs/xfa/cjx_field.h"
#include "fxjs/xfa/cjx_instancemanager.h"
#include "v8/include/v8-forward.h"
#include "v8/include/v8-object.h"
#include "v8/include/v8-primitive.h"
#include "xfa/fgas/crt/cfgas_decimal.h"
#include "xfa/fgas/graphics/cfgas_gecolor.h"
#include "xfa/fxfa/cxfa_ffnotify.h"
#include "xfa/fxfa/cxfa_ffwidget.h"
#include "xfa/fxfa/parser/cxfa_border.h"
#include "xfa/fxfa/parser/cxfa_datavalue.h"
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_edge.h"
#include "xfa/fxfa/parser/cxfa_fill.h"
#include "xfa/fxfa/parser/cxfa_font.h"
#include "xfa/fxfa/parser/cxfa_measurement.h"
#include "xfa/fxfa/parser/cxfa_node.h"
#include "xfa/fxfa/parser/cxfa_object.h"
#include "xfa/fxfa/parser/cxfa_occur.h"
#include "xfa/fxfa/parser/cxfa_proto.h"
#include "xfa/fxfa/parser/cxfa_subform.h"
#include "xfa/fxfa/parser/cxfa_validate.h"
#include "xfa/fxfa/parser/cxfa_value.h"
#include "xfa/fxfa/parser/xfa_basic_data.h"
#include "xfa/fxfa/parser/xfa_utils.h"

namespace {

enum XFA_KEYTYPE {};

uint32_t GetMapKey_Custom(WideStringView wsKey) {}

uint32_t GetMapKey_Element(XFA_Element eType, XFA_Attribute eAttribute) {}

std::tuple<int32_t, int32_t, int32_t> StrToRGB(const WideString& strRGB) {}

v8::Local<v8::String> ColorToV8String(v8::Isolate* isolate, FX_ARGB color) {}

}  // namespace

CJX_Object::CJX_Object(CXFA_Object* obj) :{}

CJX_Object::~CJX_Object() = default;

CJX_Object* CJX_Object::AsCJXObject() {}

void CJX_Object::Trace(cppgc::Visitor* visitor) const {}

bool CJX_Object::DynamicTypeIs(TypeTag eType) const {}

void CJX_Object::DefineMethods(pdfium::span<const CJX_MethodSpec> methods) {}

CXFA_Document* CJX_Object::GetDocument() const {}

CXFA_Node* CJX_Object::GetXFANode() const {}

void CJX_Object::className(v8::Isolate* pIsolate,
                           v8::Local<v8::Value>* pValue,
                           bool bSetting,
                           XFA_Attribute eAttribute) {}

int32_t CJX_Object::Subform_and_SubformSet_InstanceIndex() {}

bool CJX_Object::HasMethod(const WideString& func) const {}

CJS_Result CJX_Object::RunMethod(CFXJSE_Engine* pScriptContext,
                                 const WideString& func,
                                 pdfium::span<v8::Local<v8::Value>> params) {}

void CJX_Object::ThrowTooManyOccurrencesException(v8::Isolate* pIsolate,
                                                  const WideString& obj) const {}

void CJX_Object::ThrowInvalidPropertyException(v8::Isolate* pIsolate) const {}

void CJX_Object::ThrowIndexOutOfBoundsException(v8::Isolate* pIsolate) const {}

void CJX_Object::ThrowParamCountMismatchException(
    v8::Isolate* pIsolate,
    const WideString& method) const {}

void CJX_Object::ThrowArgumentMismatchException(v8::Isolate* pIsolate) const {}

void CJX_Object::ThrowException(v8::Isolate* pIsolate,
                                const WideString& str) const {}

bool CJX_Object::HasAttribute(XFA_Attribute eAttr) const {}

void CJX_Object::SetAttributeByEnum(XFA_Attribute eAttr,
                                    const WideString& wsValue,
                                    bool bNotify) {}

void CJX_Object::SetAttributeByString(WideStringView wsAttr,
                                      const WideString& wsValue) {}

WideString CJX_Object::GetAttributeByString(WideStringView attr) const {}

WideString CJX_Object::GetAttributeByEnum(XFA_Attribute attr) const {}

std::optional<WideString> CJX_Object::TryAttribute(XFA_Attribute eAttr,
                                                   bool bUseDefault) const {}

void CJX_Object::RemoveAttribute(WideStringView wsAttr) {}

std::optional<bool> CJX_Object::TryBoolean(XFA_Attribute eAttr,
                                           bool bUseDefault) const {}

void CJX_Object::SetBoolean(XFA_Attribute eAttr, bool bValue, bool bNotify) {}

bool CJX_Object::GetBoolean(XFA_Attribute eAttr) const {}

void CJX_Object::SetInteger(XFA_Attribute eAttr, int32_t iValue, bool bNotify) {}

int32_t CJX_Object::GetInteger(XFA_Attribute eAttr) const {}

std::optional<int32_t> CJX_Object::TryInteger(XFA_Attribute eAttr,
                                              bool bUseDefault) const {}

std::optional<XFA_AttributeValue> CJX_Object::TryEnum(XFA_Attribute eAttr,
                                                      bool bUseDefault) const {}

void CJX_Object::SetEnum(XFA_Attribute eAttr,
                         XFA_AttributeValue eValue,
                         bool bNotify) {}

XFA_AttributeValue CJX_Object::GetEnum(XFA_Attribute eAttr) const {}

void CJX_Object::SetMeasure(XFA_Attribute eAttr,
                            const CXFA_Measurement& mValue,
                            bool bNotify) {}

std::optional<CXFA_Measurement> CJX_Object::TryMeasure(XFA_Attribute eAttr,
                                                       bool bUseDefault) const {}

std::optional<float> CJX_Object::TryMeasureAsFloat(XFA_Attribute attr) const {}

CXFA_Measurement CJX_Object::GetMeasure(XFA_Attribute eAttr) const {}

float CJX_Object::GetMeasureInUnit(XFA_Attribute eAttr, XFA_Unit unit) const {}

WideString CJX_Object::GetCData(XFA_Attribute eAttr) const {}

void CJX_Object::SetCData(XFA_Attribute eAttr, const WideString& wsValue) {}

void CJX_Object::SetCDataImpl(XFA_Attribute eAttr,
                              const WideString& wsValue,
                              bool bNotify,
                              bool bScriptModify) {}

void CJX_Object::SetAttributeValue(const WideString& wsValue,
                                   const WideString& wsXMLValue) {}

void CJX_Object::SetAttributeValueImpl(const WideString& wsValue,
                                       const WideString& wsXMLValue,
                                       bool bNotify,
                                       bool bScriptModify) {}

std::optional<WideString> CJX_Object::TryCData(XFA_Attribute eAttr,
                                               bool bUseDefault) const {}

CFX_XMLElement* CJX_Object::SetValue(XFA_Attribute eAttr,
                                     int32_t value,
                                     bool bNotify) {}

void CJX_Object::SetContent(const WideString& wsContent,
                            const WideString& wsXMLValue,
                            bool bNotify,
                            bool bScriptModify,
                            bool bSyncData) {}

WideString CJX_Object::GetContent(bool bScriptModify) const {}

std::optional<WideString> CJX_Object::TryContent(bool bScriptModify,
                                                 bool bProto) const {}

std::optional<WideString> CJX_Object::TryNamespace() const {}

CXFA_Node* CJX_Object::GetPropertyInternal(int32_t index,
                                           XFA_Element eProperty) const {}

CXFA_Node* CJX_Object::GetOrCreatePropertyInternal(int32_t index,
                                                   XFA_Element eProperty) {}

CFXJSE_MapModule* CJX_Object::CreateMapModule() {}

CFXJSE_MapModule* CJX_Object::GetMapModule() const {}

void CJX_Object::SetMapModuleValue(uint32_t key, int32_t value) {}

void CJX_Object::SetMapModuleString(uint32_t key, const WideString& wsValue) {}

void CJX_Object::SetMapModuleMeasurement(uint32_t key,
                                         const CXFA_Measurement& value) {}

std::optional<int32_t> CJX_Object::GetMapModuleValue(uint32_t key) const {}

std::optional<WideString> CJX_Object::GetMapModuleString(uint32_t key) const {}

std::optional<CXFA_Measurement> CJX_Object::GetMapModuleMeasurement(
    uint32_t key) const {}

std::optional<int32_t> CJX_Object::GetMapModuleValueFollowingChain(
    uint32_t key) const {}

std::optional<WideString> CJX_Object::GetMapModuleStringFollowingChain(
    uint32_t key) const {}

std::optional<CXFA_Measurement>
CJX_Object::GetMapModuleMeasurementFollowingChain(uint32_t key) const {}

bool CJX_Object::HasMapModuleKey(uint32_t key) const {}

void CJX_Object::RemoveMapModuleKey(uint32_t key) {}

void CJX_Object::MergeAllData(CXFA_Object* pDstObj) {}

void CJX_Object::MoveBufferMapData(CXFA_Object* pDstObj) {}

void CJX_Object::MoveBufferMapData(CXFA_Object* pSrcObj, CXFA_Object* pDstObj) {}

void CJX_Object::OnChanging(XFA_Attribute eAttr) {}

void CJX_Object::OnChanged(XFA_Attribute eAttr, bool bScriptModify) {}

CJX_Object::CalcData* CJX_Object::GetOrCreateCalcData(cppgc::Heap* heap) {}

void CJX_Object::TakeCalcDataFrom(CJX_Object* that) {}

void CJX_Object::ScriptAttributeString(v8::Isolate* pIsolate,
                                       v8::Local<v8::Value>* pValue,
                                       bool bSetting,
                                       XFA_Attribute eAttribute) {}

void CJX_Object::ScriptAttributeBool(v8::Isolate* pIsolate,
                                     v8::Local<v8::Value>* pValue,
                                     bool bSetting,
                                     XFA_Attribute eAttribute) {}

void CJX_Object::ScriptAttributeInteger(v8::Isolate* pIsolate,
                                        v8::Local<v8::Value>* pValue,
                                        bool bSetting,
                                        XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomFontColor(v8::Isolate* pIsolate,
                                    v8::Local<v8::Value>* pValue,
                                    bool bSetting,
                                    XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomFillColor(v8::Isolate* pIsolate,
                                    v8::Local<v8::Value>* pValue,
                                    bool bSetting,
                                    XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomBorderColor(v8::Isolate* pIsolate,
                                      v8::Local<v8::Value>* pValue,
                                      bool bSetting,
                                      XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomBorderWidth(v8::Isolate* pIsolate,
                                      v8::Local<v8::Value>* pValue,
                                      bool bSetting,
                                      XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomMessage(v8::Isolate* pIsolate,
                                  v8::Local<v8::Value>* pValue,
                                  bool bSetting,
                                  SOMMessageType iMessageType) {}

void CJX_Object::ScriptSomValidationMessage(v8::Isolate* pIsolate,
                                            v8::Local<v8::Value>* pValue,
                                            bool bSetting,
                                            XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomMandatoryMessage(v8::Isolate* pIsolate,
                                           v8::Local<v8::Value>* pValue,
                                           bool bSetting,
                                           XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomDefaultValue(v8::Isolate* pIsolate,
                                       v8::Local<v8::Value>* pValue,
                                       bool bSetting,
                                       XFA_Attribute /* unused */) {}

void CJX_Object::ScriptSomDefaultValue_Read(v8::Isolate* pIsolate,
                                            v8::Local<v8::Value>* pValue,
                                            bool bSetting,
                                            XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomDataNode(v8::Isolate* pIsolate,
                                   v8::Local<v8::Value>* pValue,
                                   bool bSetting,
                                   XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomMandatory(v8::Isolate* pIsolate,
                                    v8::Local<v8::Value>* pValue,
                                    bool bSetting,
                                    XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSomInstanceIndex(v8::Isolate* pIsolate,
                                        v8::Local<v8::Value>* pValue,
                                        bool bSetting,
                                        XFA_Attribute eAttribute) {}

void CJX_Object::ScriptSubmitFormatMode(v8::Isolate* pIsolate,
                                        v8::Local<v8::Value>* pValue,
                                        bool bSetting,
                                        XFA_Attribute eAttribute) {}

CJX_Object::CalcData::CalcData() = default;

CJX_Object::CalcData::~CalcData() = default;

void CJX_Object::CalcData::Trace(cppgc::Visitor* visitor) const {}