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_JAVASCRIPT_CONSOLE_H_
8 #define FPDFSDK_JAVASCRIPT_CONSOLE_H_
9 
10 #include <vector>
11 
12 #include "fpdfsdk/javascript/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   bool clear(CJS_Runtime* pRuntime,
21              const std::vector<CJS_Value>& params,
22              CJS_Value& vRet,
23              CFX_WideString& sError);
24   bool hide(CJS_Runtime* pRuntime,
25             const std::vector<CJS_Value>& params,
26             CJS_Value& vRet,
27             CFX_WideString& sError);
28   bool println(CJS_Runtime* pRuntime,
29                const std::vector<CJS_Value>& params,
30                CJS_Value& vRet,
31                CFX_WideString& sError);
32   bool show(CJS_Runtime* pRuntime,
33             const std::vector<CJS_Value>& params,
34             CJS_Value& vRet,
35             CFX_WideString& sError);
36 };
37 
38 class CJS_Console : public CJS_Object {
39  public:
CJS_Console(v8::Local<v8::Object> pObject)40   explicit CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
~CJS_Console()41   ~CJS_Console() override {}
42 
43   DECLARE_JS_CLASS();
44 
45   JS_STATIC_METHOD(clear, console);
46   JS_STATIC_METHOD(hide, console);
47   JS_STATIC_METHOD(println, console);
48   JS_STATIC_METHOD(show, console);
49 };
50 
51 #endif  // FPDFSDK_JAVASCRIPT_CONSOLE_H_
52