Home | History | Annotate | Download | only in fxjs
      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 "fpdfsdk/cpdfsdk_baannot.h"
     11 #include "fxjs/JS_Define.h"
     12 
     13 class Annot : public CJS_EmbedObj {
     14  public:
     15   explicit Annot(CJS_Object* pJSObject);
     16   ~Annot() override;
     17 
     18   CJS_Return get_hidden(CJS_Runtime* pRuntime);
     19   CJS_Return set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
     20 
     21   CJS_Return get_name(CJS_Runtime* pRuntime);
     22   CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
     23 
     24   CJS_Return get_type(CJS_Runtime* pRuntime);
     25   CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
     26 
     27   void SetSDKAnnot(CPDFSDK_BAAnnot* annot);
     28 
     29  private:
     30   CPDFSDK_Annot::ObservedPtr m_pAnnot;
     31 };
     32 
     33 class CJS_Annot : public CJS_Object {
     34  public:
     35   static int GetObjDefnID();
     36   static void DefineJSObjects(CFXJS_Engine* pEngine);
     37 
     38   explicit CJS_Annot(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
     39   ~CJS_Annot() override {}
     40 
     41   JS_STATIC_PROP(hidden, hidden, Annot);
     42   JS_STATIC_PROP(name, name, Annot);
     43   JS_STATIC_PROP(type, type, Annot);
     44 
     45  private:
     46   static int ObjDefnID;
     47   static const JSPropertySpec PropertySpecs[];
     48 };
     49 
     50 #endif  // FXJS_CJS_ANNOT_H_
     51