blob: 291b6eb3cc619ea5be4d1e1d7a267a294accebbe [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// Copyright 2014 PDFium Authors. All rights reserved.
2// 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
Dan Sinclaire0345a42017-10-30 20:20:42 +000010#include "fxjs/JS_Define.h"
Tom Sepez9a3f8122015-04-07 15:35:48 -070011
Dan Sinclairf7435522018-02-05 22:27:22 +000012class CJS_Event : public CJS_Object {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070013 public:
Dan Sinclairf7435522018-02-05 22:27:22 +000014 static void DefineJSObjects(CFXJS_Engine* pEngine);
15
16 explicit CJS_Event(v8::Local<v8::Object> pObject);
17 ~CJS_Event() override;
18
19 JS_STATIC_PROP(change, change, CJS_Event);
20 JS_STATIC_PROP(changeEx, change_ex, CJS_Event);
21 JS_STATIC_PROP(commitKey, commit_key, CJS_Event);
22 JS_STATIC_PROP(fieldFull, field_full, CJS_Event);
23 JS_STATIC_PROP(keyDown, key_down, CJS_Event);
24 JS_STATIC_PROP(modifier, modifier, CJS_Event);
25 JS_STATIC_PROP(name, name, CJS_Event);
26 JS_STATIC_PROP(rc, rc, CJS_Event);
27 JS_STATIC_PROP(richChange, rich_change, CJS_Event);
28 JS_STATIC_PROP(richChangeEx, rich_change_ex, CJS_Event);
29 JS_STATIC_PROP(richValue, rich_value, CJS_Event);
30 JS_STATIC_PROP(selEnd, sel_end, CJS_Event);
31 JS_STATIC_PROP(selStart, sel_start, CJS_Event);
32 JS_STATIC_PROP(shift, shift, CJS_Event);
33 JS_STATIC_PROP(source, source, CJS_Event);
34 JS_STATIC_PROP(target, target, CJS_Event);
35 JS_STATIC_PROP(targetName, target_name, CJS_Event);
36 JS_STATIC_PROP(type, type, CJS_Event);
37 JS_STATIC_PROP(value, value, CJS_Event);
38 JS_STATIC_PROP(willCommit, will_commit, CJS_Event);
39
40 private:
41 static int ObjDefnID;
42 static const char kName[];
43 static const JSPropertySpec PropertySpecs[];
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070044
Dan Sinclair8f524d62017-10-25 13:30:31 -040045 CJS_Return get_change(CJS_Runtime* pRuntime);
46 CJS_Return set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040047
Dan Sinclair8f524d62017-10-25 13:30:31 -040048 CJS_Return get_change_ex(CJS_Runtime* pRuntime);
49 CJS_Return set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040050
Dan Sinclair8f524d62017-10-25 13:30:31 -040051 CJS_Return get_commit_key(CJS_Runtime* pRuntime);
52 CJS_Return set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040053
Dan Sinclair8f524d62017-10-25 13:30:31 -040054 CJS_Return get_field_full(CJS_Runtime* pRuntime);
55 CJS_Return set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040056
Dan Sinclair8f524d62017-10-25 13:30:31 -040057 CJS_Return get_key_down(CJS_Runtime* pRuntime);
58 CJS_Return set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040059
Dan Sinclair8f524d62017-10-25 13:30:31 -040060 CJS_Return get_modifier(CJS_Runtime* pRuntime);
61 CJS_Return set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040062
Dan Sinclair8f524d62017-10-25 13:30:31 -040063 CJS_Return get_name(CJS_Runtime* pRuntime);
64 CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040065
Dan Sinclair8f524d62017-10-25 13:30:31 -040066 CJS_Return get_rc(CJS_Runtime* pRuntime);
67 CJS_Return set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040068
Dan Sinclair8f524d62017-10-25 13:30:31 -040069 CJS_Return get_rich_change(CJS_Runtime* pRuntime);
70 CJS_Return set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040071
Dan Sinclair8f524d62017-10-25 13:30:31 -040072 CJS_Return get_rich_change_ex(CJS_Runtime* pRuntime);
73 CJS_Return set_rich_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040074
Dan Sinclair8f524d62017-10-25 13:30:31 -040075 CJS_Return get_rich_value(CJS_Runtime* pRuntime);
76 CJS_Return set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040077
Dan Sinclair8f524d62017-10-25 13:30:31 -040078 CJS_Return get_sel_end(CJS_Runtime* pRuntime);
79 CJS_Return set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040080
Dan Sinclair8f524d62017-10-25 13:30:31 -040081 CJS_Return get_sel_start(CJS_Runtime* pRuntime);
82 CJS_Return set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040083
Dan Sinclair8f524d62017-10-25 13:30:31 -040084 CJS_Return get_shift(CJS_Runtime* pRuntime);
85 CJS_Return set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040086
Dan Sinclair8f524d62017-10-25 13:30:31 -040087 CJS_Return get_source(CJS_Runtime* pRuntime);
88 CJS_Return set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040089
Dan Sinclair8f524d62017-10-25 13:30:31 -040090 CJS_Return get_target(CJS_Runtime* pRuntime);
91 CJS_Return set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040092
Dan Sinclair8f524d62017-10-25 13:30:31 -040093 CJS_Return get_target_name(CJS_Runtime* pRuntime);
94 CJS_Return set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040095
Dan Sinclair8f524d62017-10-25 13:30:31 -040096 CJS_Return get_type(CJS_Runtime* pRuntime);
97 CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040098
Dan Sinclair8f524d62017-10-25 13:30:31 -040099 CJS_Return get_value(CJS_Runtime* pRuntime);
100 CJS_Return set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -0400101
Dan Sinclair8f524d62017-10-25 13:30:31 -0400102 CJS_Return get_will_commit(CJS_Runtime* pRuntime);
103 CJS_Return set_will_commit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700104};
105
Dan Sinclaire0345a42017-10-30 20:20:42 +0000106#endif // FXJS_CJS_EVENT_H_