John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // 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 Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 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_H_ |
| 8 | #define FXJS_CJS_EVENT_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 10 | #include "fxjs/JS_Define.h" |
Tom Sepez | 9a3f812 | 2015-04-07 15:35:48 -0700 | [diff] [blame] | 11 | |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 12 | class CJS_Event : public CJS_Object { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 13 | public: |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 14 | 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 44 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 45 | CJS_Return get_change(CJS_Runtime* pRuntime); |
| 46 | CJS_Return set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 47 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 48 | CJS_Return get_change_ex(CJS_Runtime* pRuntime); |
| 49 | CJS_Return set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 50 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 51 | CJS_Return get_commit_key(CJS_Runtime* pRuntime); |
| 52 | CJS_Return set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 53 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 54 | CJS_Return get_field_full(CJS_Runtime* pRuntime); |
| 55 | CJS_Return set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 56 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 57 | CJS_Return get_key_down(CJS_Runtime* pRuntime); |
| 58 | CJS_Return set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 59 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 60 | CJS_Return get_modifier(CJS_Runtime* pRuntime); |
| 61 | CJS_Return set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 62 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 63 | CJS_Return get_name(CJS_Runtime* pRuntime); |
| 64 | CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 65 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 66 | CJS_Return get_rc(CJS_Runtime* pRuntime); |
| 67 | CJS_Return set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 68 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 69 | CJS_Return get_rich_change(CJS_Runtime* pRuntime); |
| 70 | CJS_Return set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 71 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 72 | 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 sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 74 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 75 | CJS_Return get_rich_value(CJS_Runtime* pRuntime); |
| 76 | CJS_Return set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 77 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 78 | CJS_Return get_sel_end(CJS_Runtime* pRuntime); |
| 79 | CJS_Return set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 80 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 81 | CJS_Return get_sel_start(CJS_Runtime* pRuntime); |
| 82 | CJS_Return set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 83 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 84 | CJS_Return get_shift(CJS_Runtime* pRuntime); |
| 85 | CJS_Return set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 86 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 87 | CJS_Return get_source(CJS_Runtime* pRuntime); |
| 88 | CJS_Return set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 89 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 90 | CJS_Return get_target(CJS_Runtime* pRuntime); |
| 91 | CJS_Return set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 92 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 93 | CJS_Return get_target_name(CJS_Runtime* pRuntime); |
| 94 | CJS_Return set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 95 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 96 | CJS_Return get_type(CJS_Runtime* pRuntime); |
| 97 | CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 98 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 99 | CJS_Return get_value(CJS_Runtime* pRuntime); |
| 100 | CJS_Return set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 101 | |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 102 | 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 104 | }; |
| 105 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 106 | #endif // FXJS_CJS_EVENT_H_ |