1 // Copyright 2017 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_XFA_CJX_INSTANCEMANAGER_H_ 8 #define FXJS_XFA_CJX_INSTANCEMANAGER_H_ 9 10 #include "fxjs/xfa/cjx_node.h" 11 #include "fxjs/xfa/jse_define.h" 12 #include "v8/include/v8-forward.h" 13 14 class CXFA_InstanceManager; 15 16 class CJX_InstanceManager final : public CJX_Node { 17 public: 18 CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; 19 ~CJX_InstanceManager() override; 20 21 // CJX_Object: 22 bool DynamicTypeIs(TypeTag eType) const override; 23 24 JSE_METHOD(addInstance); 25 JSE_METHOD(insertInstance); 26 JSE_METHOD(moveInstance); 27 JSE_METHOD(removeInstance); 28 JSE_METHOD(setInstances); 29 30 JSE_PROP(count); 31 JSE_PROP(max); 32 JSE_PROP(min); 33 34 int32_t MoveInstance(v8::Isolate* pIsolate, int32_t iTo, int32_t iFrom); 35 36 private: 37 explicit CJX_InstanceManager(CXFA_InstanceManager* mgr); 38 39 using Type__ = CJX_InstanceManager; 40 using ParentType__ = CJX_Node; 41 42 static const TypeTag static_type__ = TypeTag::InstanceManager; 43 static const CJX_MethodSpec MethodSpecs[]; 44 45 int32_t SetInstances(v8::Isolate* pIsolate, int32_t iDesired); 46 }; 47 48 #endif // FXJS_XFA_CJX_INSTANCEMANAGER_H_ 49