| 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_MGR_H | 7 #ifndef _FPDFSDK_MGR_H |
| 8 #define _FPDFSDK_MGR_H | 8 #define _FPDFSDK_MGR_H |
| 9 | 9 |
| 10 #include "fsdk_common.h" | 10 #include "fsdk_common.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray; | 453 //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray; |
| 454 CFX_MapPtrTemplate<CPDF_Page*, CPDFSDK_PageView*> m_pageMap; | 454 CFX_MapPtrTemplate<CPDF_Page*, CPDFSDK_PageView*> m_pageMap; |
| 455 CPDF_Document* m_pDoc; | 455 CPDF_Document* m_pDoc; |
| 456 | 456 |
| 457 CPDFSDK_InterForm* m_pInterForm; | 457 CPDFSDK_InterForm* m_pInterForm; |
| 458 CPDFSDK_Annot* m_pFocusAnnot; | 458 CPDFSDK_Annot* m_pFocusAnnot; |
| 459 CPDFDoc_Environment * m_pEnv; | 459 CPDFDoc_Environment * m_pEnv; |
| 460 CPDF_OCContext * m_pOccontent; | 460 CPDF_OCContext * m_pOccontent; |
| 461 FX_BOOL m_bChangeMask; | 461 FX_BOOL m_bChangeMask; |
| 462 }; | 462 }; |
| 463 | |
| 464 class CPDFSDK_PageView FX_FINAL | 463 class CPDFSDK_PageView FX_FINAL |
| 465 { | 464 { |
| 466 public: | 465 public: |
| 467 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page); | 466 CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page); |
| 468 ~CPDFSDK_PageView(); | 467 ~CPDFSDK_PageView(); |
| 469 public: | |
| 470 void PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devic
e,CPDF_RenderOptions* pOptions) ; | 468 void PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devic
e,CPDF_RenderOptions* pOptions) ; |
| 471 public: | |
| 472 CPDF_Annot* GetPDFAnnotAtPoi
nt(FX_FLOAT pageX, FX_FLOAT pageY); | 469 CPDF_Annot* GetPDFAnnotAtPoi
nt(FX_FLOAT pageX, FX_FLOAT pageY); |
| 473 CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLO
AT pageX, FX_FLOAT pageY); | 470 CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLO
AT pageX, FX_FLOAT pageY); |
| 474 CPDF_Annot* GetPDFWidgetAtPo
int(FX_FLOAT pageX, FX_FLOAT pageY); | 471 CPDF_Annot* GetPDFWidgetAtPo
int(FX_FLOAT pageX, FX_FLOAT pageY); |
| 475 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FL
OAT pageX, FX_FLOAT pageY); | 472 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FL
OAT pageX, FX_FLOAT pageY); |
| 476 CPDFSDK_Annot* GetFocusAnnot() ; | 473 CPDFSDK_Annot* GetFocusAnnot() ; |
| 477 void SetFocusAnnot(CP
DFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, n
Flag);} | 474 void SetFocusAnnot(CP
DFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, n
Flag);} |
| 478 FX_BOOL KillFocusAnnot(F
X_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);} | 475 FX_BOOL KillFocusAnnot(F
X_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);} |
| 479 FX_BOOL Annot_HasAppeara
nce(CPDF_Annot* pAnnot); | 476 FX_BOOL Annot_HasAppeara
nce(CPDF_Annot* pAnnot); |
| 480 | 477 |
| 481 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary
* pDict); | 478 CPDFSDK_Annot* AddAnnot(CPDF_Dictionary
* pDict); |
| 482 CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSub
Type,CPDF_Dictionary * pDict); | 479 CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSub
Type,CPDF_Dictionary * pDict); |
| 483 CPDFSDK_Annot* AddAnnot(CPDF_Annot * pP
DFAnnot); | 480 CPDFSDK_Annot* AddAnnot(CPDF_Annot * pP
DFAnnot); |
| 484 FX_BOOL DeleteAnnot(CPDF
SDK_Annot* pAnnot); | 481 FX_BOOL DeleteAnnot(CPDF
SDK_Annot* pAnnot); |
| 485 | 482 |
| 486 int CountAnn
ots(); | 483 int CountAnn
ots(); |
| 487 CPDFSDK_Annot* GetAnnot(int nIndex); | 484 CPDFSDK_Annot* GetAnnot(int nIndex); |
| 488 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictiona
ry * pDict); | 485 CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictiona
ry * pDict); |
| 489 CPDF_Page* GetPDFPage(){ret
urn m_page;} | 486 CPDF_Page* GetPDFPage(){ret
urn m_page;} |
| 490 CPDF_Document* GetPDFDocument(); | 487 CPDF_Document* GetPDFDocument(); |
| 491 CPDFSDK_Document* GetSDKDocument() {return
m_pSDKDoc;} | 488 CPDFSDK_Document* GetSDKDocument() {return
m_pSDKDoc;} |
| 492 public: | |
| 493 FX_BOOL OnLButtonDown(const CPDF_Point &
point, FX_UINT nFlag); | 489 FX_BOOL OnLButtonDown(const CPDF_Point &
point, FX_UINT nFlag); |
| 494 FX_BOOL OnLButtonUp(const CPDF_Point & p
oint, FX_UINT nFlag); | 490 FX_BOOL OnLButtonUp(const CPDF_Point & p
oint, FX_UINT nFlag); |
| 495 FX_BOOL OnChar(int nChar, FX_UINT nFlag)
; | 491 FX_BOOL OnChar(int nChar, FX_UINT nFlag)
; |
| 496 FX_BOOL OnKeyDown(int nKeyCode, int nFla
g); | 492 FX_BOOL OnKeyDown(int nKeyCode, int nFla
g); |
| 497 FX_BOOL OnKeyUp(int nKeyCode, int nFlag)
; | 493 FX_BOOL OnKeyUp(int nKeyCode, int nFlag)
; |
| 498 | 494 |
| 499 FX_BOOL OnMouseMove(const CPDF_Point & p
oint, int nFlag); | 495 FX_BOOL OnMouseMove(const CPDF_Point & p
oint, int nFlag); |
| 500 FX_BOOL OnMouseWheel(double deltaX, doub
le deltaY,const CPDF_Point& point, int nFlag); | 496 FX_BOOL OnMouseWheel(double deltaX, doub
le deltaY,const CPDF_Point& point, int nFlag); |
| 501 FX_BOOL IsValidAnnot(FX_LPVOID p); | 497 FX_BOOL IsValidAnnot(FX_LPVOID p); |
| 502 public: | |
| 503 void GetCurrentMatrix(CPDF_Matrix& ma
trix) {matrix = m_curMatrix;} | 498 void GetCurrentMatrix(CPDF_Matrix& ma
trix) {matrix = m_curMatrix;} |
| 504 void UpdateRects(CFX_RectArray& rects
); | 499 void UpdateRects(CFX_RectArray& rects
); |
| 505 void UpdateView(CPDFS
DK_Annot* pAnnot); | 500 void UpdateView(CPDFS
DK_Annot* pAnnot); |
| 506 CFX_PtrArray* GetAnnotList(){ return &
m_fxAnnotArray; } | 501 CFX_PtrArray* GetAnnotList(){ return &
m_fxAnnotArray; } |
| 507 | 502 |
| 508 public: | |
| 509 int GetPageIndex(); | 503 int GetPageIndex(); |
| 510 void LoadFXAnnots(); | 504 void LoadFXAnnots(); |
| 511 private: | |
| 512 CPDF_Matrix m_curMatrix; | |
| 513 | 505 |
| 506 void SetValid(FX_BOOL bValid) {m_bValid = bValid;} |
| 507 FX_BOOL IsValid() {return m_bValid;} |
| 508 void SetLock(FX_BOOL bLocked) {m_bLocked= bLocked;} |
| 509 FX_BOOL IsLocked() {return m_bLocked;} |
| 510 void TakeOverPage() {m_bTakeOverPage = TRUE;} |
| 514 private: | 511 private: |
| 515 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, CPDFSDK_W
idget* pWidget); | 512 void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, CPDFSDK_W
idget* pWidget); |
| 516 | 513 CPDF_Matrix m_curMatrix; |
| 517 private: | |
| 518 CPDF_Page* m_page; | 514 CPDF_Page* m_page; |
| 519 CPDF_AnnotList* m_pAnnotList; | 515 CPDF_AnnotList* m_pAnnotList; |
| 520 | |
| 521 //CPDFSDK_Annot* m_pFocusAnnot; | 516 //CPDFSDK_Annot* m_pFocusAnnot; |
| 522 CFX_PtrArray m_fxAnnotArray; | 517 CFX_PtrArray m_fxAnnotArray; |
| 523 | |
| 524 CPDFSDK_Document* m_pSDKDoc; | 518 CPDFSDK_Document* m_pSDKDoc; |
| 525 private: | |
| 526 CPDFSDK_Widget* m_CaptureWidget; | 519 CPDFSDK_Widget* m_CaptureWidget; |
| 527 FX_BOOL m_bEnterWidget; | 520 FX_BOOL m_bEnterWidget; |
| 528 FX_BOOL m_bExitWidget; | 521 FX_BOOL m_bExitWidget; |
| 529 FX_BOOL m_bOnWidget; | 522 FX_BOOL m_bOnWidget; |
| 530 public: | |
| 531 void SetValid(FX_BOOL bValid) {m_bValid = bValid;} | |
| 532 FX_BOOL IsValid() {return m_bValid;} | |
| 533 private: | |
| 534 FX_BOOL m_bValid; | 523 FX_BOOL m_bValid; |
| 524 FX_BOOL m_bLocked; |
| 525 FX_BOOL m_bTakeOverPage; |
| 535 }; | 526 }; |
| 536 | 527 |
| 537 | 528 |
| 538 template<class TYPE> | 529 template<class TYPE> |
| 539 class CGW_ArrayTemplate : public CFX_ArrayTemplate<TYPE> | 530 class CGW_ArrayTemplate : public CFX_ArrayTemplate<TYPE> |
| 540 { | 531 { |
| 541 public: | 532 public: |
| 542 CGW_ArrayTemplate(){} | 533 CGW_ArrayTemplate(){} |
| 543 virtual ~CGW_ArrayTemplate(){} | 534 virtual ~CGW_ArrayTemplate(){} |
| 544 | 535 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 } | 602 } |
| 612 | 603 |
| 613 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); | 604 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); |
| 614 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); | 605 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); |
| 615 } | 606 } |
| 616 }; | 607 }; |
| 617 | 608 |
| 618 | 609 |
| 619 #endif //_FPDFSDK_MGR_H | 610 #endif //_FPDFSDK_MGR_H |
| 620 | 611 |
| OLD | NEW |