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 "../../include/javascript/JavaScript.h" 8#include "../../include/javascript/IJavaScript.h" 9#include "../../include/javascript/JS_Define.h" 10#include "../../include/javascript/JS_Object.h" 11#include "../../include/javascript/JS_Value.h" 12#include "../../include/javascript/Icon.h" 13 14/* ---------------------- Icon ---------------------- */ 15 16BEGIN_JS_STATIC_CONST(CJS_Icon) 17END_JS_STATIC_CONST() 18 19BEGIN_JS_STATIC_PROP(CJS_Icon) 20 JS_STATIC_PROP_ENTRY(name) 21END_JS_STATIC_PROP() 22 23BEGIN_JS_STATIC_METHOD(CJS_Icon) 24END_JS_STATIC_METHOD() 25 26IMPLEMENT_JS_CLASS(CJS_Icon,Icon) 27 28Icon::Icon(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject), 29 m_pIconStream(NULL), 30 m_swIconName(L"") 31{ 32} 33 34Icon::~Icon() 35{ 36 37} 38 39void Icon::SetStream(CPDF_Stream* pIconStream) 40{ 41 if(pIconStream) 42 m_pIconStream = pIconStream; 43} 44 45CPDF_Stream* Icon::GetStream() 46{ 47 return m_pIconStream; 48} 49 50void Icon::SetIconName(CFX_WideString name) 51{ 52 m_swIconName = name; 53} 54 55CFX_WideString Icon::GetIconName() 56{ 57 return m_swIconName; 58} 59 60FX_BOOL Icon::name(OBJ_PROP_PARAMS) 61{ 62 if(!vp.IsGetting())return FALSE; 63 64 vp << m_swIconName; 65 return TRUE; 66} 67 68