OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 XFA_SRC_FXJSE_CLASS_H_ | |
8 #define XFA_SRC_FXJSE_CLASS_H_ | |
9 | |
10 #include "v8/include/v8.h" | |
11 #include "xfa/include/fxjse/fxjse.h" | |
12 | |
13 class CFXJSE_Context; | |
14 class CFXJSE_Value; | |
15 | |
16 class CFXJSE_Class { | |
17 protected: | |
18 CFXJSE_Class(CFXJSE_Context* lpContext) | |
19 : m_lpClassDefinition(nullptr), m_pContext(lpContext) {} | |
20 | |
21 public: | |
22 inline CFXJSE_Context* GetContext() { return m_pContext; } | |
23 inline v8::Global<v8::FunctionTemplate>& GetTemplate() { return m_hTemplate; } | |
24 | |
25 public: | |
26 static CFXJSE_Class* Create(CFXJSE_Context* pContext, | |
27 const FXJSE_CLASS* lpClassDefintion, | |
28 FX_BOOL bIsJSGlobal = FALSE); | |
29 static CFXJSE_Class* GetClassFromContext(CFXJSE_Context* pContext, | |
30 const CFX_ByteStringC& szName); | |
31 static void SetUpNamedPropHandler( | |
32 v8::Isolate* pIsolate, | |
33 v8::Local<v8::ObjectTemplate>& hObjectTemplate, | |
34 const FXJSE_CLASS* lpClassDefinition); | |
35 | |
36 protected: | |
37 CFX_ByteString m_szClassName; | |
38 const FXJSE_CLASS* m_lpClassDefinition; | |
39 CFXJSE_Context* m_pContext; | |
40 v8::Global<v8::FunctionTemplate> m_hTemplate; | |
41 friend class CFXJSE_Context; | |
42 friend class CFXJSE_Value; | |
43 }; | |
44 struct CFXJSE_ArgumentsImpl { | |
45 const v8::FunctionCallbackInfo<v8::Value>* m_pInfo; | |
46 CFXJSE_Value* m_pRetValue; | |
47 }; | |
48 | |
49 #endif // XFA_SRC_FXJSE_CLASS_H_ | |
OLD | NEW |