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_EventContext Class Referencefinal

#include <cjs_event_context.h>

+ Inheritance diagram for CJS_EventContext:
+ Collaboration diagram for CJS_EventContext:

Public Types

enum class  Kind : uint8_t {
  kUnknown , kDocOpen , kDocWillPrint , kDocDidPrint ,
  kDocWillSave , kDocDidSave , kDocWillClose , kPageOpen ,
  kPageClose , kPageInView , kPageOutView , kFieldMouseDown ,
  kFieldMouseUp , kFieldMouseEnter , kFieldMouseExit , kFieldFocus ,
  kFieldBlur , kFieldKeystroke , kFieldValidate , kFieldCalculate ,
  kFieldFormat , kExternalExec
}
 

Public Member Functions

 CJS_EventContext (CJS_Runtime *pRuntime)
 
 ~CJS_EventContext () override
 
absl::optional< IJS_Runtime::JS_ErrorRunScript (const WideString &script) override
 
void OnDoc_Open (const WideString &strTargetName) override
 
void OnDoc_WillPrint () override
 
void OnDoc_DidPrint () override
 
void OnDoc_WillSave () override
 
void OnDoc_DidSave () override
 
void OnDoc_WillClose () override
 
void OnPage_Open () override
 
void OnPage_Close () override
 
void OnPage_InView () override
 
void OnPage_OutView () override
 
void OnField_MouseDown (bool bModifier, bool bShift, CPDF_FormField *pTarget) override
 
void OnField_MouseEnter (bool bModifier, bool bShift, CPDF_FormField *pTarget) override
 
void OnField_MouseExit (bool bModifier, bool bShift, CPDF_FormField *pTarget) override
 
void OnField_MouseUp (bool bModifier, bool bShift, CPDF_FormField *pTarget) override
 
void OnField_Focus (bool bModifier, bool bShift, CPDF_FormField *pTarget, WideString *Value) override
 
void OnField_Blur (bool bModifier, bool bShift, CPDF_FormField *pTarget, WideString *Value) override
 
void OnField_Calculate (CPDF_FormField *pSource, CPDF_FormField *pTarget, WideString *pValue, bool *pRc) override
 
void OnField_Format (CPDF_FormField *pTarget, WideString *Value) override
 
void OnField_Keystroke (WideString *strChange, const WideString &strChangeEx, bool bKeyDown, bool bModifier, int *nSelEnd, int *nSelStart, bool bShift, CPDF_FormField *pTarget, WideString *Value, bool bWillCommit, bool bFieldFull, bool *bRc) override
 
void OnField_Validate (WideString *strChange, const WideString &strChangeEx, bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField *pTarget, WideString *Value, bool *bRc) override
 
void OnExternal_Exec () override
 
CJS_RuntimeGetJSRuntime () const
 
CPDFSDK_FormFillEnvironmentGetFormFillEnv () const
 
CJS_FieldSourceField ()
 
CJS_FieldTargetField ()
 
Kind EventKind () const
 
bool IsValid () const
 
bool IsUserGesture () const
 
WideStringChange ()
 
WideString ChangeEx () const
 
WideString SourceName () const
 
WideString TargetName () const
 
int CommitKey () const
 
bool FieldFull () const
 
bool KeyDown () const
 
bool Modifier () const
 
ByteStringView Name () const
 
ByteStringView Type () const
 
bool & Rc ()
 
int SelEnd () const
 
int SelStart () const
 
void SetSelEnd (int value)
 
void SetSelStart (int value)
 
bool Shift () const
 
bool HasValue () const
 
WideStringValue ()
 
bool WillCommit () const
 
void SetValueForTest (WideString *pStr)
 
void SetRCForTest (bool *pRC)
 
void SetStrChangeForTest (WideString *pStrChange)
 
void ResetWillCommitForTest ()
 
- Public Member Functions inherited from IJS_EventContext
virtual ~IJS_EventContext ()=default
 

Detailed Description

Definition at line 19 of file cjs_event_context.h.

Member Enumeration Documentation

◆ Kind

enum class CJS_EventContext::Kind : uint8_t
strong
Enumerator
kUnknown 
kDocOpen 
kDocWillPrint 
kDocDidPrint 
kDocWillSave 
kDocDidSave 
kDocWillClose 
kPageOpen 
kPageClose 
kPageInView 
kPageOutView 
kFieldMouseDown 
kFieldMouseUp 
kFieldMouseEnter 
kFieldMouseExit 
kFieldFocus 
kFieldBlur 
kFieldKeystroke 
kFieldValidate 
kFieldCalculate 
kFieldFormat 
kExternalExec 

Definition at line 21 of file cjs_event_context.h.

Constructor & Destructor Documentation

◆ CJS_EventContext()

CJS_EventContext::CJS_EventContext ( CJS_Runtime * pRuntime)
explicit

Definition at line 20 of file cjs_event_context.cpp.

References CJS_EventContext().

Referenced by CJS_EventContext().

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

◆ ~CJS_EventContext()

CJS_EventContext::~CJS_EventContext ( )
overridedefault

Member Function Documentation

◆ Change()

WideString & CJS_EventContext::Change ( )

Definition at line 321 of file cjs_event_context.cpp.

Referenced by CJS_PublicMethods::AFMergeChange(), CJS_PublicMethods::AFNumber_Keystroke(), CJS_PublicMethods::AFSpecial_Keystroke(), and CJS_PublicMethods::AFSpecial_KeystrokeEx().

+ Here is the caller graph for this function:

◆ ChangeEx()

WideString CJS_EventContext::ChangeEx ( ) const
inline

Definition at line 120 of file cjs_event_context.h.

◆ CommitKey()

int CJS_EventContext::CommitKey ( ) const
inline

Definition at line 123 of file cjs_event_context.h.

◆ EventKind()

Kind CJS_EventContext::EventKind ( ) const
inline

Definition at line 116 of file cjs_event_context.h.

◆ FieldFull()

bool CJS_EventContext::FieldFull ( ) const
inline

Definition at line 124 of file cjs_event_context.h.

◆ GetFormFillEnv()

CPDFSDK_FormFillEnvironment * CJS_EventContext::GetFormFillEnv ( ) const
inline

Definition at line 110 of file cjs_event_context.h.

Referenced by SourceField(), and TargetField().

+ Here is the caller graph for this function:

◆ GetJSRuntime()

CJS_Runtime * CJS_EventContext::GetJSRuntime ( ) const
inline

Definition at line 109 of file cjs_event_context.h.

◆ HasValue()

bool CJS_EventContext::HasValue ( ) const
inline

◆ IsUserGesture()

bool CJS_EventContext::IsUserGesture ( ) const

Definition at line 310 of file cjs_event_context.cpp.

References kFieldKeystroke, kFieldMouseDown, and kFieldMouseUp.

◆ IsValid()

bool CJS_EventContext::IsValid ( ) const
inline

Definition at line 117 of file cjs_event_context.h.

◆ KeyDown()

bool CJS_EventContext::KeyDown ( ) const
inline

Definition at line 125 of file cjs_event_context.h.

◆ Modifier()

bool CJS_EventContext::Modifier ( ) const
inline

Definition at line 126 of file cjs_event_context.h.

◆ Name()

◆ OnDoc_DidPrint()

void CJS_EventContext::OnDoc_DidPrint ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 109 of file cjs_event_context.cpp.

References kDocDidPrint.

◆ OnDoc_DidSave()

void CJS_EventContext::OnDoc_DidSave ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 117 of file cjs_event_context.cpp.

References kDocDidSave.

◆ OnDoc_Open()

void CJS_EventContext::OnDoc_Open ( const WideString & strTargetName)
overridevirtual

Implements IJS_EventContext.

Definition at line 100 of file cjs_event_context.cpp.

References kDocOpen.

◆ OnDoc_WillClose()

void CJS_EventContext::OnDoc_WillClose ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 121 of file cjs_event_context.cpp.

References kDocWillClose.

◆ OnDoc_WillPrint()

void CJS_EventContext::OnDoc_WillPrint ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 105 of file cjs_event_context.cpp.

References kDocWillPrint.

◆ OnDoc_WillSave()

void CJS_EventContext::OnDoc_WillSave ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 113 of file cjs_event_context.cpp.

References kDocWillSave.

◆ OnExternal_Exec()

void CJS_EventContext::OnExternal_Exec ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 279 of file cjs_event_context.cpp.

References kExternalExec.

◆ OnField_Blur()

void CJS_EventContext::OnField_Blur ( bool bModifier,
bool bShift,
CPDF_FormField * pTarget,
WideString * Value )
overridevirtual

Implements IJS_EventContext.

Definition at line 189 of file cjs_event_context.cpp.

References kFieldBlur.

◆ OnField_Calculate()

void CJS_EventContext::OnField_Calculate ( CPDF_FormField * pSource,
CPDF_FormField * pTarget,
WideString * pValue,
bool * pRc )
overridevirtual

Implements IJS_EventContext.

Definition at line 255 of file cjs_event_context.cpp.

References kFieldCalculate.

◆ OnField_Focus()

void CJS_EventContext::OnField_Focus ( bool bModifier,
bool bShift,
CPDF_FormField * pTarget,
WideString * Value )
overridevirtual

Implements IJS_EventContext.

Definition at line 177 of file cjs_event_context.cpp.

References kFieldFocus.

◆ OnField_Format()

void CJS_EventContext::OnField_Format ( CPDF_FormField * pTarget,
WideString * Value )
overridevirtual

Implements IJS_EventContext.

Definition at line 269 of file cjs_event_context.cpp.

References kFieldFormat.

◆ OnField_Keystroke()

void CJS_EventContext::OnField_Keystroke ( WideString * strChange,
const WideString & strChangeEx,
bool bKeyDown,
bool bModifier,
int * nSelEnd,
int * nSelStart,
bool bShift,
CPDF_FormField * pTarget,
WideString * Value,
bool bWillCommit,
bool bFieldFull,
bool * bRc )
overridevirtual

Implements IJS_EventContext.

Definition at line 201 of file cjs_event_context.cpp.

References kFieldKeystroke.

◆ OnField_MouseDown()

void CJS_EventContext::OnField_MouseDown ( bool bModifier,
bool bShift,
CPDF_FormField * pTarget )
overridevirtual

Implements IJS_EventContext.

Definition at line 159 of file cjs_event_context.cpp.

References kFieldMouseDown.

◆ OnField_MouseEnter()

void CJS_EventContext::OnField_MouseEnter ( bool bModifier,
bool bShift,
CPDF_FormField * pTarget )
overridevirtual

Implements IJS_EventContext.

Definition at line 141 of file cjs_event_context.cpp.

References kFieldMouseEnter.

◆ OnField_MouseExit()

void CJS_EventContext::OnField_MouseExit ( bool bModifier,
bool bShift,
CPDF_FormField * pTarget )
overridevirtual

Implements IJS_EventContext.

Definition at line 150 of file cjs_event_context.cpp.

References kFieldMouseExit.

◆ OnField_MouseUp()

void CJS_EventContext::OnField_MouseUp ( bool bModifier,
bool bShift,
CPDF_FormField * pTarget )
overridevirtual

Implements IJS_EventContext.

Definition at line 168 of file cjs_event_context.cpp.

References kFieldMouseUp.

◆ OnField_Validate()

void CJS_EventContext::OnField_Validate ( WideString * strChange,
const WideString & strChangeEx,
bool bKeyDown,
bool bModifier,
bool bShift,
CPDF_FormField * pTarget,
WideString * Value,
bool * bRc )
overridevirtual

Implements IJS_EventContext.

Definition at line 234 of file cjs_event_context.cpp.

References kFieldValidate.

◆ OnPage_Close()

void CJS_EventContext::OnPage_Close ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 129 of file cjs_event_context.cpp.

References kPageClose.

◆ OnPage_InView()

void CJS_EventContext::OnPage_InView ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 133 of file cjs_event_context.cpp.

References kPageInView.

◆ OnPage_Open()

void CJS_EventContext::OnPage_Open ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 125 of file cjs_event_context.cpp.

References kPageOpen.

◆ OnPage_OutView()

void CJS_EventContext::OnPage_OutView ( )
overridevirtual

Implements IJS_EventContext.

Definition at line 137 of file cjs_event_context.cpp.

References kPageOutView.

◆ Rc()

bool & CJS_EventContext::Rc ( )

Definition at line 406 of file cjs_event_context.cpp.

Referenced by CJS_PublicMethods::AFDate_KeystrokeEx(), CJS_PublicMethods::AFNumber_Keystroke(), CJS_PublicMethods::AFRange_Validate(), and CJS_PublicMethods::AFSpecial_KeystrokeEx().

+ Here is the caller graph for this function:

◆ ResetWillCommitForTest()

void CJS_EventContext::ResetWillCommitForTest ( )
inline

Definition at line 144 of file cjs_event_context.h.

◆ RunScript()

absl::optional< IJS_Runtime::JS_Error > CJS_EventContext::RunScript ( const WideString & script)
overridevirtual

Implements IJS_EventContext.

Definition at line 25 of file cjs_event_context.cpp.

References IJS_Runtime::JS_Error::JS_Error(), JSGetStringFromID(), kBusyError, and kDuplicateEventError.

+ Here is the call graph for this function:

◆ SelEnd()

int CJS_EventContext::SelEnd ( ) const

Definition at line 410 of file cjs_event_context.cpp.

Referenced by CJS_PublicMethods::AFNumber_Keystroke().

+ Here is the caller graph for this function:

◆ SelStart()

int CJS_EventContext::SelStart ( ) const

Definition at line 414 of file cjs_event_context.cpp.

Referenced by CJS_PublicMethods::AFNumber_Keystroke().

+ Here is the caller graph for this function:

◆ SetRCForTest()

void CJS_EventContext::SetRCForTest ( bool * pRC)
inline

Definition at line 140 of file cjs_event_context.h.

◆ SetSelEnd()

void CJS_EventContext::SetSelEnd ( int value)

Definition at line 418 of file cjs_event_context.cpp.

◆ SetSelStart()

void CJS_EventContext::SetSelStart ( int value)

Definition at line 423 of file cjs_event_context.cpp.

◆ SetStrChangeForTest()

void CJS_EventContext::SetStrChangeForTest ( WideString * pStrChange)
inline

Definition at line 141 of file cjs_event_context.h.

◆ SetValueForTest()

void CJS_EventContext::SetValueForTest ( WideString * pStr)
inline

Definition at line 139 of file cjs_event_context.h.

Referenced by TEST_F().

+ Here is the caller graph for this function:

◆ Shift()

bool CJS_EventContext::Shift ( ) const
inline

Definition at line 134 of file cjs_event_context.h.

◆ SourceField()

CJS_Field * CJS_EventContext::SourceField ( )

Definition at line 56 of file cjs_event_context.cpp.

References GetFormFillEnv(), and SourceName().

+ Here is the call graph for this function:

◆ SourceName()

WideString CJS_EventContext::SourceName ( ) const
inline

Definition at line 121 of file cjs_event_context.h.

Referenced by SourceField().

+ Here is the caller graph for this function:

◆ TargetField()

CJS_Field * CJS_EventContext::TargetField ( )

Definition at line 78 of file cjs_event_context.cpp.

References GetFormFillEnv(), and TargetName().

+ Here is the call graph for this function:

◆ TargetName()

WideString CJS_EventContext::TargetName ( ) const
inline

Definition at line 122 of file cjs_event_context.h.

Referenced by TargetField().

+ Here is the caller graph for this function:

◆ Type()

◆ Value()

◆ WillCommit()

bool CJS_EventContext::WillCommit ( ) const
inline

Definition at line 137 of file cjs_event_context.h.

Referenced by CJS_PublicMethods::AFDate_KeystrokeEx(), CJS_PublicMethods::AFMergeChange(), CJS_PublicMethods::AFNumber_Keystroke(), and CJS_PublicMethods::AFSpecial_KeystrokeEx().

+ Here is the caller graph for this function:

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