• 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 FXJS_CJS_CONSOLE_H_
8 #define FXJS_CJS_CONSOLE_H_
9 
10 #include <vector>
11 
12 #include "fxjs/JS_Define.h"
13 
14 class console : public CJS_EmbedObj {
15  public:
16   explicit console(CJS_Object* pJSObject);
17   ~console() override;
18 
19  public:
20   CJS_Return clear(CJS_Runtime* pRuntime,
21                    const std::vector<v8::Local<v8::Value>>& params);
22   CJS_Return hide(CJS_Runtime* pRuntime,
23                   const std::vector<v8::Local<v8::Value>>& params);
24   CJS_Return println(CJS_Runtime* pRuntime,
25                      const std::vector<v8::Local<v8::Value>>& params);
26   CJS_Return show(CJS_Runtime* pRuntime,
27                   const std::vector<v8::Local<v8::Value>>& params);
28 };
29 
30 class CJS_Console : public CJS_Object {
31  public:
32   static void DefineJSObjects(CFXJS_Engine* pEngine);
33 
CJS_Console(v8::Local<v8::Object> pObject)34   explicit CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
~CJS_Console()35   ~CJS_Console() override {}
36 
37   JS_STATIC_METHOD(clear, console);
38   JS_STATIC_METHOD(hide, console);
39   JS_STATIC_METHOD(println, console);
40   JS_STATIC_METHOD(show, console);
41 
42  private:
43   static int ObjDefnID;
44   static const JSMethodSpec MethodSpecs[];
45 };
46 
47 #endif  // FXJS_CJS_CONSOLE_H_
48