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_FSDK_MGR_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 | 12 |
12 #include "core/include/fpdftext/fpdf_text.h" | 13 #include "core/include/fpdftext/fpdf_text.h" |
13 #include "fsdk_actionhandler.h" | 14 #include "fsdk_actionhandler.h" |
14 #include "fsdk_annothandler.h" | 15 #include "fsdk_annothandler.h" |
15 #include "fsdk_baseannot.h" | 16 #include "fsdk_baseannot.h" |
16 #include "fsdk_baseform.h" | 17 #include "fsdk_baseform.h" |
17 #include "fsdk_common.h" | 18 #include "fsdk_common.h" |
18 #include "fsdk_define.h" | 19 #include "fsdk_define.h" |
19 #include "fx_systemhandler.h" | 20 #include "fx_systemhandler.h" |
20 #include "javascript/IJavaScript.h" | 21 #include "javascript/IJavaScript.h" |
21 #include "public/fpdf_formfill.h" | 22 #include "public/fpdf_formfill.h" |
22 #include "public/fpdf_fwlevent.h" // cross platform keycode and events define. | 23 #include "public/fpdf_fwlevent.h" // cross platform keycode and events define. |
23 #include "third_party/base/nonstd_unique_ptr.h" | |
24 | 24 |
25 class CFFL_IFormFiller; | 25 class CFFL_IFormFiller; |
26 class CPDFSDK_ActionHandler; | 26 class CPDFSDK_ActionHandler; |
27 class CPDFSDK_Annot; | 27 class CPDFSDK_Annot; |
28 class CPDFSDK_Document; | 28 class CPDFSDK_Document; |
29 class CPDFSDK_InterForm; | 29 class CPDFSDK_InterForm; |
30 class CPDFSDK_PageView; | 30 class CPDFSDK_PageView; |
31 class CPDFSDK_Widget; | 31 class CPDFSDK_Widget; |
32 class IFX_SystemHandler; | 32 class IFX_SystemHandler; |
33 | 33 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 CFX_ByteString GetAppName() const { return ""; } | 209 CFX_ByteString GetAppName() const { return ""; } |
210 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } | 210 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } |
211 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } | 211 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } |
212 | 212 |
213 CFFL_IFormFiller* GetIFormFiller(); // Creates if not present. | 213 CFFL_IFormFiller* GetIFormFiller(); // Creates if not present. |
214 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. | 214 CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present. |
215 IJS_Runtime* GetJSRuntime(); // Creates if not present. | 215 IJS_Runtime* GetJSRuntime(); // Creates if not present. |
216 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. | 216 CPDFSDK_ActionHandler* GetActionHander(); // Creates if not present. |
217 | 217 |
218 private: | 218 private: |
219 nonstd::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; | 219 std::unique_ptr<CPDFSDK_AnnotHandlerMgr> m_pAnnotHandlerMgr; |
220 nonstd::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; | 220 std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler; |
221 nonstd::unique_ptr<IJS_Runtime> m_pJSRuntime; | 221 std::unique_ptr<IJS_Runtime> m_pJSRuntime; |
222 FPDF_FORMFILLINFO* const m_pInfo; | 222 FPDF_FORMFILLINFO* const m_pInfo; |
223 CPDFSDK_Document* m_pSDKDoc; | 223 CPDFSDK_Document* m_pSDKDoc; |
224 UnderlyingDocumentType* const m_pUnderlyingDoc; | 224 UnderlyingDocumentType* const m_pUnderlyingDoc; |
225 nonstd::unique_ptr<CFFL_IFormFiller> m_pIFormFiller; | 225 std::unique_ptr<CFFL_IFormFiller> m_pIFormFiller; |
226 nonstd::unique_ptr<IFX_SystemHandler> m_pSysHandler; | 226 std::unique_ptr<IFX_SystemHandler> m_pSysHandler; |
227 }; | 227 }; |
228 | 228 |
229 class CPDFSDK_Document { | 229 class CPDFSDK_Document { |
230 public: | 230 public: |
231 CPDFSDK_Document(UnderlyingDocumentType* pDoc, CPDFDoc_Environment* pEnv); | 231 CPDFSDK_Document(UnderlyingDocumentType* pDoc, CPDFDoc_Environment* pEnv); |
232 ~CPDFSDK_Document(); | 232 ~CPDFSDK_Document(); |
233 | 233 |
234 CPDFSDK_InterForm* GetInterForm(); | 234 CPDFSDK_InterForm* GetInterForm(); |
235 | 235 |
236 // Gets the document object for the next layer down; for master this is | 236 // Gets the document object for the next layer down; for master this is |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 CFX_WideString GetPath(); | 276 CFX_WideString GetPath(); |
277 UnderlyingPageType* GetPage(int nIndex); | 277 UnderlyingPageType* GetPage(int nIndex); |
278 CPDFDoc_Environment* GetEnv() { return m_pEnv; } | 278 CPDFDoc_Environment* GetEnv() { return m_pEnv; } |
279 void ProcJavascriptFun(); | 279 void ProcJavascriptFun(); |
280 FX_BOOL ProcOpenAction(); | 280 FX_BOOL ProcOpenAction(); |
281 CPDF_OCContext* GetOCContext(); | 281 CPDF_OCContext* GetOCContext(); |
282 | 282 |
283 private: | 283 private: |
284 std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap; | 284 std::map<UnderlyingPageType*, CPDFSDK_PageView*> m_pageMap; |
285 UnderlyingDocumentType* m_pDoc; | 285 UnderlyingDocumentType* m_pDoc; |
286 nonstd::unique_ptr<CPDFSDK_InterForm> m_pInterForm; | 286 std::unique_ptr<CPDFSDK_InterForm> m_pInterForm; |
287 CPDFSDK_Annot* m_pFocusAnnot; | 287 CPDFSDK_Annot* m_pFocusAnnot; |
288 CPDFDoc_Environment* m_pEnv; | 288 CPDFDoc_Environment* m_pEnv; |
289 nonstd::unique_ptr<CPDF_OCContext> m_pOccontent; | 289 std::unique_ptr<CPDF_OCContext> m_pOccontent; |
290 FX_BOOL m_bChangeMask; | 290 FX_BOOL m_bChangeMask; |
291 FX_BOOL m_bBeingDestroyed; | 291 FX_BOOL m_bBeingDestroyed; |
292 }; | 292 }; |
293 class CPDFSDK_PageView final { | 293 class CPDFSDK_PageView final { |
294 public: | 294 public: |
295 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); | 295 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); |
296 ~CPDFSDK_PageView(); | 296 ~CPDFSDK_PageView(); |
297 void PageView_OnDraw(CFX_RenderDevice* pDevice, | 297 void PageView_OnDraw(CFX_RenderDevice* pDevice, |
298 CFX_Matrix* pUser2Device, | 298 CFX_Matrix* pUser2Device, |
299 CPDF_RenderOptions* pOptions); | 299 CPDF_RenderOptions* pOptions); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } | 347 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } |
348 FX_BOOL IsLocked() { return m_bLocked; } | 348 FX_BOOL IsLocked() { return m_bLocked; } |
349 void TakeOverPage() { m_bTakeOverPage = TRUE; } | 349 void TakeOverPage() { m_bTakeOverPage = TRUE; } |
350 | 350 |
351 private: | 351 private: |
352 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, | 352 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, |
353 CPDFSDK_Widget* pWidget); | 353 CPDFSDK_Widget* pWidget); |
354 | 354 |
355 CFX_Matrix m_curMatrix; | 355 CFX_Matrix m_curMatrix; |
356 UnderlyingPageType* m_page; | 356 UnderlyingPageType* m_page; |
357 nonstd::unique_ptr<CPDF_AnnotList> m_pAnnotList; | 357 std::unique_ptr<CPDF_AnnotList> m_pAnnotList; |
358 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; | 358 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; |
359 CPDFSDK_Document* m_pSDKDoc; | 359 CPDFSDK_Document* m_pSDKDoc; |
360 CPDFSDK_Widget* m_CaptureWidget; | 360 CPDFSDK_Widget* m_CaptureWidget; |
361 FX_BOOL m_bEnterWidget; | 361 FX_BOOL m_bEnterWidget; |
362 FX_BOOL m_bExitWidget; | 362 FX_BOOL m_bExitWidget; |
363 FX_BOOL m_bOnWidget; | 363 FX_BOOL m_bOnWidget; |
364 FX_BOOL m_bValid; | 364 FX_BOOL m_bValid; |
365 FX_BOOL m_bLocked; | 365 FX_BOOL m_bLocked; |
366 FX_BOOL m_bTakeOverPage; | 366 FX_BOOL m_bTakeOverPage; |
367 }; | 367 }; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 } | 433 } |
434 | 434 |
435 if (nStartPos < m) | 435 if (nStartPos < m) |
436 QuickSort(nStartPos, m, bAscend, pCompare); | 436 QuickSort(nStartPos, m, bAscend, pCompare); |
437 if (nStopPos > m) | 437 if (nStopPos > m) |
438 QuickSort(m, nStopPos, bAscend, pCompare); | 438 QuickSort(m, nStopPos, bAscend, pCompare); |
439 } | 439 } |
440 }; | 440 }; |
441 | 441 |
442 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ | 442 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ |
OLD | NEW |