1 // Copyright 2014 PDFium Authors. All rights reserved.
\r
2 // Use of this source code is governed by a BSD-style license that can be
\r
3 // found in the LICENSE file.
\r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
\r
7 #ifndef FXJSE_CLASS_H_
\r
8 #define FXJSE_CLASS_H_
\r
9 class CFXJSE_Context;
\r
11 class CFXJSE_Class : public CFX_Object
\r
14 CFXJSE_Class(CFXJSE_Context* lpContext) : m_pContext(lpContext) {}
\r
16 inline CFXJSE_Context* GetContext()
\r
20 inline v8::Persistent<v8::FunctionTemplate>& GetTemplate()
\r
25 static CFXJSE_Class* Create(CFXJSE_Context* pContext, const FXJSE_CLASS* lpClassDefintion, FX_BOOL bIsJSGlobal = FALSE);
\r
26 static CFXJSE_Class* GetClassFromContext(CFXJSE_Context* pContext, FX_BSTR szName);
\r
27 static void SetUpDynPropHandler(CFXJSE_Context* pContext, CFXJSE_Value* pValue, const FXJSE_CLASS* lpClassDefinition);
\r
28 static void SetUpNamedPropHandler(v8::Isolate* pIsolate, v8::Local<v8::ObjectTemplate>& hObjectTemplate, const FXJSE_CLASS* lpClassDefinition);
\r
30 CFX_ByteString m_szClassName;
\r
31 CFXJSE_Context* m_pContext;
\r
32 v8::Persistent<v8::FunctionTemplate> m_hTemplate;
\r
33 friend class CFXJSE_Context;
\r
34 friend class CFXJSE_Value;
\r
36 struct CFXJSE_ArgumentsImpl {
\r
37 const v8::FunctionCallbackInfo<v8::Value>* m_pInfo;
\r
38 CFXJSE_Value* m_pRetValue;
\r