blob: c9c986d19552fd06bd545baa2c93702d7868f7f0 [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.
Tom Sepezc6ab1722015-02-05 15:27:25 -08004
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#include "fpdfsdk/javascript/report.h"
Tom Sepez37458412015-10-06 11:33:46 -07008
Dan Sinclair3ebd1212016-03-09 09:59:23 -05009#include <vector>
10
Dan Sinclairf766ad22016-03-14 13:51:24 -040011#include "fpdfsdk/javascript/JS_Define.h"
12#include "fpdfsdk/javascript/JS_Object.h"
13#include "fpdfsdk/javascript/JS_Value.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070014
Tom Sepez04557b82017-02-16 09:43:10 -080015JSConstSpec CJS_Report::ConstSpecs[] = {{0, JSConstSpec::Number, 0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070016
Tom Sepez04557b82017-02-16 09:43:10 -080017JSPropertySpec CJS_Report::PropertySpecs[] = {{0, 0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070018
Tom Sepez9b99b632017-02-21 15:05:57 -080019JSMethodSpec CJS_Report::MethodSpecs[] = {{"save", save_static},
20 {"writeText", writeText_static},
Tom Sepez04557b82017-02-16 09:43:10 -080021 {0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070022
23IMPLEMENT_JS_CLASS(CJS_Report, Report)
Tom Sepezc6ab1722015-02-05 15:27:25 -080024
Nico Weber9d8ec5a2015-08-04 13:00:21 -070025Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070026
Nico Weber9d8ec5a2015-08-04 13:00:21 -070027Report::~Report() {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070028
Tom Sepezb1670b52017-02-16 17:01:00 -080029bool Report::writeText(CJS_Runtime* pRuntime,
tsepez4cf55152016-11-02 14:37:54 -070030 const std::vector<CJS_Value>& params,
31 CJS_Value& vRet,
32 CFX_WideString& sError) {
Tom Sepezc6ab1722015-02-05 15:27:25 -080033 // Unsafe, not supported.
tsepez4cf55152016-11-02 14:37:54 -070034 return true;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070035}
36
Tom Sepezb1670b52017-02-16 17:01:00 -080037bool Report::save(CJS_Runtime* pRuntime,
tsepez4cf55152016-11-02 14:37:54 -070038 const std::vector<CJS_Value>& params,
39 CJS_Value& vRet,
40 CFX_WideString& sError) {
Tom Sepezc6ab1722015-02-05 15:27:25 -080041 // Unsafe, not supported.
tsepez4cf55152016-11-02 14:37:54 -070042 return true;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070043}