OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef _IJAVASCRIPT_H_ | 7 #ifndef _IJAVASCRIPT_H_ |
8 #define _IJAVASCRIPT_H_ | 8 #define _IJAVASCRIPT_H_ |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 class Platform; | 11 class Platform; |
12 } | 12 } |
13 | 13 |
14 class IFXJS_Context | 14 class IFXJS_Context |
15 { | 15 { |
16 public: | 16 public: |
| 17 virtual ~IFXJS_Context() { } |
17 virtual FX_BOOL Compile(const CFX_WideString& sc
ript, CFX_WideString& info) = 0; | 18 virtual FX_BOOL Compile(const CFX_WideString& sc
ript, CFX_WideString& info) = 0; |
18 virtual FX_BOOL RunScript(const CFX_WideString&
script, CFX_WideString& info) = 0; | 19 virtual FX_BOOL RunScript(const CFX_WideString&
script, CFX_WideString& info) = 0; |
19 | 20 |
20 public: | |
21 virtual void OnApp_Init() = 0; | 21 virtual void OnApp_Init() = 0; |
22 | 22 |
23 virtual void OnDoc_Open(CPDFSDK_Document* pDo
c, const CFX_WideString& strTargetName) = 0; | 23 virtual void OnDoc_Open(CPDFSDK_Document* pDo
c, const CFX_WideString& strTargetName) = 0; |
24 virtual void OnDoc_WillPrint(CPDFSDK_Document
* pDoc) = 0; | 24 virtual void OnDoc_WillPrint(CPDFSDK_Document
* pDoc) = 0; |
25 virtual void OnDoc_DidPrint(CPDFSDK_Document*
pDoc) = 0; | 25 virtual void OnDoc_DidPrint(CPDFSDK_Document*
pDoc) = 0; |
26 virtual void OnDoc_WillSave(CPDFSDK_Document*
pDoc) = 0; | 26 virtual void OnDoc_WillSave(CPDFSDK_Document*
pDoc) = 0; |
27 virtual void OnDoc_DidSave(CPDFSDK_Document*
pDoc) = 0; | 27 virtual void OnDoc_DidSave(CPDFSDK_Document*
pDoc) = 0; |
28 virtual void OnDoc_WillClose(CPDFSDK_Document
* pDoc) = 0; | 28 virtual void OnDoc_WillClose(CPDFSDK_Document
* pDoc) = 0; |
29 | 29 |
30 virtual void OnPage_Open(CPDFSDK_Document* pT
arget) = 0; | 30 virtual void OnPage_Open(CPDFSDK_Document* pT
arget) = 0; |
31 virtual void OnPage_Close(CPDFSDK_Document* p
Target) = 0; | 31 virtual void OnPage_Close(CPDFSDK_Document* p
Target) = 0; |
32 virtual void OnPage_InView(CPDFSDK_Document*
pTarget) = 0; | 32 virtual void OnPage_InView(CPDFSDK_Document*
pTarget) = 0; |
33 virtual void OnPage_OutView(CPDFSDK_Document*
pTarget) = 0; | 33 virtual void OnPage_OutView(CPDFSDK_Document*
pTarget) = 0; |
34 » | 34 |
35 virtual void OnField_MouseDown(FX_BOOL bModif
ier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; | 35 virtual void OnField_MouseDown(FX_BOOL bModif
ier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; |
36 virtual void OnField_MouseEnter(FX_BOOL bModi
fier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; | 36 virtual void OnField_MouseEnter(FX_BOOL bModi
fier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; |
37 virtual void OnField_MouseExit(FX_BOOL bModif
ier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; | 37 virtual void OnField_MouseExit(FX_BOOL bModif
ier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; |
38 virtual void OnField_MouseUp(FX_BOOL bModifie
r, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; | 38 virtual void OnField_MouseUp(FX_BOOL bModifie
r, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; |
39 virtual void OnField_Focus(FX_BOOL bModifier,
FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; | 39 virtual void OnField_Focus(FX_BOOL bModifier,
FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; |
40 virtual void OnField_Blur(FX_BOOL bModifier,
FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; | 40 virtual void OnField_Blur(FX_BOOL bModifier,
FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; |
41 | 41 |
42 virtual void OnField_Calculate(CPDF_FormField
* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0; | 42 virtual void OnField_Calculate(CPDF_FormField
* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0; |
43 virtual void OnField_Format(int nCommitKey, C
PDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0; | 43 virtual void OnField_Format(int nCommitKey, C
PDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0; |
44 virtual void OnField_Keystroke(int nCommitKey
, CFX_WideString& strChange, const CFX_WideString& strChangeEx, | 44 virtual void OnField_Keystroke(int nCommitKey
, CFX_WideString& strChange, const CFX_WideString& strChangeEx, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 virtual void GetObjectNames(CFX_WideStringArr
ay& array) = 0; | 83 virtual void GetObjectNames(CFX_WideStringArr
ay& array) = 0; |
84 virtual void GetObjectConsts(const CFX_WideSt
ring& swObjName, CFX_WideStringArray& array) = 0; | 84 virtual void GetObjectConsts(const CFX_WideSt
ring& swObjName, CFX_WideStringArray& array) = 0; |
85 virtual void GetObjectProps(const CFX_WideStr
ing& swObjName, CFX_WideStringArray& array) = 0; | 85 virtual void GetObjectProps(const CFX_WideStr
ing& swObjName, CFX_WideStringArray& array) = 0; |
86 virtual void GetObjectMethods(const CFX_WideS
tring& swObjName, CFX_WideStringArray& array) = 0; | 86 virtual void GetObjectMethods(const CFX_WideS
tring& swObjName, CFX_WideStringArray& array) = 0; |
87 | 87 |
88 virtual void Exit() = 0; | 88 virtual void Exit() = 0; |
89 virtual void Enter() = 0; | 89 virtual void Enter() = 0; |
90 virtual FX_BOOL IsEntered() = 0; | 90 virtual FX_BOOL IsEntered() = 0; |
91 virtual FX_BOOL GetHValueByName(FX_BSTR utf8Name
, FXJSE_HVALUE hValue) = 0; | 91 virtual FX_BOOL GetHValueByName(FX_BSTR utf8Name
, FXJSE_HVALUE hValue) = 0; |
92 virtual FX_BOOL SetHValueByName(FX_BSTR utf8Name
, FXJSE_HVALUE hValue) = 0; | 92 virtual FX_BOOL SetHValueByName(FX_BSTR utf8Name
, FXJSE_HVALUE hValue) = 0; |
| 93 |
| 94 protected: |
| 95 ~IFXJS_Runtime() { } |
93 }; | 96 }; |
94 | 97 |
95 class CPDFDoc_Environment; | 98 class CPDFDoc_Environment; |
96 class CJS_GlobalData; | 99 class CJS_GlobalData; |
97 | 100 |
98 class CJS_RuntimeFactory | 101 class CJS_RuntimeFactory |
99 { | 102 { |
100 public: | 103 public: |
101 CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlo
balDataCount(0),m_platform(NULL) {} | 104 CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlo
balDataCount(0),m_platform(NULL) {} |
102 ~CJS_RuntimeFactory(); | 105 ~CJS_RuntimeFactory(); |
103 IFXJS_Runtime* NewJSRuntime(CPDFDoc_Env
ironment* pApp); | 106 IFXJS_Runtime* NewJSRuntime(CPDFDoc_Env
ironment* pApp); |
104 void DeleteJSRuntime(
IFXJS_Runtime* pRuntime); | 107 void DeleteJSRuntime(
IFXJS_Runtime* pRuntime); |
105 void AddRef(); | 108 void AddRef(); |
106 void Release(); | 109 void Release(); |
107 | 110 |
108 CJS_GlobalData* NewGlobalData(CPDFDoc_En
vironment* pApp); | 111 CJS_GlobalData* NewGlobalData(CPDFDoc_En
vironment* pApp); |
109 void ReleaseGlobalDat
a(); | 112 void ReleaseGlobalDat
a(); |
110 private: | 113 private: |
111 FX_BOOL m_bInit; | 114 FX_BOOL m_bInit; |
112 int m_nRef; | 115 int m_nRef; |
113 CJS_GlobalData* m_pGlobalData; | 116 CJS_GlobalData* m_pGlobalData; |
114 FX_INT32 m_nGlobalDataCou
nt; | 117 FX_INT32 m_nGlobalDataCou
nt; |
115 v8::Platform* m_platform; | 118 v8::Platform* m_platform; |
116 }; | 119 }; |
117 | 120 |
118 #endif //_IJAVASCRIPT_H_ | 121 #endif //_IJAVASCRIPT_H_ |
119 | 122 |
OLD | NEW |