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_FPDFXFA_CPDFXFA_CONTEXT_H_ | 7 #ifndef FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_ |
8 #define FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_ | 8 #define FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 14 matching lines...) Expand all Loading... |
25 FXFA_LOADSTATUS_LOADED, | 25 FXFA_LOADSTATUS_LOADED, |
26 FXFA_LOADSTATUS_CLOSING, | 26 FXFA_LOADSTATUS_CLOSING, |
27 FXFA_LOADSTATUS_CLOSED | 27 FXFA_LOADSTATUS_CLOSED |
28 }; | 28 }; |
29 | 29 |
30 class CPDFXFA_Context : public IXFA_AppProvider { | 30 class CPDFXFA_Context : public IXFA_AppProvider { |
31 public: | 31 public: |
32 CPDFXFA_Context(std::unique_ptr<CPDF_Document> pPDFDoc); | 32 CPDFXFA_Context(std::unique_ptr<CPDF_Document> pPDFDoc); |
33 ~CPDFXFA_Context() override; | 33 ~CPDFXFA_Context() override; |
34 | 34 |
35 FX_BOOL LoadXFADoc(); | 35 bool LoadXFADoc(); |
36 CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } | 36 CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } |
37 CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } | 37 CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } |
38 CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } | 38 CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; } |
39 int GetDocType() const { return m_iDocType; } | 39 int GetDocType() const { return m_iDocType; } |
40 v8::Isolate* GetJSERuntime() const; | 40 v8::Isolate* GetJSERuntime() const; |
41 CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } | 41 CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } |
42 | 42 |
43 CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { return m_pFormFillEnv; } | 43 CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { return m_pFormFillEnv; } |
44 void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); | 44 void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
45 | 45 |
(...skipping 13 matching lines...) Expand all Loading... |
59 void GetAppName(CFX_WideString& wsName) override; | 59 void GetAppName(CFX_WideString& wsName) override; |
60 | 60 |
61 void Beep(uint32_t dwType) override; | 61 void Beep(uint32_t dwType) override; |
62 int32_t MsgBox(const CFX_WideString& wsMessage, | 62 int32_t MsgBox(const CFX_WideString& wsMessage, |
63 const CFX_WideString& wsTitle, | 63 const CFX_WideString& wsTitle, |
64 uint32_t dwIconType, | 64 uint32_t dwIconType, |
65 uint32_t dwButtonType) override; | 65 uint32_t dwButtonType) override; |
66 CFX_WideString Response(const CFX_WideString& wsQuestion, | 66 CFX_WideString Response(const CFX_WideString& wsQuestion, |
67 const CFX_WideString& wsTitle, | 67 const CFX_WideString& wsTitle, |
68 const CFX_WideString& wsDefaultAnswer, | 68 const CFX_WideString& wsDefaultAnswer, |
69 FX_BOOL bMark) override; | 69 bool bMark) override; |
70 IFX_SeekableReadStream* DownloadURL(const CFX_WideString& wsURL) override; | 70 IFX_SeekableReadStream* DownloadURL(const CFX_WideString& wsURL) override; |
71 FX_BOOL PostRequestURL(const CFX_WideString& wsURL, | 71 bool PostRequestURL(const CFX_WideString& wsURL, |
72 const CFX_WideString& wsData, | 72 const CFX_WideString& wsData, |
73 const CFX_WideString& wsContentType, | 73 const CFX_WideString& wsContentType, |
74 const CFX_WideString& wsEncode, | 74 const CFX_WideString& wsEncode, |
75 const CFX_WideString& wsHeader, | 75 const CFX_WideString& wsHeader, |
76 CFX_WideString& wsResponse) override; | 76 CFX_WideString& wsResponse) override; |
77 FX_BOOL PutRequestURL(const CFX_WideString& wsURL, | 77 bool PutRequestURL(const CFX_WideString& wsURL, |
78 const CFX_WideString& wsData, | 78 const CFX_WideString& wsData, |
79 const CFX_WideString& wsEncode) override; | 79 const CFX_WideString& wsEncode) override; |
80 | 80 |
81 void LoadString(int32_t iStringID, CFX_WideString& wsString) override; | 81 void LoadString(int32_t iStringID, CFX_WideString& wsString) override; |
82 IFWL_AdapterTimerMgr* GetTimerMgr() override; | 82 IFWL_AdapterTimerMgr* GetTimerMgr() override; |
83 | 83 |
84 protected: | 84 protected: |
85 friend class CPDFXFA_DocEnvironment; | 85 friend class CPDFXFA_DocEnvironment; |
86 | 86 |
87 int GetOriginalPageCount() const { return m_nPageCount; } | 87 int GetOriginalPageCount() const { return m_nPageCount; } |
88 void SetOriginalPageCount(int count) { | 88 void SetOriginalPageCount(int count) { |
89 m_nPageCount = count; | 89 m_nPageCount = count; |
(...skipping 17 matching lines...) Expand all Loading... |
107 std::unique_ptr<CJS_Runtime> m_pRuntime; | 107 std::unique_ptr<CJS_Runtime> m_pRuntime; |
108 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; | 108 CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList; |
109 LoadStatus m_nLoadStatus; | 109 LoadStatus m_nLoadStatus; |
110 int m_nPageCount; | 110 int m_nPageCount; |
111 | 111 |
112 // Must be destroyed before |m_pFormFillEnv|. | 112 // Must be destroyed before |m_pFormFillEnv|. |
113 CPDFXFA_DocEnvironment m_DocEnv; | 113 CPDFXFA_DocEnvironment m_DocEnv; |
114 }; | 114 }; |
115 | 115 |
116 #endif // FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_ | 116 #endif // FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_ |
OLD | NEW |