blob: 43a55bc7b00977dcf4bddfac7248052a8ad0e1ac [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 Sinclaire0345a42017-10-30 20:20:42 +00007#ifndef FXJS_CJS_CONSOLE_H_
8#define FXJS_CJS_CONSOLE_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
Dan Sinclair3ebd1212016-03-09 09:59:23 -050010#include <vector>
11
Dan Sinclaire0345a42017-10-30 20:20:42 +000012#include "fxjs/JS_Define.h"
Tom Sepez9a3f8122015-04-07 15:35:48 -070013
Nico Weber9d8ec5a2015-08-04 13:00:21 -070014class console : public CJS_EmbedObj {
15 public:
Dan Sinclair85c8e7f2016-11-21 13:50:32 -050016 explicit console(CJS_Object* pJSObject);
Lei Zhang2b1a2d52015-08-14 22:16:22 -070017 ~console() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070018
Nico Weber9d8ec5a2015-08-04 13:00:21 -070019 public:
Dan Sinclair8f524d62017-10-25 13:30:31 -040020 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);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070028};
29
Nico Weber9d8ec5a2015-08-04 13:00:21 -070030class CJS_Console : public CJS_Object {
31 public:
Dan Sinclairbef4d3e2017-10-26 16:49:38 -040032 static void DefineJSObjects(CFXJS_Engine* pEngine);
Dan Sinclairef299532017-10-26 16:48:30 -040033
Dan Sinclair85c8e7f2016-11-21 13:50:32 -050034 explicit CJS_Console(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
Lei Zhang2b1a2d52015-08-14 22:16:22 -070035 ~CJS_Console() override {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070036
Nico Weber9d8ec5a2015-08-04 13:00:21 -070037 JS_STATIC_METHOD(clear, console);
38 JS_STATIC_METHOD(hide, console);
39 JS_STATIC_METHOD(println, console);
40 JS_STATIC_METHOD(show, console);
Dan Sinclairef299532017-10-26 16:48:30 -040041
42 private:
43 static int ObjDefnID;
Dan Sinclairc94a7932017-10-26 16:48:57 -040044 static const JSMethodSpec MethodSpecs[];
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070045};
46
Dan Sinclaire0345a42017-10-30 20:20:42 +000047#endif // FXJS_CJS_CONSOLE_H_