7#ifndef FXJS_GLOBAL_TIMER_H_
8#define FXJS_GLOBAL_TIMER_H_
10#include "core/fxcrt/unowned_ptr.h"
11#include "fxjs/cjs_runtime.h"
26 CJS_Runtime* pRuntime,
28 const WideString& script,
33 static void Trigger(int32_t nTimerID);
34 static void Cancel(int32_t nTimerID);
39 CJS_Runtime*
GetRuntime()
const {
return m_pRuntime.Get(); }
43 bool HasValidID()
const;
46 bool m_bProcessing =
false;
47 const int32_t m_nTimerID;
48 const uint32_t m_dwTimeOut;
49 const WideString m_swJScript;
50 ObservedPtr<CJS_Runtime> m_pRuntime;
static void DefineJSObjects(CFXJS_Engine *pEngine)
static WideString SysPathToPDFPath(const WideString &sOldPath)
void CancelProc(GlobalTimer *pTimer)
static uint32_t GetObjDefnID()
void TimerProc(GlobalTimer *pTimer)
CJS_App(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
void DoFieldDelay(const WideString &sFieldName, int nControlIndex)
CJS_Document(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
void SetFormFillEnv(CPDFSDK_FormFillEnvironment *pFormFillEnv)
void AddDelayData(std::unique_ptr< CJS_DelayData > pData)
static uint32_t GetObjDefnID()
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const
static void DefineJSObjects(CFXJS_Engine *pEngine)
static void DefineProps(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSPropertySpec > consts)
static void DefineMethods(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSMethodSpec > consts)
static CJS_Result Success()
static CJS_Result Failure(JSMessage id)
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const override
static uint32_t GetObjDefnID()
static void DefineJSObjects(CFXJS_Engine *pEngine)
CJS_TimerObj(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
void SetTimer(GlobalTimer *pTimer)
virtual bool ContainsExtensionForm() const =0
uint32_t GetTimeOut() const
static void DestroyGlobals()
static void InitializeGlobals()
CJS_Runtime * GetRuntime() const
GlobalTimer(CJS_App *pObj, CJS_Runtime *pRuntime, Type nType, const WideString &script, uint32_t dwElapse, uint32_t dwTimeOut)
int32_t GetTimerID() const
WideString GetJScript() const
static void Trigger(int32_t nTimerID)
static void Cancel(int32_t nTimerID)
virtual void OnExternal_Exec()=0
IJS_EventContext * operator->() const
WideString & operator=(WideString &&that) noexcept
WideString & operator+=(const wchar_t *str)
WideString & operator+=(wchar_t ch)
static WideString FromUTF16LE(pdfium::span< const uint8_t > data)
WideString & operator=(const wchar_t *str)
#define JS_STATIC_METHOD(method_name, class_name)
#define JS_STATIC_PROP(err_name, prop_name, class_name)
WideString JSGetStringFromID(JSMessage msg)