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#include "fpdfsdk/javascript/Icon.h" 8 9#include "fpdfsdk/javascript/JS_Define.h" 10#include "fpdfsdk/javascript/JS_Object.h" 11#include "fpdfsdk/javascript/JS_Value.h" 12 13JSConstSpec CJS_Icon::ConstSpecs[] = {{0, JSConstSpec::Number, 0, 0}}; 14 15JSPropertySpec CJS_Icon::PropertySpecs[] = { 16 {"name", get_name_static, set_name_static}, 17 {0, 0, 0}}; 18 19JSMethodSpec CJS_Icon::MethodSpecs[] = {{0, 0}}; 20 21IMPLEMENT_JS_CLASS(CJS_Icon, Icon) 22 23Icon::Icon(CJS_Object* pJSObject) 24 : CJS_EmbedObj(pJSObject), m_swIconName(L"") {} 25 26Icon::~Icon() {} 27 28bool Icon::name(CJS_Runtime* pRuntime, 29 CJS_PropValue& vp, 30 CFX_WideString& sError) { 31 if (!vp.IsGetting()) 32 return false; 33 34 vp << m_swIconName; 35 return true; 36} 37