7#ifndef FXJS_IJS_RUNTIME_H_
8#define FXJS_IJS_RUNTIME_H_
12#include "core/fxcrt/fx_memory.h"
13#include "core/fxcrt/unowned_ptr.h"
14#include "core/fxcrt/widestring.h"
15#include "third_party/abseil-cpp/absl/types/optional.h"
18class CPDFSDK_FormFillEnvironment;
31 JS_Error(
int line,
int column,
const WideString& exception);
49 static void Initialize(
unsigned int slot,
void* isolate,
void* platform);
52 CPDFSDK_FormFillEnvironment* pFormFillEnv);
FX_RECT GetOuterRect() const
static constexpr int32_t kInvalidTimerID
static bool OnKillFocus(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags)
CPDFSDK_PageView * GetPageView() const
static bool OnSetFocus(ObservedPtr< CPDFSDK_Annot > &pAnnot, Mask< FWL_EVENTFLAG > nFlags)
bool IsValidSDKAnnot(const CPDFSDK_Annot *p) const
bool IsBeingDestroyed() const
static bool IsUserInput(AActionType type)
CPDF_Dest GetDest(CPDF_Document *pDoc) const
ByteString GetURI(const CPDF_Document *pDoc) const
const CPDF_Dictionary * GetDict() const
WideString GetJavaScript() const
ByteString GetNamedAction() const
int GetDestPageIndex(CPDF_Document *pDoc) const
RetainPtr< const CPDF_Array > GetArrayFor(const ByteString &key) const
virtual void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget)=0
virtual void OnField_Validate(WideString *strChange, const WideString &strChangeEx, bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField *pTarget, WideString *Value, bool *bRc)=0
virtual void OnField_Format(CPDF_FormField *pTarget, WideString *Value)=0
virtual void OnField_Keystroke(WideString *strChange, const WideString &strChangeEx, bool KeyDown, bool bModifier, int *nSelEnd, int *nSelStart, bool bShift, CPDF_FormField *pTarget, WideString *Value, bool bWillCommit, bool bFieldFull, bool *bRc)=0
virtual void OnDoc_DidSave()=0
virtual void OnDoc_WillClose()=0
virtual void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget)=0
virtual ~IJS_EventContext()=default
virtual void OnPage_InView()=0
virtual void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField *pTarget, WideString *Value)=0
virtual void OnField_Calculate(CPDF_FormField *pSource, CPDF_FormField *pTarget, WideString *Value, bool *bRc)=0
virtual void OnPage_Close()=0
virtual void OnDoc_WillPrint()=0
virtual void OnDoc_WillSave()=0
virtual void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget)=0
virtual void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget)=0
virtual void OnDoc_DidPrint()=0
virtual void OnExternal_Exec()=0
virtual void OnDoc_Open(const WideString &strTargetName)=0
virtual void OnPage_Open()=0
virtual void OnPage_OutView()=0
virtual absl::optional< IJS_Runtime::JS_Error > RunScript(const WideString &script)=0
virtual void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField *pTarget, WideString *Value)=0
IJS_EventContext * Get() const
IJS_EventContext * operator->() const
ScopedEventContext(IJS_Runtime *pRuntime)
virtual absl::optional< JS_Error > ExecuteScript(const WideString &script)=0
static std::unique_ptr< IJS_Runtime > Create(CPDFSDK_FormFillEnvironment *pFormFillEnv)
virtual IJS_EventContext * NewEventContext()=0
static void Initialize(unsigned int slot, void *isolate, void *platform)
virtual CJS_Runtime * AsCJSRuntime()=0
virtual CPDFSDK_FormFillEnvironment * GetFormFillEnv() const =0
virtual void ReleaseEventContext(IJS_EventContext *pContext)=0
const char * c_str() const
ByteString ToUTF16LE() const
CFFL_FieldAction(const CFFL_FieldAction &other)=delete
JS_Error(int line, int column, const WideString &exception)