Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CJS_Runtime Class Referencefinal

#include <cjs_runtime.h>

+ Inheritance diagram for CJS_Runtime:
+ Collaboration diagram for CJS_Runtime:

Public Types

using FieldEvent = std::pair<WideString, CJS_EventContext::Kind>
 
- Public Types inherited from CFXJS_Engine
using Constructor
 
using Destructor = std::function<void(v8::Local<v8::Object> obj)>
 

Public Member Functions

 CJS_Runtime (CPDFSDK_FormFillEnvironment *pFormFillEnv)
 
 ~CJS_Runtime () override
 
CJS_RuntimeAsCJSRuntime () override
 
IJS_EventContextNewEventContext () override
 
void ReleaseEventContext (IJS_EventContext *pContext) override
 
CPDFSDK_FormFillEnvironmentGetFormFillEnv () const override
 
absl::optional< IJS_Runtime::JS_ErrorExecuteScript (const WideString &script) override
 
CJS_EventContextGetCurrentEventContext () const
 
CFX_Timer::HandlerIfaceGetTimerHandler () const
 
bool AddEventToSet (const FieldEvent &event)
 
void RemoveEventFromSet (const FieldEvent &event)
 
void BeginBlock ()
 
void EndBlock ()
 
bool IsBlocking () const
 
v8::Local< v8::Value > MaybeCoerceToNumber (v8::Local< v8::Value > value)
 
v8::Local< v8::Value > GetValueByNameFromGlobalObject (ByteStringView utf8Name)
 
bool SetValueByNameInGlobalObject (ByteStringView utf8Name, v8::Local< v8::Value > pValue)
 
- Public Member Functions inherited from IJS_Runtime
virtual ~IJS_Runtime ()
 
- Public Member Functions inherited from CFXJS_Engine
 CFXJS_Engine (v8::Isolate *pIsolate)
 
 ~CFXJS_Engine () override
 
uint32_t DefineObj (const char *sObjName, FXJSOBJTYPE eObjType, Constructor pConstructor, Destructor pDestructor)
 
void DefineObjMethod (uint32_t nObjDefnID, const char *sMethodName, v8::FunctionCallback pMethodCall)
 
void DefineObjProperty (uint32_t nObjDefnID, const char *sPropName, v8::AccessorGetterCallback pPropGet, v8::AccessorSetterCallback pPropPut)
 
void DefineObjAllProperties (uint32_t nObjDefnID, v8::GenericNamedPropertyQueryCallback pPropQurey, v8::GenericNamedPropertyGetterCallback pPropGet, v8::GenericNamedPropertySetterCallback pPropPut, v8::GenericNamedPropertyDeleterCallback pPropDel, v8::GenericNamedPropertyEnumeratorCallback pPropEnum)
 
void DefineObjConst (uint32_t nObjDefnID, const char *sConstName, v8::Local< v8::Value > pDefault)
 
void DefineGlobalMethod (const char *sMethodName, v8::FunctionCallback pMethodCall)
 
void DefineGlobalConst (const wchar_t *sConstName, v8::FunctionCallback pConstGetter)
 
void InitializeEngine ()
 
void ReleaseEngine ()
 
absl::optional< IJS_Runtime::JS_ErrorExecute (const WideString &script)
 
v8::Local< v8::Object > GetThisObj ()
 
v8::Local< v8::Object > NewFXJSBoundObject (uint32_t nObjDefnID, FXJSOBJTYPE type)
 
void Error (const WideString &message)
 
v8::Local< v8::Context > GetV8Context ()
 
v8::Local< v8::Array > GetConstArray (const WideString &name)
 
void SetConstArray (const WideString &name, v8::Local< v8::Array > array)
 
- Public Member Functions inherited from CFX_V8
 CFX_V8 (v8::Isolate *pIsolate)
 
virtual ~CFX_V8 ()
 
v8::Isolate * GetIsolate () const
 
v8::Local< v8::Value > NewNull ()
 
v8::Local< v8::Value > NewUndefined ()
 
v8::Local< v8::Array > NewArray ()
 
v8::Local< v8::Object > NewObject ()
 
v8::Local< v8::Number > NewNumber (int number)
 
v8::Local< v8::Number > NewNumber (double number)
 
v8::Local< v8::Number > NewNumber (float number)
 
v8::Local< v8::Boolean > NewBoolean (bool b)
 
v8::Local< v8::String > NewString (ByteStringView str)
 
v8::Local< v8::String > NewString (WideStringView str)
 
v8::Local< v8::Date > NewDate (double d)
 
int ToInt32 (v8::Local< v8::Value > pValue)
 
bool ToBoolean (v8::Local< v8::Value > pValue)
 
double ToDouble (v8::Local< v8::Value > pValue)
 
WideString ToWideString (v8::Local< v8::Value > pValue)
 
ByteString ToByteString (v8::Local< v8::Value > pValue)
 
v8::Local< v8::Object > ToObject (v8::Local< v8::Value > pValue)
 
v8::Local< v8::Array > ToArray (v8::Local< v8::Value > pValue)
 
size_t GetArrayLength (v8::Local< v8::Array > pArray)
 
v8::Local< v8::Value > GetArrayElement (v8::Local< v8::Array > pArray, size_t index)
 
void PutArrayElement (v8::Local< v8::Array > pArray, size_t index, v8::Local< v8::Value > pValue)
 
std::vector< WideStringGetObjectPropertyNames (v8::Local< v8::Object > pObj)
 
v8::Local< v8::Value > GetObjectProperty (v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName)
 
void PutObjectProperty (v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName, v8::Local< v8::Value > pValue)
 
- Public Member Functions inherited from fxcrt::Observable
 Observable ()
 
 Observable (const Observable &that)=delete
 
Observableoperator= (const Observable &that)=delete
 
 ~Observable ()
 
void AddObserver (ObserverIface *pObserver)
 
void RemoveObserver (ObserverIface *pObserver)
 
void NotifyObservers ()
 

Additional Inherited Members

- Static Public Member Functions inherited from IJS_Runtime
static void Initialize (unsigned int slot, void *isolate, void *platform)
 
static void Destroy ()
 
static std::unique_ptr< IJS_RuntimeCreate (CPDFSDK_FormFillEnvironment *pFormFillEnv)
 
- Static Public Member Functions inherited from CFXJS_Engine
static uint32_t GetObjDefnID (v8::Local< v8::Object > pObj)
 
static CJS_ObjectGetObjectPrivate (v8::Isolate *pIsolate, v8::Local< v8::Object > pObj)
 
static void SetObjectPrivate (v8::Local< v8::Object > pObj, std::unique_ptr< CJS_Object > p)
 
static void FreeObjectPrivate (v8::Local< v8::Object > pObj)
 
- Protected Member Functions inherited from IJS_Runtime
 IJS_Runtime ()=default
 
- Protected Member Functions inherited from CFXJS_Engine
 CFXJS_Engine ()
 
- Protected Member Functions inherited from CFX_V8
void SetIsolate (v8::Isolate *pIsolate)
 
void DisposeIsolate ()
 
- Protected Member Functions inherited from fxcrt::Observable
size_t ActiveObserversForTesting () const
 

Detailed Description

Definition at line 23 of file cjs_runtime.h.

Member Typedef Documentation

◆ FieldEvent

Definition at line 27 of file cjs_runtime.h.

Constructor & Destructor Documentation

◆ CJS_Runtime()

CJS_Runtime::CJS_Runtime ( CPDFSDK_FormFillEnvironment * pFormFillEnv)
explicit

Definition at line 47 of file cjs_runtime.cpp.

References CJS_Runtime(), CFXJS_Engine::InitializeEngine(), _IPDF_JsPlatform::m_isolate, _IPDF_JsPlatform::m_v8EmbedderSlot, and _IPDF_JsPlatform::version.

Referenced by CJS_Runtime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~CJS_Runtime()

CJS_Runtime::~CJS_Runtime ( )
override

Definition at line 75 of file cjs_runtime.cpp.

References CFX_V8::DisposeIsolate(), fxcrt::Observable::NotifyObservers(), and CFXJS_Engine::ReleaseEngine().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddEventToSet()

bool CJS_Runtime::AddEventToSet ( const FieldEvent & event)

Definition at line 174 of file cjs_runtime.cpp.

◆ AsCJSRuntime()

CJS_Runtime * CJS_Runtime::AsCJSRuntime ( )
overridevirtual

Implements IJS_Runtime.

Definition at line 182 of file cjs_runtime.cpp.

◆ BeginBlock()

void CJS_Runtime::BeginBlock ( )
inline

Definition at line 47 of file cjs_runtime.h.

◆ EndBlock()

void CJS_Runtime::EndBlock ( )
inline

Definition at line 48 of file cjs_runtime.h.

◆ ExecuteScript()

absl::optional< IJS_Runtime::JS_Error > CJS_Runtime::ExecuteScript ( const WideString & script)
overridevirtual

Implements IJS_Runtime.

Definition at line 169 of file cjs_runtime.cpp.

◆ GetCurrentEventContext()

◆ GetFormFillEnv()

CPDFSDK_FormFillEnvironment * CJS_Runtime::GetFormFillEnv ( ) const
overridevirtual

Implements IJS_Runtime.

Definition at line 165 of file cjs_runtime.cpp.

Referenced by CJS_PublicMethods::AFSimple_Calculate().

+ Here is the caller graph for this function:

◆ GetTimerHandler()

CFX_Timer::HandlerIface * CJS_Runtime::GetTimerHandler ( ) const

Definition at line 144 of file cjs_runtime.cpp.

Referenced by GlobalTimer::GlobalTimer().

+ Here is the caller graph for this function:

◆ GetValueByNameFromGlobalObject()

v8::Local< v8::Value > CJS_Runtime::GetValueByNameFromGlobalObject ( ByteStringView utf8Name)

Definition at line 186 of file cjs_runtime.cpp.

◆ IsBlocking()

bool CJS_Runtime::IsBlocking ( ) const
inline

Definition at line 49 of file cjs_runtime.h.

◆ MaybeCoerceToNumber()

v8::Local< v8::Value > CJS_Runtime::MaybeCoerceToNumber ( v8::Local< v8::Value > value)

Definition at line 212 of file cjs_runtime.cpp.

◆ NewEventContext()

IJS_EventContext * CJS_Runtime::NewEventContext ( )
overridevirtual

Implements IJS_Runtime.

Definition at line 129 of file cjs_runtime.cpp.

Referenced by TEST_F(), and TEST_F().

+ Here is the caller graph for this function:

◆ ReleaseEventContext()

void CJS_Runtime::ReleaseEventContext ( IJS_EventContext * pContext)
overridevirtual

Implements IJS_Runtime.

Definition at line 134 of file cjs_runtime.cpp.

◆ RemoveEventFromSet()

void CJS_Runtime::RemoveEventFromSet ( const FieldEvent & event)

Definition at line 178 of file cjs_runtime.cpp.

◆ SetValueByNameInGlobalObject()

bool CJS_Runtime::SetValueByNameInGlobalObject ( ByteStringView utf8Name,
v8::Local< v8::Value > pValue )

Definition at line 198 of file cjs_runtime.cpp.


The documentation for this class was generated from the following files: