blob: 4ae5fa234fa82036a7b8ecc450790f515040796b [file] [log] [blame]
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -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.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef FXJS_CJS_EVENT_H_
8#define FXJS_CJS_EVENT_H_
9
10#include "fxjs/JS_Define.h"
11
12class event : public CJS_EmbedObj {
13 public:
14 explicit event(CJS_Object* pJSObject);
15 ~event() override;
16
17 CJS_Return get_change(CJS_Runtime* pRuntime);
18 CJS_Return set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
19
20 CJS_Return get_change_ex(CJS_Runtime* pRuntime);
21 CJS_Return set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
22
23 CJS_Return get_commit_key(CJS_Runtime* pRuntime);
24 CJS_Return set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
25
26 CJS_Return get_field_full(CJS_Runtime* pRuntime);
27 CJS_Return set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
28
29 CJS_Return get_key_down(CJS_Runtime* pRuntime);
30 CJS_Return set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
31
32 CJS_Return get_modifier(CJS_Runtime* pRuntime);
33 CJS_Return set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
34
35 CJS_Return get_name(CJS_Runtime* pRuntime);
36 CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
37
38 CJS_Return get_rc(CJS_Runtime* pRuntime);
39 CJS_Return set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
40
41 CJS_Return get_rich_change(CJS_Runtime* pRuntime);
42 CJS_Return set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
43
44 CJS_Return get_rich_change_ex(CJS_Runtime* pRuntime);
45 CJS_Return set_rich_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
46
47 CJS_Return get_rich_value(CJS_Runtime* pRuntime);
48 CJS_Return set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
49
50 CJS_Return get_sel_end(CJS_Runtime* pRuntime);
51 CJS_Return set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
52
53 CJS_Return get_sel_start(CJS_Runtime* pRuntime);
54 CJS_Return set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
55
56 CJS_Return get_shift(CJS_Runtime* pRuntime);
57 CJS_Return set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
58
59 CJS_Return get_source(CJS_Runtime* pRuntime);
60 CJS_Return set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
61
62 CJS_Return get_target(CJS_Runtime* pRuntime);
63 CJS_Return set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
64
65 CJS_Return get_target_name(CJS_Runtime* pRuntime);
66 CJS_Return set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
67
68 CJS_Return get_type(CJS_Runtime* pRuntime);
69 CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
70
71 CJS_Return get_value(CJS_Runtime* pRuntime);
72 CJS_Return set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
73
74 CJS_Return get_will_commit(CJS_Runtime* pRuntime);
75 CJS_Return set_will_commit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
76};
77
78class CJS_Event : public CJS_Object {
79 public:
80 static void DefineJSObjects(CFXJS_Engine* pEngine);
81
82 explicit CJS_Event(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
83 ~CJS_Event() override {}
84
85 JS_STATIC_PROP(change, change, event);
86 JS_STATIC_PROP(changeEx, change_ex, event);
87 JS_STATIC_PROP(commitKey, commit_key, event);
88 JS_STATIC_PROP(fieldFull, field_full, event);
89 JS_STATIC_PROP(keyDown, key_down, event);
90 JS_STATIC_PROP(modifier, modifier, event);
91 JS_STATIC_PROP(name, name, event);
92 JS_STATIC_PROP(rc, rc, event);
93 JS_STATIC_PROP(richChange, rich_change, event);
94 JS_STATIC_PROP(richChangeEx, rich_change_ex, event);
95 JS_STATIC_PROP(richValue, rich_value, event);
96 JS_STATIC_PROP(selEnd, sel_end, event);
97 JS_STATIC_PROP(selStart, sel_start, event);
98 JS_STATIC_PROP(shift, shift, event);
99 JS_STATIC_PROP(source, source, event);
100 JS_STATIC_PROP(target, target, event);
101 JS_STATIC_PROP(targetName, target_name, event);
102 JS_STATIC_PROP(type, type, event);
103 JS_STATIC_PROP(value, value, event);
104 JS_STATIC_PROP(willCommit, will_commit, event);
105
106 private:
107 static int ObjDefnID;
108 static const JSPropertySpec PropertySpecs[];
109};
110
111#endif // FXJS_CJS_EVENT_H_