• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SRC_JAVASCRIPT_EVENT_H_
8 #define FPDFSDK_SRC_JAVASCRIPT_EVENT_H_
9 
10 #include "JS_Define.h"
11 
12 class event : public CJS_EmbedObj {
13  public:
14   event(CJS_Object* pJSObject);
15   ~event() override;
16 
17  public:
18   FX_BOOL change(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
19   FX_BOOL changeEx(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
20   FX_BOOL commitKey(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
21   FX_BOOL fieldFull(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
22   FX_BOOL keyDown(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
23   FX_BOOL modifier(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
24   FX_BOOL name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
25   FX_BOOL rc(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
26   FX_BOOL richChange(IJS_Context* cc,
27                      CJS_PropValue& vp,
28                      CFX_WideString& sError);
29   FX_BOOL richChangeEx(IJS_Context* cc,
30                        CJS_PropValue& vp,
31                        CFX_WideString& sError);
32   FX_BOOL richValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
33   FX_BOOL selEnd(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
34   FX_BOOL selStart(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
35   FX_BOOL shift(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
36   FX_BOOL source(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
37   FX_BOOL target(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
38   FX_BOOL targetName(IJS_Context* cc,
39                      CJS_PropValue& vp,
40                      CFX_WideString& sError);
41   FX_BOOL type(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
42   FX_BOOL value(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
43   FX_BOOL willCommit(IJS_Context* cc,
44                      CJS_PropValue& vp,
45                      CFX_WideString& sError);
46 };
47 
48 class CJS_Event : public CJS_Object {
49  public:
CJS_Event(v8::Local<v8::Object> pObject)50   CJS_Event(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
~CJS_Event()51   ~CJS_Event() override {}
52 
53   DECLARE_JS_CLASS();
54   JS_STATIC_PROP(change, event);
55   JS_STATIC_PROP(changeEx, event);
56   JS_STATIC_PROP(commitKey, event);
57   JS_STATIC_PROP(fieldFull, event);
58   JS_STATIC_PROP(keyDown, event);
59   JS_STATIC_PROP(modifier, event);
60   JS_STATIC_PROP(name, event);
61   JS_STATIC_PROP(rc, event);
62   JS_STATIC_PROP(richChange, event);
63   JS_STATIC_PROP(richChangeEx, event);
64   JS_STATIC_PROP(richValue, event);
65   JS_STATIC_PROP(selEnd, event);
66   JS_STATIC_PROP(selStart, event);
67   JS_STATIC_PROP(shift, event);
68   JS_STATIC_PROP(source, event);
69   JS_STATIC_PROP(target, event);
70   JS_STATIC_PROP(targetName, event);
71   JS_STATIC_PROP(type, event);
72   JS_STATIC_PROP(value, event);
73   JS_STATIC_PROP(willCommit, event);
74 };
75 
76 #endif  // FPDFSDK_SRC_JAVASCRIPT_EVENT_H_
77