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