• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FXJS_CJS_ANNOT_H_
8 #define FXJS_CJS_ANNOT_H_
9 
10 #include "fxjs/cjs_object.h"
11 #include "fxjs/js_define.h"
12 
13 class CPDFSDK_BAAnnot;
14 
15 class CJS_Annot final : public CJS_Object {
16  public:
17   static int GetObjDefnID();
18   static void DefineJSObjects(CFXJS_Engine* pEngine);
19 
20   CJS_Annot(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
21   ~CJS_Annot() override;
22 
23   void SetSDKAnnot(CPDFSDK_BAAnnot* annot);
24 
25   JS_STATIC_PROP(hidden, hidden, CJS_Annot)
26   JS_STATIC_PROP(name, name, CJS_Annot)
27   JS_STATIC_PROP(type, type, CJS_Annot)
28 
29  private:
30   static int ObjDefnID;
31   static const char kName[];
32   static const JSPropertySpec PropertySpecs[];
33 
34   CJS_Result get_hidden(CJS_Runtime* pRuntime);
35   CJS_Result set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
36 
37   CJS_Result get_name(CJS_Runtime* pRuntime);
38   CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
39 
40   CJS_Result get_type(CJS_Runtime* pRuntime);
41   CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
42 
43   ObservedPtr<CPDFSDK_Annot> m_pAnnot;
44 };
45 
46 #endif  // FXJS_CJS_ANNOT_H_
47