K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2017 The PDFium Authors |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 7 | #ifndef FXJS_CJS_EVENT_CONTEXT_STUB_H_ |
| 8 | #define FXJS_CJS_EVENT_CONTEXT_STUB_H_ |
Lei Zhang | aa8bf7e | 2015-12-24 19:13:32 -0800 | [diff] [blame] | 9 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 10 | #include "fxjs/ijs_event_context.h" |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 11 | |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame] | 12 | class CJS_EventContextStub final : public IJS_EventContext { |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 13 | public: |
Lei Zhang | 511d49d | 2021-04-01 05:13:22 +0000 | [diff] [blame] | 14 | CJS_EventContextStub(); |
| 15 | ~CJS_EventContextStub() override; |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 16 | |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame] | 17 | // IJS_EventContext: |
Lei Zhang | 24c6be6 | 2024-02-08 20:06:48 +0000 | [diff] [blame] | 18 | std::optional<IJS_Runtime::JS_Error> RunScript( |
Lei Zhang | 2c49530 | 2021-10-07 23:13:30 +0000 | [diff] [blame] | 19 | const WideString& script) override; |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 20 | |
Tom Sepez | cc95e6c | 2021-06-04 16:28:37 +0000 | [diff] [blame] | 21 | void OnDoc_Open(const WideString& strTargetName) override {} |
| 22 | void OnDoc_WillPrint() override {} |
| 23 | void OnDoc_DidPrint() override {} |
| 24 | void OnDoc_WillSave() override {} |
| 25 | void OnDoc_DidSave() override {} |
| 26 | void OnDoc_WillClose() override {} |
| 27 | void OnPage_Open() override {} |
| 28 | void OnPage_Close() override {} |
| 29 | void OnPage_InView() override {} |
| 30 | void OnPage_OutView() override {} |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 31 | void OnField_MouseDown(bool bModifier, |
| 32 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 33 | CPDF_FormField* pTarget) override {} |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 34 | void OnField_MouseEnter(bool bModifier, |
| 35 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 36 | CPDF_FormField* pTarget) override {} |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 37 | void OnField_MouseExit(bool bModifier, |
| 38 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 39 | CPDF_FormField* pTarget) override {} |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 40 | void OnField_MouseUp(bool bModifier, |
| 41 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 42 | CPDF_FormField* pTarget) override {} |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 43 | void OnField_Focus(bool bModifier, |
| 44 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 45 | CPDF_FormField* pTarget, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 46 | WideString* Value) override {} |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 47 | void OnField_Blur(bool bModifier, |
| 48 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 49 | CPDF_FormField* pTarget, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 50 | WideString* Value) override {} |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 51 | void OnField_Calculate(CPDF_FormField* pSource, |
| 52 | CPDF_FormField* pTarget, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 53 | WideString* pValue, |
| 54 | bool* pRc) override {} |
Tom Sepez | 3ba597d | 2019-11-08 21:08:50 +0000 | [diff] [blame] | 55 | void OnField_Format(CPDF_FormField* pTarget, WideString* Value) override {} |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 56 | void OnField_Keystroke(WideString* strChange, |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 57 | const WideString& strChangeEx, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 58 | bool KeyDown, |
| 59 | bool bModifier, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 60 | int* nSelEnd, |
| 61 | int* nSelStart, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 62 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 63 | CPDF_FormField* pTarget, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 64 | WideString* Value, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 65 | bool bWillCommit, |
| 66 | bool bFieldFull, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 67 | bool* bRc) override {} |
| 68 | void OnField_Validate(WideString* strChange, |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 69 | const WideString& strChangeEx, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 70 | bool bKeyDown, |
| 71 | bool bModifier, |
| 72 | bool bShift, |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 73 | CPDF_FormField* pTarget, |
Tom Sepez | 3d81315 | 2018-06-21 17:28:24 +0000 | [diff] [blame] | 74 | WideString* Value, |
| 75 | bool* bRc) override {} |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 76 | void OnExternal_Exec() override {} |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 77 | }; |
| 78 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 79 | #endif // FXJS_CJS_EVENT_CONTEXT_STUB_H_ |