blob: a92509d55a5c340805ce766bd7cb4235aa926eb9 [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 Sinclaire0345a42017-10-30 20:20:42 +00007#ifndef FXJS_CJS_ICON_H_
8#define FXJS_CJS_ICON_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
Tom Sepez221f0b32018-06-04 22:11:27 +000010#include "fxjs/js_define.h"
Tom Sepez9a3f8122015-04-07 15:35:48 -070011
Tom Sepez55865452018-08-27 20:18:04 +000012class CJS_Icon final : public CJS_Object {
Nico Weber9d8ec5a2015-08-04 13:00:21 -070013 public:
Dan Sinclairef299532017-10-26 16:48:30 -040014 static int GetObjDefnID();
Dan Sinclairbef4d3e2017-10-26 16:49:38 -040015 static void DefineJSObjects(CFXJS_Engine* pEngine);
Dan Sinclairef299532017-10-26 16:48:30 -040016
Tom Sepez36aae4f2018-06-04 19:44:37 +000017 CJS_Icon(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
Dan Sinclairf7435522018-02-05 22:27:22 +000018 ~CJS_Icon() override;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070019
Dan Sinclairf7435522018-02-05 22:27:22 +000020 WideString GetIconName() const { return m_swIconName; }
21 void SetIconName(WideString name) { m_swIconName = name; }
22
23 JS_STATIC_PROP(name, name, CJS_Icon);
Dan Sinclairef299532017-10-26 16:48:30 -040024
25 private:
26 static int ObjDefnID;
Dan Sinclairf7435522018-02-05 22:27:22 +000027 static const char kName[];
Dan Sinclairc94a7932017-10-26 16:48:57 -040028 static const JSPropertySpec PropertySpecs[];
Dan Sinclairf7435522018-02-05 22:27:22 +000029
Tom Sepez3a6d0582018-08-17 19:28:52 +000030 CJS_Result get_name(CJS_Runtime* pRuntime);
31 CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
Dan Sinclairf7435522018-02-05 22:27:22 +000032
33 WideString m_swIconName;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070034};
35
Dan Sinclaire0345a42017-10-30 20:20:42 +000036#endif // FXJS_CJS_ICON_H_