tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 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 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 7 | #ifndef FXJS_CJS_ANNOT_H_ |
| 8 | #define FXJS_CJS_ANNOT_H_ |
tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 9 | |
Lei Zhang | 31beedc | 2018-10-18 21:09:55 +0000 | [diff] [blame] | 10 | #include "fxjs/cjs_object.h" |
Tom Sepez | 221f0b3 | 2018-06-04 22:11:27 +0000 | [diff] [blame] | 11 | #include "fxjs/js_define.h" |
tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 12 | |
Lei Zhang | 31beedc | 2018-10-18 21:09:55 +0000 | [diff] [blame] | 13 | class CPDFSDK_BAAnnot; |
| 14 | |
Tom Sepez | 5586545 | 2018-08-27 20:18:04 +0000 | [diff] [blame] | 15 | class CJS_Annot final : public CJS_Object { |
tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 16 | public: |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 17 | static int GetObjDefnID(); |
| 18 | static void DefineJSObjects(CFXJS_Engine* pEngine); |
| 19 | |
Tom Sepez | 36aae4f | 2018-06-04 19:44:37 +0000 | [diff] [blame] | 20 | CJS_Annot(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime); |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 21 | ~CJS_Annot() override; |
| 22 | |
Lei Zhang | 31beedc | 2018-10-18 21:09:55 +0000 | [diff] [blame] | 23 | void SetSDKAnnot(CPDFSDK_BAAnnot* annot); |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 24 | |
Nico Weber | 563f62a | 2019-02-12 18:47:12 +0000 | [diff] [blame] | 25 | JS_STATIC_PROP(hidden, hidden, CJS_Annot) |
| 26 | JS_STATIC_PROP(name, name, CJS_Annot) |
| 27 | JS_STATIC_PROP(type, type, CJS_Annot) |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 28 | |
| 29 | private: |
| 30 | static int ObjDefnID; |
| 31 | static const char kName[]; |
| 32 | static const JSPropertySpec PropertySpecs[]; |
tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 33 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 34 | CJS_Result get_hidden(CJS_Runtime* pRuntime); |
| 35 | CJS_Result set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 36 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 37 | CJS_Result get_name(CJS_Runtime* pRuntime); |
| 38 | CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 39 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 40 | CJS_Result get_type(CJS_Runtime* pRuntime); |
| 41 | CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 42 | |
tsepez | 1c62054 | 2016-09-12 09:47:52 -0700 | [diff] [blame] | 43 | CPDFSDK_Annot::ObservedPtr m_pAnnot; |
tonikitoo | 618cb1f | 2016-08-18 20:10:17 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 46 | #endif // FXJS_CJS_ANNOT_H_ |