• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FXJS_XFA_CFXJSE_CLASS_H_
8 #define FXJS_XFA_CFXJSE_CLASS_H_
9 
10 #include "core/fxcrt/unowned_ptr.h"
11 #include "fxjs/xfa/fxjse.h"
12 #include "v8/include/v8.h"
13 
14 class CFXJSE_Context;
15 class CFXJSE_Value;
16 struct FXJSE_CLASS_DESCRIPTOR;
17 
18 class CFXJSE_Class {
19  public:
20   static CFXJSE_Class* Create(CFXJSE_Context* pContext,
21                               const FXJSE_CLASS_DESCRIPTOR* lpClassDefintion,
22                               bool bIsJSGlobal);
23 
24   explicit CFXJSE_Class(CFXJSE_Context* lpContext);
25   ~CFXJSE_Class();
26 
GetContext()27   CFXJSE_Context* GetContext() const { return m_pContext.Get(); }
GetTemplate()28   v8::Global<v8::FunctionTemplate>& GetTemplate() { return m_hTemplate; }
29 
30  protected:
31   friend class CFXJSE_Context;
32   friend class CFXJSE_Value;
33 
34   ByteString m_szClassName;
35   UnownedPtr<const FXJSE_CLASS_DESCRIPTOR> m_lpClassDefinition;
36   UnownedPtr<CFXJSE_Context> const m_pContext;
37   v8::Global<v8::FunctionTemplate> m_hTemplate;
38 };
39 
40 #endif  // FXJS_XFA_CFXJSE_CLASS_H_
41