blob: f6494b22a6fe57cf5a264acc4b02d7221f47dcda [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2017 The PDFium Authors
Tom Sepez452b4f32015-10-13 09:27:27 -07002// 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 Sinclaire0345a42017-10-30 20:20:42 +00007#ifndef FXJS_CJS_EVENT_CONTEXT_STUB_H_
8#define FXJS_CJS_EVENT_CONTEXT_STUB_H_
Lei Zhangaa8bf7e2015-12-24 19:13:32 -08009
Dan Sinclaire0345a42017-10-30 20:20:42 +000010#include "fxjs/ijs_event_context.h"
Tom Sepez452b4f32015-10-13 09:27:27 -070011
Tom Sepezd6ae2af2017-02-16 11:49:55 -080012class CJS_EventContextStub final : public IJS_EventContext {
Tom Sepez452b4f32015-10-13 09:27:27 -070013 public:
Lei Zhang511d49d2021-04-01 05:13:22 +000014 CJS_EventContextStub();
15 ~CJS_EventContextStub() override;
Tom Sepez452b4f32015-10-13 09:27:27 -070016
Tom Sepezd6ae2af2017-02-16 11:49:55 -080017 // IJS_EventContext:
Lei Zhang24c6be62024-02-08 20:06:48 +000018 std::optional<IJS_Runtime::JS_Error> RunScript(
Lei Zhang2c495302021-10-07 23:13:30 +000019 const WideString& script) override;
Tom Sepez452b4f32015-10-13 09:27:27 -070020
Tom Sepezcc95e6c2021-06-04 16:28:37 +000021 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 {}
tsepez4cf55152016-11-02 14:37:54 -070031 void OnField_MouseDown(bool bModifier,
32 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070033 CPDF_FormField* pTarget) override {}
tsepez4cf55152016-11-02 14:37:54 -070034 void OnField_MouseEnter(bool bModifier,
35 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070036 CPDF_FormField* pTarget) override {}
tsepez4cf55152016-11-02 14:37:54 -070037 void OnField_MouseExit(bool bModifier,
38 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070039 CPDF_FormField* pTarget) override {}
tsepez4cf55152016-11-02 14:37:54 -070040 void OnField_MouseUp(bool bModifier,
41 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070042 CPDF_FormField* pTarget) override {}
tsepez4cf55152016-11-02 14:37:54 -070043 void OnField_Focus(bool bModifier,
44 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070045 CPDF_FormField* pTarget,
Tom Sepez3d813152018-06-21 17:28:24 +000046 WideString* Value) override {}
tsepez4cf55152016-11-02 14:37:54 -070047 void OnField_Blur(bool bModifier,
48 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070049 CPDF_FormField* pTarget,
Tom Sepez3d813152018-06-21 17:28:24 +000050 WideString* Value) override {}
Tom Sepez452b4f32015-10-13 09:27:27 -070051 void OnField_Calculate(CPDF_FormField* pSource,
52 CPDF_FormField* pTarget,
Tom Sepez3d813152018-06-21 17:28:24 +000053 WideString* pValue,
54 bool* pRc) override {}
Tom Sepez3ba597d2019-11-08 21:08:50 +000055 void OnField_Format(CPDF_FormField* pTarget, WideString* Value) override {}
Tom Sepez3d813152018-06-21 17:28:24 +000056 void OnField_Keystroke(WideString* strChange,
Ryan Harrison275e2602017-09-18 14:23:18 -040057 const WideString& strChangeEx,
tsepez4cf55152016-11-02 14:37:54 -070058 bool KeyDown,
59 bool bModifier,
Tom Sepez3d813152018-06-21 17:28:24 +000060 int* nSelEnd,
61 int* nSelStart,
tsepez4cf55152016-11-02 14:37:54 -070062 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070063 CPDF_FormField* pTarget,
Tom Sepez3d813152018-06-21 17:28:24 +000064 WideString* Value,
tsepez4cf55152016-11-02 14:37:54 -070065 bool bWillCommit,
66 bool bFieldFull,
Tom Sepez3d813152018-06-21 17:28:24 +000067 bool* bRc) override {}
68 void OnField_Validate(WideString* strChange,
Ryan Harrison275e2602017-09-18 14:23:18 -040069 const WideString& strChangeEx,
tsepez4cf55152016-11-02 14:37:54 -070070 bool bKeyDown,
71 bool bModifier,
72 bool bShift,
Tom Sepez452b4f32015-10-13 09:27:27 -070073 CPDF_FormField* pTarget,
Tom Sepez3d813152018-06-21 17:28:24 +000074 WideString* Value,
75 bool* bRc) override {}
Tom Sepez452b4f32015-10-13 09:27:27 -070076 void OnExternal_Exec() override {}
Tom Sepez452b4f32015-10-13 09:27:27 -070077};
78
Dan Sinclaire0345a42017-10-30 20:20:42 +000079#endif // FXJS_CJS_EVENT_CONTEXT_STUB_H_