blob: 77794a2e34de87302a806b2c21de4b5eae6f9b9c [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -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.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclairf766ad22016-03-14 13:51:24 -04007#ifndef FPDFSDK_JAVASCRIPT_GLOBAL_H_
8#define FPDFSDK_JAVASCRIPT_GLOBAL_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
Dan Sinclairf766ad22016-03-14 13:51:24 -040010#include "fpdfsdk/javascript/JS_Define.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070011
Nico Weber9d8ec5a2015-08-04 13:00:21 -070012class CJS_Global : public CJS_Object {
13 public:
Tom Sepez808a99e2015-09-10 12:28:37 -070014 explicit CJS_Global(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
Lei Zhang2b1a2d52015-08-14 22:16:22 -070015 ~CJS_Global() override {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070016
Lei Zhang2b1a2d52015-08-14 22:16:22 -070017 // CJS_Object
Tom Sepez33420902015-10-13 15:00:10 -070018 void InitInstance(IJS_Runtime* pIRuntime) override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070019
Dan Sinclair4b172c42017-10-23 11:22:31 -040020 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-Malek3f3b45c2014-05-23 17:28:10 -070037};
38
Dan Sinclairf766ad22016-03-14 13:51:24 -040039#endif // FPDFSDK_JAVASCRIPT_GLOBAL_H_