1// 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
7#ifndef FPDFSDK_JAVASCRIPT_ANNOT_H_
8#define FPDFSDK_JAVASCRIPT_ANNOT_H_
9
10#include <memory>
11
12#include "fpdfsdk/cpdfsdk_baannot.h"
13#include "fpdfsdk/javascript/JS_Define.h"
14
15class Annot : public CJS_EmbedObj {
16 public:
17  explicit Annot(CJS_Object* pJSObject);
18  ~Annot() override;
19
20  bool hidden(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
21  bool name(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
22  bool type(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
23
24  void SetSDKAnnot(CPDFSDK_BAAnnot* annot);
25
26 private:
27  CPDFSDK_Annot::ObservedPtr m_pAnnot;
28};
29
30class CJS_Annot : public CJS_Object {
31 public:
32  explicit CJS_Annot(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
33  ~CJS_Annot() override {}
34
35  DECLARE_JS_CLASS();
36  JS_STATIC_PROP(hidden, Annot);
37  JS_STATIC_PROP(name, Annot);
38  JS_STATIC_PROP(type, Annot);
39};
40
41#endif  // FPDFSDK_JAVASCRIPT_ANNOT_H_
42