| 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_JAVASCRIPT_CJS_CONTEXT_H_ | 7 #ifndef FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_ |
| 8 #define FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_ | 8 #define FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "core/fxcrt/include/fx_string.h" | 12 #include "core/fxcrt/include/fx_string.h" |
| 11 #include "core/fxcrt/include/fx_system.h" | 13 #include "core/fxcrt/include/fx_system.h" |
| 12 #include "fpdfsdk/javascript/ijs_context.h" | 14 #include "fpdfsdk/javascript/ijs_context.h" |
| 13 | 15 |
| 14 class CJS_EventHandler; | 16 class CJS_EventHandler; |
| 15 class CJS_Runtime; | 17 class CJS_Runtime; |
| 16 class CPDFDoc_Environment; | 18 class CPDFDoc_Environment; |
| 17 | 19 |
| 18 class CJS_Context : public IJS_Context { | 20 class CJS_Context : public IJS_Context { |
| 19 public: | 21 public: |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 CPDFSDK_Annot* pScreen) override; | 116 CPDFSDK_Annot* pScreen) override; |
| 115 void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) override; | 117 void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) override; |
| 116 void OnLink_MouseUp(CPDFSDK_Document* pTarget) override; | 118 void OnLink_MouseUp(CPDFSDK_Document* pTarget) override; |
| 117 void OnMenu_Exec(CPDFSDK_Document* pTarget, | 119 void OnMenu_Exec(CPDFSDK_Document* pTarget, |
| 118 const CFX_WideString& strTargetName) override; | 120 const CFX_WideString& strTargetName) override; |
| 119 void OnBatchExec(CPDFSDK_Document* pTarget) override; | 121 void OnBatchExec(CPDFSDK_Document* pTarget) override; |
| 120 void OnConsole_Exec() override; | 122 void OnConsole_Exec() override; |
| 121 void OnExternal_Exec() override; | 123 void OnExternal_Exec() override; |
| 122 | 124 |
| 123 CJS_Runtime* GetJSRuntime() const { return m_pRuntime; } | 125 CJS_Runtime* GetJSRuntime() const { return m_pRuntime; } |
| 124 CJS_EventHandler* GetEventHandler() const { return m_pEventHandler; } | 126 CJS_EventHandler* GetEventHandler() const { return m_pEventHandler.get(); } |
| 125 | 127 |
| 126 CPDFDoc_Environment* GetReaderApp(); | 128 CPDFDoc_Environment* GetReaderApp(); |
| 127 CPDFSDK_Document* GetReaderDocument(); | 129 CPDFSDK_Document* GetReaderDocument(); |
| 128 | 130 |
| 129 private: | 131 private: |
| 130 CJS_Runtime* m_pRuntime; | 132 CJS_Runtime* const m_pRuntime; |
| 131 CJS_EventHandler* m_pEventHandler; | 133 std::unique_ptr<CJS_EventHandler> m_pEventHandler; |
| 132 FX_BOOL m_bBusy; | 134 FX_BOOL m_bBusy; |
| 133 }; | 135 }; |
| 134 | 136 |
| 135 #endif // FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_ | 137 #endif // FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_ |
| OLD | NEW |