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 | 11 |
12 #include "../../core/include/fpdftext/fpdf_text.h" | 12 #include "../../core/include/fpdftext/fpdf_text.h" |
13 #include "../../public/fpdf_formfill.h" | 13 #include "../../public/fpdf_formfill.h" |
14 #include "../../public/fpdf_fwlevent.h" // cross platform keycode and events de
fine. | 14 #include "../../public/fpdf_fwlevent.h" // cross platform keycode and events de
fine. |
| 15 #include "../../third_party/base/nonstd_unique_ptr.h" |
15 #include "fsdk_common.h" | 16 #include "fsdk_common.h" |
16 #include "fsdk_define.h" | 17 #include "fsdk_define.h" |
17 #include "fx_systemhandler.h" | 18 #include "fx_systemhandler.h" |
18 #include "fsdk_baseannot.h" | 19 #include "fsdk_baseannot.h" |
19 #include "fsdk_baseform.h" | 20 #include "fsdk_baseform.h" |
20 #include "fsdk_annothandler.h" | 21 #include "fsdk_annothandler.h" |
21 #include "fsdk_actionhandler.h" | 22 #include "fsdk_actionhandler.h" |
22 #include "javascript/IJavaScript.h" | 23 #include "javascript/IJavaScript.h" |
23 | 24 |
24 class CFFL_IFormFiller; | 25 class CFFL_IFormFiller; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 301 } |
301 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) { | 302 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) { |
302 return m_pSDKDoc->KillFocusAnnot(nFlag); | 303 return m_pSDKDoc->KillFocusAnnot(nFlag); |
303 } | 304 } |
304 FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot); | 305 FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot); |
305 | 306 |
306 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary* pDict); | 307 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary* pDict); |
307 CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType, CPDF_Dictionary* pDict); | 308 CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType, CPDF_Dictionary* pDict); |
308 CPDFSDK_Annot* AddAnnot(CPDF_Annot* pPDFAnnot); | 309 CPDFSDK_Annot* AddAnnot(CPDF_Annot* pPDFAnnot); |
309 FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); | 310 FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); |
310 int CountAnnots(); | 311 int CountAnnots() const; |
311 CPDFSDK_Annot* GetAnnot(int nIndex); | 312 CPDFSDK_Annot* GetAnnot(size_t nIndex); |
312 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary* pDict); | 313 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary* pDict); |
313 CPDF_Page* GetPDFPage() { return m_page; } | 314 CPDF_Page* GetPDFPage() { return m_page; } |
314 CPDF_Document* GetPDFDocument(); | 315 CPDF_Document* GetPDFDocument(); |
315 CPDFSDK_Document* GetSDKDocument() { return m_pSDKDoc; } | 316 CPDFSDK_Document* GetSDKDocument() { return m_pSDKDoc; } |
316 FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_UINT nFlag); | 317 FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_UINT nFlag); |
317 FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag); | 318 FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag); |
318 FX_BOOL OnChar(int nChar, FX_UINT nFlag); | 319 FX_BOOL OnChar(int nChar, FX_UINT nFlag); |
319 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); | 320 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); |
320 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); | 321 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); |
321 | 322 |
322 FX_BOOL OnMouseMove(const CPDF_Point& point, int nFlag); | 323 FX_BOOL OnMouseMove(const CPDF_Point& point, int nFlag); |
323 FX_BOOL OnMouseWheel(double deltaX, | 324 FX_BOOL OnMouseWheel(double deltaX, |
324 double deltaY, | 325 double deltaY, |
325 const CPDF_Point& point, | 326 const CPDF_Point& point, |
326 int nFlag); | 327 int nFlag); |
327 FX_BOOL IsValidAnnot(void* p); | 328 FX_BOOL IsValidAnnot(CPDF_Annot* p) const; |
328 void GetCurrentMatrix(CPDF_Matrix& matrix) { matrix = m_curMatrix; } | 329 void GetCurrentMatrix(CPDF_Matrix& matrix) { matrix = m_curMatrix; } |
329 void UpdateRects(CFX_RectArray& rects); | 330 void UpdateRects(CFX_RectArray& rects); |
330 void UpdateView(CPDFSDK_Annot* pAnnot); | 331 void UpdateView(CPDFSDK_Annot* pAnnot); |
331 CFX_PtrArray* GetAnnotList() { return &m_fxAnnotArray; } | 332 const std::vector<CPDFSDK_Annot*>& GetAnnotList() const { |
| 333 return m_fxAnnotArray; |
| 334 } |
332 | 335 |
333 int GetPageIndex(); | 336 int GetPageIndex(); |
334 void LoadFXAnnots(); | 337 void LoadFXAnnots(); |
335 void SetValid(FX_BOOL bValid) { m_bValid = bValid; } | 338 void SetValid(FX_BOOL bValid) { m_bValid = bValid; } |
336 FX_BOOL IsValid() { return m_bValid; } | 339 FX_BOOL IsValid() { return m_bValid; } |
337 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } | 340 void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; } |
338 FX_BOOL IsLocked() { return m_bLocked; } | 341 FX_BOOL IsLocked() { return m_bLocked; } |
339 void TakeOverPage() { m_bTakeOverPage = TRUE; } | 342 void TakeOverPage() { m_bTakeOverPage = TRUE; } |
340 | 343 |
341 private: | 344 private: |
342 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, | 345 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, |
343 CPDFSDK_Widget* pWidget); | 346 CPDFSDK_Widget* pWidget); |
| 347 |
344 CPDF_Matrix m_curMatrix; | 348 CPDF_Matrix m_curMatrix; |
345 CPDF_Page* m_page; | 349 CPDF_Page* m_page; |
346 CPDF_AnnotList* m_pAnnotList; | 350 nonstd::unique_ptr<CPDF_AnnotList> m_pAnnotList; |
347 // CPDFSDK_Annot* m_pFocusAnnot; | 351 std::vector<CPDFSDK_Annot*> m_fxAnnotArray; |
348 CFX_PtrArray m_fxAnnotArray; | |
349 CPDFSDK_Document* m_pSDKDoc; | 352 CPDFSDK_Document* m_pSDKDoc; |
350 CPDFSDK_Widget* m_CaptureWidget; | 353 CPDFSDK_Widget* m_CaptureWidget; |
351 FX_BOOL m_bEnterWidget; | 354 FX_BOOL m_bEnterWidget; |
352 FX_BOOL m_bExitWidget; | 355 FX_BOOL m_bExitWidget; |
353 FX_BOOL m_bOnWidget; | 356 FX_BOOL m_bOnWidget; |
354 FX_BOOL m_bValid; | 357 FX_BOOL m_bValid; |
355 FX_BOOL m_bLocked; | 358 FX_BOOL m_bLocked; |
356 FX_BOOL m_bTakeOverPage; | 359 FX_BOOL m_bTakeOverPage; |
357 }; | 360 }; |
358 | 361 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 426 } |
424 | 427 |
425 if (nStartPos < m) | 428 if (nStartPos < m) |
426 QuickSort(nStartPos, m, bAscend, pCompare); | 429 QuickSort(nStartPos, m, bAscend, pCompare); |
427 if (nStopPos > m) | 430 if (nStopPos > m) |
428 QuickSort(m, nStopPos, bAscend, pCompare); | 431 QuickSort(m, nStopPos, bAscend, pCompare); |
429 } | 432 } |
430 }; | 433 }; |
431 | 434 |
432 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ | 435 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ |
OLD | NEW |