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

Side by Side Diff: fpdfsdk/cpdfsdk_environment.h

Issue 2397473006: Remove ownership of CPDFSDK_Document from CPDFXFA_Document (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.cpp ('k') | fpdfsdk/fpdfformfill.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_ENVIRONMENT_H_ 7 #ifndef FPDFSDK_CPDFSDK_ENVIRONMENT_H_
8 #define FPDFSDK_CPDFSDK_ENVIRONMENT_H_ 8 #define FPDFSDK_CPDFSDK_ENVIRONMENT_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 int nStart, 139 int nStart,
140 int nEnd, 140 int nEnd,
141 FPDF_BOOL bSilent, 141 FPDF_BOOL bSilent,
142 FPDF_BOOL bShrinkToFit, 142 FPDF_BOOL bShrinkToFit,
143 FPDF_BOOL bPrintAsImage, 143 FPDF_BOOL bPrintAsImage,
144 FPDF_BOOL bReverse, 144 FPDF_BOOL bReverse,
145 FPDF_BOOL bAnnotations); 145 FPDF_BOOL bAnnotations);
146 void JS_docgotoPage(int nPageNum); 146 void JS_docgotoPage(int nPageNum);
147 147
148 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } 148 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; }
149 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } 149 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc.get(); }
150 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; }
151 UnderlyingDocumentType* GetUnderlyingDocument() const { 150 UnderlyingDocumentType* GetUnderlyingDocument() const {
152 return m_pUnderlyingDoc; 151 return m_pUnderlyingDoc;
153 } 152 }
154 CFX_ByteString GetAppName() const { return ""; } 153 CFX_ByteString GetAppName() const { return ""; }
155 CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } 154 CFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); }
156 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } 155 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; }
157 156
158 // Creates if not present. 157 // Creates if not present.
159 CFFL_InteractiveFormFiller* GetInteractiveFormFiller(); 158 CFFL_InteractiveFormFiller* GetInteractiveFormFiller();
160 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. 159 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present.
161 IJS_Runtime* GetJSRuntime(); // Creates if not present. 160 IJS_Runtime* GetJSRuntime(); // Creates if not present.
162 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. 161 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present.
163 162
164 private: 163 private:
165 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; 164 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr;
166 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; 165 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler;
167 std::unique_ptr<IJS_Runtime> m_pJSRuntime; 166 std::unique_ptr<IJS_Runtime> m_pJSRuntime;
168 FPDF_FORMFILLINFO* const m_pInfo; 167 FPDF_FORMFILLINFO* const m_pInfo;
169 // Ownership of |m_pSDKDoc| depends on if this is XFA. If we're in XFA then 168 std::unique_ptr<CPDFSDK_Document> m_pSDKDoc;
170 // the object is owned by the CPDFXFA_Document. In non-xfa then we own
171 // the pointer.
172 CPDFSDK_Document* m_pSDKDoc;
173 UnderlyingDocumentType* const m_pUnderlyingDoc; 169 UnderlyingDocumentType* const m_pUnderlyingDoc;
174 std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller; 170 std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller;
175 std::unique_ptr<CFX_SystemHandler> m_pSysHandler; 171 std::unique_ptr<CFX_SystemHandler> m_pSysHandler;
176 }; 172 };
177 173
178 #endif // FPDFSDK_CPDFSDK_ENVIRONMENT_H_ 174 #endif // FPDFSDK_CPDFSDK_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_document.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698