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 FPDFSDK_JAVASCRIPT_JS_EVENTHANDLER_H_ | 7 #ifndef FPDFSDK_JAVASCRIPT_JS_EVENTHANDLER_H_ |
8 #define FPDFSDK_JAVASCRIPT_JS_EVENTHANDLER_H_ | 8 #define FPDFSDK_JAVASCRIPT_JS_EVENTHANDLER_H_ |
9 | 9 |
10 #include "core/fxcrt/fx_string.h" | 10 #include "core/fxcrt/fx_string.h" |
11 #include "core/fxcrt/fx_system.h" | 11 #include "core/fxcrt/fx_system.h" |
12 | 12 |
13 class CJS_Context; | 13 class CJS_Context; |
14 class CPDFSDK_Annot; | 14 class CPDFSDK_Annot; |
15 class CPDFSDK_Document; | 15 class CPDFSDK_FormFillEnvironment; |
16 class CPDF_Bookmark; | 16 class CPDF_Bookmark; |
17 class CPDF_FormField; | 17 class CPDF_FormField; |
18 class Field; | 18 class Field; |
19 | 19 |
20 enum JS_EVENT_T { | 20 enum JS_EVENT_T { |
21 JET_UNKNOWN, | 21 JET_UNKNOWN, |
22 JET_APP_INIT, | 22 JET_APP_INIT, |
23 JET_DOC_OPEN, | 23 JET_DOC_OPEN, |
24 JET_DOC_WILLPRINT, | 24 JET_DOC_WILLPRINT, |
25 JET_DOC_DIDPRINT, | 25 JET_DOC_DIDPRINT, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 JET_LINK_MOUSEUP | 58 JET_LINK_MOUSEUP |
59 }; | 59 }; |
60 | 60 |
61 class CJS_EventHandler { | 61 class CJS_EventHandler { |
62 public: | 62 public: |
63 CJS_EventHandler(CJS_Context* pContext); | 63 CJS_EventHandler(CJS_Context* pContext); |
64 virtual ~CJS_EventHandler(); | 64 virtual ~CJS_EventHandler(); |
65 | 65 |
66 void OnApp_Init(); | 66 void OnApp_Init(); |
67 | 67 |
68 void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName); | 68 void OnDoc_Open(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
69 void OnDoc_WillPrint(CPDFSDK_Document* pDoc); | 69 const CFX_WideString& strTargetName); |
70 void OnDoc_DidPrint(CPDFSDK_Document* pDoc); | 70 void OnDoc_WillPrint(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
71 void OnDoc_WillSave(CPDFSDK_Document* pDoc); | 71 void OnDoc_DidPrint(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
72 void OnDoc_DidSave(CPDFSDK_Document* pDoc); | 72 void OnDoc_WillSave(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
73 void OnDoc_WillClose(CPDFSDK_Document* pDoc); | 73 void OnDoc_DidSave(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
| 74 void OnDoc_WillClose(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
74 | 75 |
75 void OnPage_Open(CPDFSDK_Document* pDoc); | 76 void OnPage_Open(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
76 void OnPage_Close(CPDFSDK_Document* pDoc); | 77 void OnPage_Close(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
77 void OnPage_InView(CPDFSDK_Document* pTarget); | 78 void OnPage_InView(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
78 void OnPage_OutView(CPDFSDK_Document* pTarget); | 79 void OnPage_OutView(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
79 | 80 |
80 void OnField_Calculate(CPDF_FormField* pSource, | 81 void OnField_Calculate(CPDF_FormField* pSource, |
81 CPDF_FormField* pTarget, | 82 CPDF_FormField* pTarget, |
82 CFX_WideString& Value, | 83 CFX_WideString& Value, |
83 FX_BOOL& bRc); | 84 FX_BOOL& bRc); |
84 void OnField_Format(CPDF_FormField* pTarget, | 85 void OnField_Format(CPDF_FormField* pTarget, |
85 CFX_WideString& Value, | 86 CFX_WideString& Value, |
86 FX_BOOL bWillCommit); | 87 FX_BOOL bWillCommit); |
87 void OnField_Keystroke(CFX_WideString& strChange, | 88 void OnField_Keystroke(CFX_WideString& strChange, |
88 const CFX_WideString& strChangeEx, | 89 const CFX_WideString& strChangeEx, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 FX_BOOL bShift, | 148 FX_BOOL bShift, |
148 CPDFSDK_Annot* pScreen); | 149 CPDFSDK_Annot* pScreen); |
149 void OnScreen_InView(FX_BOOL bModifier, | 150 void OnScreen_InView(FX_BOOL bModifier, |
150 FX_BOOL bShift, | 151 FX_BOOL bShift, |
151 CPDFSDK_Annot* pScreen); | 152 CPDFSDK_Annot* pScreen); |
152 void OnScreen_OutView(FX_BOOL bModifier, | 153 void OnScreen_OutView(FX_BOOL bModifier, |
153 FX_BOOL bShift, | 154 FX_BOOL bShift, |
154 CPDFSDK_Annot* pScreen); | 155 CPDFSDK_Annot* pScreen); |
155 | 156 |
156 void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark); | 157 void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark); |
157 void OnLink_MouseUp(CPDFSDK_Document* pTarget); | 158 void OnLink_MouseUp(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
158 | 159 |
159 void OnMenu_Exec(CPDFSDK_Document* pTarget, | 160 void OnMenu_Exec(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
160 const CFX_WideString& strTargetName); | 161 const CFX_WideString& strTargetName); |
161 void OnBatchExec(CPDFSDK_Document* pTarget); | 162 void OnBatchExec(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
162 void OnConsole_Exec(); | 163 void OnConsole_Exec(); |
163 void OnExternal_Exec(); | 164 void OnExternal_Exec(); |
164 | 165 |
165 public: | 166 public: |
166 void Initial(JS_EVENT_T type); | 167 void Initial(JS_EVENT_T type); |
167 void Destroy(); | 168 void Destroy(); |
168 FX_BOOL IsValid(); | 169 FX_BOOL IsValid(); |
169 | 170 |
170 CFX_WideString& Change(); | 171 CFX_WideString& Change(); |
171 CFX_WideString ChangeEx(); | 172 CFX_WideString ChangeEx(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 int* m_pISelEnd; | 205 int* m_pISelEnd; |
205 int m_nSelEndDu; | 206 int m_nSelEndDu; |
206 int* m_pISelStart; | 207 int* m_pISelStart; |
207 int m_nSelStartDu; | 208 int m_nSelStartDu; |
208 FX_BOOL m_bWillCommit; | 209 FX_BOOL m_bWillCommit; |
209 CFX_WideString* m_pValue; | 210 CFX_WideString* m_pValue; |
210 FX_BOOL m_bFieldFull; | 211 FX_BOOL m_bFieldFull; |
211 FX_BOOL* m_pbRc; | 212 FX_BOOL* m_pbRc; |
212 FX_BOOL m_bRcDu; | 213 FX_BOOL m_bRcDu; |
213 | 214 |
214 CPDFSDK_Document* m_pSourceDoc; | |
215 CPDF_Bookmark* m_pTargetBookMark; | 215 CPDF_Bookmark* m_pTargetBookMark; |
216 CPDFSDK_Document* m_pTargetDoc; | 216 CPDFSDK_FormFillEnvironment* m_pTargetFormFillEnv; |
217 CPDFSDK_Annot* m_pTargetAnnot; | 217 CPDFSDK_Annot* m_pTargetAnnot; |
218 }; | 218 }; |
219 | 219 |
220 #endif // FPDFSDK_JAVASCRIPT_JS_EVENTHANDLER_H_ | 220 #endif // FPDFSDK_JAVASCRIPT_JS_EVENTHANDLER_H_ |
OLD | NEW |