blob: 2ddc4484e18cce3ccdc4223f94c8b462ee419cd5 [file] [log] [blame]
tonikitoo618cb1f2016-08-18 20:10:17 -07001// Copyright 2016 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
Dan Sinclaire0345a42017-10-30 20:20:42 +00007#ifndef FXJS_CJS_ANNOT_H_
8#define FXJS_CJS_ANNOT_H_
tonikitoo618cb1f2016-08-18 20:10:17 -07009
Lei Zhang31beedc2018-10-18 21:09:55 +000010#include "fxjs/cjs_object.h"
Tom Sepez221f0b32018-06-04 22:11:27 +000011#include "fxjs/js_define.h"
tonikitoo618cb1f2016-08-18 20:10:17 -070012
Lei Zhang31beedc2018-10-18 21:09:55 +000013class CPDFSDK_BAAnnot;
14
Tom Sepez55865452018-08-27 20:18:04 +000015class CJS_Annot final : public CJS_Object {
tonikitoo618cb1f2016-08-18 20:10:17 -070016 public:
Dan Sinclairf7435522018-02-05 22:27:22 +000017 static int GetObjDefnID();
18 static void DefineJSObjects(CFXJS_Engine* pEngine);
19
Tom Sepez36aae4f2018-06-04 19:44:37 +000020 CJS_Annot(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
Dan Sinclairf7435522018-02-05 22:27:22 +000021 ~CJS_Annot() override;
22
Lei Zhang31beedc2018-10-18 21:09:55 +000023 void SetSDKAnnot(CPDFSDK_BAAnnot* annot);
Dan Sinclairf7435522018-02-05 22:27:22 +000024
Nico Weber563f62a2019-02-12 18:47:12 +000025 JS_STATIC_PROP(hidden, hidden, CJS_Annot)
26 JS_STATIC_PROP(name, name, CJS_Annot)
27 JS_STATIC_PROP(type, type, CJS_Annot)
Dan Sinclairf7435522018-02-05 22:27:22 +000028
29 private:
30 static int ObjDefnID;
31 static const char kName[];
32 static const JSPropertySpec PropertySpecs[];
tonikitoo618cb1f2016-08-18 20:10:17 -070033
Tom Sepez3a6d0582018-08-17 19:28:52 +000034 CJS_Result get_hidden(CJS_Runtime* pRuntime);
35 CJS_Result set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040036
Tom Sepez3a6d0582018-08-17 19:28:52 +000037 CJS_Result get_name(CJS_Runtime* pRuntime);
38 CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
dan sinclaircbe23db2017-10-19 14:29:33 -040039
Tom Sepez3a6d0582018-08-17 19:28:52 +000040 CJS_Result get_type(CJS_Runtime* pRuntime);
41 CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
tonikitoo618cb1f2016-08-18 20:10:17 -070042
tsepez1c620542016-09-12 09:47:52 -070043 CPDFSDK_Annot::ObservedPtr m_pAnnot;
tonikitoo618cb1f2016-08-18 20:10:17 -070044};
45
Dan Sinclaire0345a42017-10-30 20:20:42 +000046#endif // FXJS_CJS_ANNOT_H_