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 | d7ac26c | 2017-10-25 20:30:02 -0400 | [diff] [blame^] | 7 | #ifndef FPDFSDK_JAVASCRIPT_CJS_GLOBAL_H_ |
| 8 | #define FPDFSDK_JAVASCRIPT_CJS_GLOBAL_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
Dan Sinclair | f766ad2 | 2016-03-14 13:51:24 -0400 | [diff] [blame] | 10 | #include "fpdfsdk/javascript/JS_Define.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 11 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 12 | class CJS_Global : public CJS_Object { |
| 13 | public: |
Tom Sepez | 808a99e | 2015-09-10 12:28:37 -0700 | [diff] [blame] | 14 | explicit CJS_Global(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 15 | ~CJS_Global() override {} |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 16 | |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 17 | // CJS_Object |
Tom Sepez | 3342090 | 2015-10-13 15:00:10 -0700 | [diff] [blame] | 18 | void InitInstance(IJS_Runtime* pIRuntime) override; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 19 | |
Dan Sinclair | 4b172c4 | 2017-10-23 11:22:31 -0400 | [diff] [blame] | 20 | DECLARE_JS_CLASS_BASE_PART(); |
| 21 | DECLARE_JS_CLASS_CONST_PART(); |
| 22 | DECLARE_JS_CLASS_PART(); |
| 23 | static void queryprop_static( |
| 24 | v8::Local<v8::String> property, |
| 25 | const v8::PropertyCallbackInfo<v8::Integer>& info); |
| 26 | static void getprop_static(v8::Local<v8::String> property, |
| 27 | const v8::PropertyCallbackInfo<v8::Value>& info); |
| 28 | static void putprop_static(v8::Local<v8::String> property, |
| 29 | v8::Local<v8::Value> value, |
| 30 | const v8::PropertyCallbackInfo<v8::Value>& info); |
| 31 | static void delprop_static(v8::Local<v8::String> property, |
| 32 | const v8::PropertyCallbackInfo<v8::Boolean>& info); |
| 33 | static void DefineAllProperties(CFXJS_Engine* pEngine); |
| 34 | |
| 35 | static void setPersistent_static( |
| 36 | const v8::FunctionCallbackInfo<v8::Value>& info); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 37 | }; |
| 38 | |
dan sinclair | d7ac26c | 2017-10-25 20:30:02 -0400 | [diff] [blame^] | 39 | #endif // FPDFSDK_JAVASCRIPT_CJS_GLOBAL_H_ |