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 FXJS_CJS_GLOBAL_H_
8 #define FXJS_CJS_GLOBAL_H_
9 
10 #include "fxjs/JS_Define.h"
11 
12 class CJS_Global : public CJS_Object {
13  public:
14   static void DefineJSObjects(CFXJS_Engine* pEngine);
15   static void DefineAllProperties(CFXJS_Engine* pEngine);
16 
17   static void queryprop_static(
18       v8::Local<v8::String> property,
19       const v8::PropertyCallbackInfo<v8::Integer>& info);
20   static void getprop_static(v8::Local<v8::String> property,
21                              const v8::PropertyCallbackInfo<v8::Value>& info);
22   static void putprop_static(v8::Local<v8::String> property,
23                              v8::Local<v8::Value> value,
24                              const v8::PropertyCallbackInfo<v8::Value>& info);
25   static void delprop_static(v8::Local<v8::String> property,
26                              const v8::PropertyCallbackInfo<v8::Boolean>& info);
27 
28   static void setPersistent_static(
29       const v8::FunctionCallbackInfo<v8::Value>& info);
30 
CJS_Global(v8::Local<v8::Object> pObject)31   explicit CJS_Global(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
~CJS_Global()32   ~CJS_Global() override {}
33 
34   // CJS_Object
35   void InitInstance(IJS_Runtime* pIRuntime) override;
36 
37  private:
38   static int ObjDefnID;
39   static const JSMethodSpec MethodSpecs[];
40 };
41 
42 #endif  // FXJS_CJS_GLOBAL_H_
43