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. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef FPDFSDK_JAVASCRIPT_EVENT_H_ 8 #define FPDFSDK_JAVASCRIPT_EVENT_H_ 9 10 #include "fpdfsdk/javascript/JS_Define.h" 11 12 class event : public CJS_EmbedObj { 13 public: 14 explicit event(CJS_Object* pJSObject); 15 ~event() override; 16 17 public: 18 bool change(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 19 bool changeEx(CJS_Runtime* pRuntime, 20 CJS_PropValue& vp, 21 CFX_WideString& sError); 22 bool commitKey(CJS_Runtime* pRuntime, 23 CJS_PropValue& vp, 24 CFX_WideString& sError); 25 bool fieldFull(CJS_Runtime* pRuntime, 26 CJS_PropValue& vp, 27 CFX_WideString& sError); 28 bool keyDown(CJS_Runtime* pRuntime, 29 CJS_PropValue& vp, 30 CFX_WideString& sError); 31 bool modifier(CJS_Runtime* pRuntime, 32 CJS_PropValue& vp, 33 CFX_WideString& sError); 34 bool name(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 35 bool rc(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 36 bool richChange(CJS_Runtime* pRuntime, 37 CJS_PropValue& vp, 38 CFX_WideString& sError); 39 bool richChangeEx(CJS_Runtime* pRuntime, 40 CJS_PropValue& vp, 41 CFX_WideString& sError); 42 bool richValue(CJS_Runtime* pRuntime, 43 CJS_PropValue& vp, 44 CFX_WideString& sError); 45 bool selEnd(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 46 bool selStart(CJS_Runtime* pRuntime, 47 CJS_PropValue& vp, 48 CFX_WideString& sError); 49 bool shift(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 50 bool source(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 51 bool target(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 52 bool targetName(CJS_Runtime* pRuntime, 53 CJS_PropValue& vp, 54 CFX_WideString& sError); 55 bool type(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 56 bool value(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); 57 bool willCommit(CJS_Runtime* pRuntime, 58 CJS_PropValue& vp, 59 CFX_WideString& sError); 60 }; 61 62 class CJS_Event : public CJS_Object { 63 public: CJS_Event(v8::Local<v8::Object> pObject)64 explicit CJS_Event(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} ~CJS_Event()65 ~CJS_Event() override {} 66 67 DECLARE_JS_CLASS(); 68 JS_STATIC_PROP(change, event); 69 JS_STATIC_PROP(changeEx, event); 70 JS_STATIC_PROP(commitKey, event); 71 JS_STATIC_PROP(fieldFull, event); 72 JS_STATIC_PROP(keyDown, event); 73 JS_STATIC_PROP(modifier, event); 74 JS_STATIC_PROP(name, event); 75 JS_STATIC_PROP(rc, event); 76 JS_STATIC_PROP(richChange, event); 77 JS_STATIC_PROP(richChangeEx, event); 78 JS_STATIC_PROP(richValue, event); 79 JS_STATIC_PROP(selEnd, event); 80 JS_STATIC_PROP(selStart, event); 81 JS_STATIC_PROP(shift, event); 82 JS_STATIC_PROP(source, event); 83 JS_STATIC_PROP(target, event); 84 JS_STATIC_PROP(targetName, event); 85 JS_STATIC_PROP(type, event); 86 JS_STATIC_PROP(value, event); 87 JS_STATIC_PROP(willCommit, event); 88 }; 89 90 #endif // FPDFSDK_JAVASCRIPT_EVENT_H_ 91