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> |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 CPDFDoc_Environment* m_pEnv; | 288 CPDFDoc_Environment* m_pEnv; |
289 nonstd::unique_ptr<CPDF_OCContext> m_pOccontent; | 289 nonstd::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 CPDF_Matrix* pUser2Device, | 298 CFX_Matrix* pUser2Device, |
299 CPDF_RenderOptions* pOptions); | 299 CPDF_RenderOptions* pOptions); |
300 const CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 300 const CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
301 CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 301 CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
302 const CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 302 const CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
303 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); | 303 CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY); |
304 CPDFSDK_Annot* GetFocusAnnot(); | 304 CPDFSDK_Annot* GetFocusAnnot(); |
305 void SetFocusAnnot(CPDFSDK_Annot* pSDKAnnot, FX_UINT nFlag = 0) { | 305 void SetFocusAnnot(CPDFSDK_Annot* pSDKAnnot, FX_UINT nFlag = 0) { |
306 m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag); | 306 m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag); |
307 } | 307 } |
308 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) { | 308 FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) { |
(...skipping 17 matching lines...) Expand all Loading... |
326 FX_BOOL OnChar(int nChar, FX_UINT nFlag); | 326 FX_BOOL OnChar(int nChar, FX_UINT nFlag); |
327 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); | 327 FX_BOOL OnKeyDown(int nKeyCode, int nFlag); |
328 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); | 328 FX_BOOL OnKeyUp(int nKeyCode, int nFlag); |
329 | 329 |
330 FX_BOOL OnMouseMove(const CPDF_Point& point, int nFlag); | 330 FX_BOOL OnMouseMove(const CPDF_Point& point, int nFlag); |
331 FX_BOOL OnMouseWheel(double deltaX, | 331 FX_BOOL OnMouseWheel(double deltaX, |
332 double deltaY, | 332 double deltaY, |
333 const CPDF_Point& point, | 333 const CPDF_Point& point, |
334 int nFlag); | 334 int nFlag); |
335 bool IsValidAnnot(const CPDF_Annot* p) const; | 335 bool IsValidAnnot(const CPDF_Annot* p) const; |
336 void GetCurrentMatrix(CPDF_Matrix& matrix) { matrix = m_curMatrix; } | 336 void GetCurrentMatrix(CFX_Matrix& matrix) { matrix = m_curMatrix; } |
337 void UpdateRects(CFX_RectArray& rects); | 337 void UpdateRects(CFX_RectArray& rects); |
338 void UpdateView(CPDFSDK_Annot* pAnnot); | 338 void UpdateView(CPDFSDK_Annot* pAnnot); |
339 const std::vector<CPDFSDK_Annot*>& GetAnnotList() const { | 339 const std::vector<CPDFSDK_Annot*>& GetAnnotList() const { |
340 return m_fxAnnotArray; | 340 return m_fxAnnotArray; |
341 } | 341 } |
342 | 342 |
343 int GetPageIndex(); | 343 int GetPageIndex(); |
344 void LoadFXAnnots(); | 344 void LoadFXAnnots(); |
345 void SetValid(FX_BOOL bValid) { m_bValid = bValid; } | 345 void SetValid(FX_BOOL bValid) { m_bValid = bValid; } |
346 FX_BOOL IsValid() { return m_bValid; } | 346 FX_BOOL IsValid() { return m_bValid; } |
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 CPDF_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 nonstd::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; |
(...skipping 67 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 |