blob: 7c340af0d27a740294cea37adb9d094b7c15c413 [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 Sinclairf766ad22016-03-14 13:51:24 -04007#include "fpdfsdk/javascript/Icon.h"
Tom Sepez37458412015-10-06 11:33:46 -07008
Dan Sinclairf766ad22016-03-14 13:51:24 -04009#include "fpdfsdk/javascript/JS_Define.h"
10#include "fpdfsdk/javascript/JS_Object.h"
11#include "fpdfsdk/javascript/JS_Value.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070012
Tom Sepez04557b82017-02-16 09:43:10 -080013JSConstSpec CJS_Icon::ConstSpecs[] = {{0, JSConstSpec::Number, 0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070014
Tom Sepez04557b82017-02-16 09:43:10 -080015JSPropertySpec CJS_Icon::PropertySpecs[] = {
Tom Sepez4d5b8c52017-02-21 15:17:07 -080016 {"name", get_name_static, set_name_static},
Tom Sepez04557b82017-02-16 09:43:10 -080017 {0, 0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070018
Tom Sepez04557b82017-02-16 09:43:10 -080019JSMethodSpec CJS_Icon::MethodSpecs[] = {{0, 0}};
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070020
Nico Weber9d8ec5a2015-08-04 13:00:21 -070021IMPLEMENT_JS_CLASS(CJS_Icon, Icon)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070022
Nico Weber9d8ec5a2015-08-04 13:00:21 -070023Icon::Icon(CJS_Object* pJSObject)
Tom Sepez40e0a812017-02-23 13:07:36 -080024 : CJS_EmbedObj(pJSObject), m_swIconName(L"") {}
Nico Weber9d8ec5a2015-08-04 13:00:21 -070025
26Icon::~Icon() {}
27
Dan Sinclair33d13f22017-10-23 09:44:30 -040028bool Icon::get_name(CJS_Runtime* pRuntime, CJS_Value* vp, WideString* sError) {
29 vp->Set(pRuntime, m_swIconName);
tsepez4cf55152016-11-02 14:37:54 -070030 return true;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070031}
dan sinclaircbe23db2017-10-19 14:29:33 -040032
33bool Icon::set_name(CJS_Runtime* pRuntime,
Dan Sinclair33d13f22017-10-23 09:44:30 -040034 const CJS_Value& vp,
dan sinclaircbe23db2017-10-19 14:29:33 -040035 WideString* sError) {
36 return false;
37}