blob: fc9bec2df42ed013d22282a975179c42368098aa [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2014 The PDFium Authors
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclaire0345a42017-10-30 20:20:42 +00007#ifndef FXJS_CJS_EVENT_H_
8#define FXJS_CJS_EVENT_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
Lei Zhang31beedc2018-10-18 21:09:55 +000010#include "fxjs/cjs_object.h"
Tom Sepez221f0b32018-06-04 22:11:27 +000011#include "fxjs/js_define.h"
Tom Sepez9a3f8122015-04-07 15:35:48 -070012
Tom Sepez55865452018-08-27 20:18:04 +000013class CJS_Event final : public CJS_Object {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070014 public:
Tom Sepezb4958712020-10-13 20:30:43 +000015 static uint32_t GetObjDefnID();
Dan Sinclairf7435522018-02-05 22:27:22 +000016 static void DefineJSObjects(CFXJS_Engine* pEngine);
17
Tom Sepez36aae4f2018-06-04 19:44:37 +000018 CJS_Event(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
Dan Sinclairf7435522018-02-05 22:27:22 +000019 ~CJS_Event() override;
20
Nico Weber563f62a2019-02-12 18:47:12 +000021 JS_STATIC_PROP(change, change, CJS_Event)
22 JS_STATIC_PROP(changeEx, change_ex, CJS_Event)
23 JS_STATIC_PROP(commitKey, commit_key, CJS_Event)
24 JS_STATIC_PROP(fieldFull, field_full, CJS_Event)
25 JS_STATIC_PROP(keyDown, key_down, CJS_Event)
26 JS_STATIC_PROP(modifier, modifier, CJS_Event)
27 JS_STATIC_PROP(name, name, CJS_Event)
28 JS_STATIC_PROP(rc, rc, CJS_Event)
29 JS_STATIC_PROP(richChange, rich_change, CJS_Event)
30 JS_STATIC_PROP(richChangeEx, rich_change_ex, CJS_Event)
31 JS_STATIC_PROP(richValue, rich_value, CJS_Event)
32 JS_STATIC_PROP(selEnd, sel_end, CJS_Event)
33 JS_STATIC_PROP(selStart, sel_start, CJS_Event)
34 JS_STATIC_PROP(shift, shift, CJS_Event)
35 JS_STATIC_PROP(source, source, CJS_Event)
36 JS_STATIC_PROP(target, target, CJS_Event)
37 JS_STATIC_PROP(targetName, target_name, CJS_Event)
38 JS_STATIC_PROP(type, type, CJS_Event)
39 JS_STATIC_PROP(value, value, CJS_Event)
40 JS_STATIC_PROP(willCommit, will_commit, CJS_Event)
Dan Sinclairf7435522018-02-05 22:27:22 +000041
42 private:
Tom Sepezb4958712020-10-13 20:30:43 +000043 static uint32_t ObjDefnID;
Dan Sinclairf7435522018-02-05 22:27:22 +000044 static const char kName[];
45 static const JSPropertySpec PropertySpecs[];
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070046
Tom Sepez3a6d0582018-08-17 19:28:52 +000047 CJS_Result get_change(CJS_Runtime* pRuntime);
48 CJS_Result set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040049
Tom Sepez3a6d0582018-08-17 19:28:52 +000050 CJS_Result get_change_ex(CJS_Runtime* pRuntime);
51 CJS_Result set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040052
Tom Sepez3a6d0582018-08-17 19:28:52 +000053 CJS_Result get_commit_key(CJS_Runtime* pRuntime);
54 CJS_Result set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040055
Tom Sepez3a6d0582018-08-17 19:28:52 +000056 CJS_Result get_field_full(CJS_Runtime* pRuntime);
57 CJS_Result set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040058
Tom Sepez3a6d0582018-08-17 19:28:52 +000059 CJS_Result get_key_down(CJS_Runtime* pRuntime);
60 CJS_Result set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040061
Tom Sepez3a6d0582018-08-17 19:28:52 +000062 CJS_Result get_modifier(CJS_Runtime* pRuntime);
63 CJS_Result set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040064
Tom Sepez3a6d0582018-08-17 19:28:52 +000065 CJS_Result get_name(CJS_Runtime* pRuntime);
66 CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040067
Tom Sepez3a6d0582018-08-17 19:28:52 +000068 CJS_Result get_rc(CJS_Runtime* pRuntime);
69 CJS_Result set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040070
Tom Sepez3a6d0582018-08-17 19:28:52 +000071 CJS_Result get_rich_change(CJS_Runtime* pRuntime);
72 CJS_Result set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040073
Tom Sepez3a6d0582018-08-17 19:28:52 +000074 CJS_Result get_rich_change_ex(CJS_Runtime* pRuntime);
75 CJS_Result set_rich_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040076
Tom Sepez3a6d0582018-08-17 19:28:52 +000077 CJS_Result get_rich_value(CJS_Runtime* pRuntime);
78 CJS_Result set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040079
Tom Sepez3a6d0582018-08-17 19:28:52 +000080 CJS_Result get_sel_end(CJS_Runtime* pRuntime);
81 CJS_Result set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040082
Tom Sepez3a6d0582018-08-17 19:28:52 +000083 CJS_Result get_sel_start(CJS_Runtime* pRuntime);
84 CJS_Result set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040085
Tom Sepez3a6d0582018-08-17 19:28:52 +000086 CJS_Result get_shift(CJS_Runtime* pRuntime);
87 CJS_Result set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040088
Tom Sepez3a6d0582018-08-17 19:28:52 +000089 CJS_Result get_source(CJS_Runtime* pRuntime);
90 CJS_Result set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040091
Tom Sepez3a6d0582018-08-17 19:28:52 +000092 CJS_Result get_target(CJS_Runtime* pRuntime);
93 CJS_Result set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040094
Tom Sepez3a6d0582018-08-17 19:28:52 +000095 CJS_Result get_target_name(CJS_Runtime* pRuntime);
96 CJS_Result set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040097
Tom Sepez3a6d0582018-08-17 19:28:52 +000098 CJS_Result get_type(CJS_Runtime* pRuntime);
99 CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -0400100
Tom Sepez3a6d0582018-08-17 19:28:52 +0000101 CJS_Result get_value(CJS_Runtime* pRuntime);
102 CJS_Result set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -0400103
Tom Sepez3a6d0582018-08-17 19:28:52 +0000104 CJS_Result get_will_commit(CJS_Runtime* pRuntime);
105 CJS_Result set_will_commit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700106};
107
Dan Sinclaire0345a42017-10-30 20:20:42 +0000108#endif // FXJS_CJS_EVENT_H_