Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: fpdfsdk/cpdfsdk_formfillenvironment.h

Issue 2400473002: Start proxying CPDFSDK_Document methods through CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_document.h ('k') | fpdfsdk/cpdfsdk_formfillenvironment.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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_CPDFSDK_FORMFILLENVIRONMENT_H_ 7 #ifndef FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_
8 #define FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_ 8 #define FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "core/fpdfapi/page/cpdf_page.h" 12 #include "core/fpdfapi/page/cpdf_page.h"
13 #include "core/fpdfapi/parser/cpdf_document.h" 13 #include "core/fpdfapi/parser/cpdf_document.h"
14 #include "core/fpdfdoc/cpdf_occontext.h" 14 #include "core/fpdfdoc/cpdf_occontext.h"
15 #include "core/fxcrt/cfx_observable.h" 15 #include "core/fxcrt/cfx_observable.h"
16 #include "fpdfsdk/cfx_systemhandler.h" 16 #include "fpdfsdk/cfx_systemhandler.h"
17 #include "fpdfsdk/cpdfsdk_document.h"
17 #include "fpdfsdk/fsdk_define.h" 18 #include "fpdfsdk/fsdk_define.h"
18 #include "public/fpdf_formfill.h" 19 #include "public/fpdf_formfill.h"
19 #include "public/fpdf_fwlevent.h" 20 #include "public/fpdf_fwlevent.h"
20 21
22 #ifdef PDF_ENABLE_XFA
23 #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h"
24 #endif // PDF_ENABLE_XFA
25
21 class CFFL_InteractiveFormFiller; 26 class CFFL_InteractiveFormFiller;
22 class CFX_SystemHandler; 27 class CFX_SystemHandler;
23 class CPDFSDK_ActionHandler; 28 class CPDFSDK_ActionHandler;
24 class CPDFSDK_AnnotHandlerMgr; 29 class CPDFSDK_AnnotHandlerMgr;
25 class CPDFSDK_Document; 30 class CPDFSDK_Document;
31 class CPDFSDK_InterForm;
26 class IJS_Runtime; 32 class IJS_Runtime;
27 33
28 class CPDFSDK_FormFillEnvironment final { 34 class CPDFSDK_FormFillEnvironment final {
29 public: 35 public:
30 CPDFSDK_FormFillEnvironment(UnderlyingDocumentType* pDoc, 36 CPDFSDK_FormFillEnvironment(UnderlyingDocumentType* pDoc,
31 FPDF_FORMFILLINFO* pFFinfo); 37 FPDF_FORMFILLINFO* pFFinfo);
32 ~CPDFSDK_FormFillEnvironment(); 38 ~CPDFSDK_FormFillEnvironment();
33 39
34 void Invalidate(FPDF_PAGE page, 40 void Invalidate(FPDF_PAGE page,
35 double left, 41 double left,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 int nEnd, 147 int nEnd,
142 FPDF_BOOL bSilent, 148 FPDF_BOOL bSilent,
143 FPDF_BOOL bShrinkToFit, 149 FPDF_BOOL bShrinkToFit,
144 FPDF_BOOL bPrintAsImage, 150 FPDF_BOOL bPrintAsImage,
145 FPDF_BOOL bReverse, 151 FPDF_BOOL bReverse,
146 FPDF_BOOL bAnnotations); 152 FPDF_BOOL bAnnotations);
147 void JS_docgotoPage(int nPageNum); 153 void JS_docgotoPage(int nPageNum);
148 154
149 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } 155 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; }
150 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc.get(); } 156 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc.get(); }
157 #ifdef PDF_ENABLE_XFA
158 CPDFXFA_Document* GetXFADocument() const {
159 return m_pSDKDoc->GetXFADocument();
160 }
161 #endif // PDF_ENABLE_XFA
162
151 UnderlyingDocumentType* GetUnderlyingDocument() const { 163 UnderlyingDocumentType* GetUnderlyingDocument() const {
152 return m_pUnderlyingDoc; 164 return m_pUnderlyingDoc;
153 } 165 }
154 CFX_ByteString GetAppName() const { return ""; } 166 CFX_ByteString GetAppName() const { return ""; }
155 CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } 167 CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); }
156 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } 168 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; }
157 169
170 CPDFSDK_InterForm* GetInterForm() const;
171
158 // Creates if not present. 172 // Creates if not present.
159 CFFL_InteractiveFormFiller* GetInteractiveFormFiller(); 173 CFFL_InteractiveFormFiller* GetInteractiveFormFiller();
160 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. 174 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present.
161 IJS_Runtime* GetJSRuntime(); // Creates if not present. 175 IJS_Runtime* GetJSRuntime(); // Creates if not present.
162 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. 176 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present.
163 177
164 private: 178 private:
165 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; 179 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr;
166 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; 180 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler;
167 std::unique_ptr<IJS_Runtime> m_pJSRuntime; 181 std::unique_ptr<IJS_Runtime> m_pJSRuntime;
168 FPDF_FORMFILLINFO* const m_pInfo; 182 FPDF_FORMFILLINFO* const m_pInfo;
169 std::unique_ptr<CPDFSDK_Document> m_pSDKDoc; 183 std::unique_ptr<CPDFSDK_Document> m_pSDKDoc;
170 UnderlyingDocumentType* const m_pUnderlyingDoc; 184 UnderlyingDocumentType* const m_pUnderlyingDoc;
171 std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller; 185 std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller;
172 std::unique_ptr<CFX_SystemHandler> m_pSysHandler; 186 std::unique_ptr<CFX_SystemHandler> m_pSysHandler;
173 }; 187 };
174 188
175 #endif // FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_ 189 #endif // FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_document.h ('k') | fpdfsdk/cpdfsdk_formfillenvironment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698