OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ | 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ |
8 #define FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ | 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ |
9 | 9 |
10 #include "../../../core/include/fxcrt/fx_string.h" | 10 #include "../../../core/include/fxcrt/fx_string.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 virtual void OnExternal_Exec() = 0; | 127 virtual void OnExternal_Exec() = 0; |
128 | 128 |
129 virtual void EnableMessageBox(FX_BOOL bEnable) = 0; | 129 virtual void EnableMessageBox(FX_BOOL bEnable) = 0; |
130 | 130 |
131 protected: | 131 protected: |
132 virtual ~IJS_Context() {} | 132 virtual ~IJS_Context() {} |
133 }; | 133 }; |
134 | 134 |
135 class IJS_Runtime { | 135 class IJS_Runtime { |
136 public: | 136 public: |
| 137 static void Initialize(unsigned int slot, void* isolate); |
137 static IJS_Runtime* Create(CPDFDoc_Environment* pEnv); | 138 static IJS_Runtime* Create(CPDFDoc_Environment* pEnv); |
138 virtual ~IJS_Runtime() {} | 139 virtual ~IJS_Runtime() {} |
139 | 140 |
140 virtual IJS_Context* NewContext() = 0; | 141 virtual IJS_Context* NewContext() = 0; |
141 virtual void ReleaseContext(IJS_Context* pContext) = 0; | 142 virtual void ReleaseContext(IJS_Context* pContext) = 0; |
142 virtual IJS_Context* GetCurrentContext() = 0; | 143 virtual IJS_Context* GetCurrentContext() = 0; |
143 virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0; | 144 virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0; |
144 | 145 |
145 virtual CPDFSDK_Document* GetReaderDocument() = 0; | 146 virtual CPDFSDK_Document* GetReaderDocument() = 0; |
146 | 147 |
147 virtual FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, | 148 virtual FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, |
148 FXJSE_HVALUE hValue) = 0; | 149 FXJSE_HVALUE hValue) = 0; |
149 virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, | 150 virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, |
150 FXJSE_HVALUE hValue) = 0; | 151 FXJSE_HVALUE hValue) = 0; |
151 | 152 |
152 protected: | 153 protected: |
153 IJS_Runtime() {} | 154 IJS_Runtime() {} |
154 }; | 155 }; |
155 | 156 |
156 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ | 157 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ |
OLD | NEW |