blob: 2cb123ab71f392459790ba9978dc787ff3799478 [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
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070015BEGIN_JS_STATIC_CONST(CJS_Report)
16END_JS_STATIC_CONST()
17
18BEGIN_JS_STATIC_PROP(CJS_Report)
19END_JS_STATIC_PROP()
20
Tom Sepezc6ab1722015-02-05 15:27:25 -080021BEGIN_JS_STATIC_METHOD(CJS_Report)
Nico Weber9d8ec5a2015-08-04 13:00:21 -070022JS_STATIC_METHOD_ENTRY(save)
23JS_STATIC_METHOD_ENTRY(writeText)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070024END_JS_STATIC_METHOD()
25
26IMPLEMENT_JS_CLASS(CJS_Report, Report)
Tom Sepezc6ab1722015-02-05 15:27:25 -080027
Nico Weber9d8ec5a2015-08-04 13:00:21 -070028Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070029
Nico Weber9d8ec5a2015-08-04 13:00:21 -070030Report::~Report() {}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070031
Tom Sepezb1670b52017-02-16 17:01:00 -080032bool Report::writeText(CJS_Runtime* pRuntime,
tsepez4cf55152016-11-02 14:37:54 -070033 const std::vector<CJS_Value>& params,
34 CJS_Value& vRet,
35 CFX_WideString& sError) {
Tom Sepezc6ab1722015-02-05 15:27:25 -080036 // Unsafe, not supported.
tsepez4cf55152016-11-02 14:37:54 -070037 return true;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070038}
39
Tom Sepezb1670b52017-02-16 17:01:00 -080040bool Report::save(CJS_Runtime* pRuntime,
tsepez4cf55152016-11-02 14:37:54 -070041 const std::vector<CJS_Value>& params,
42 CJS_Value& vRet,
43 CFX_WideString& sError) {
Tom Sepezc6ab1722015-02-05 15:27:25 -080044 // Unsafe, not supported.
tsepez4cf55152016-11-02 14:37:54 -070045 return true;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070046}