Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ | |
| 8 #define FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 | |
| 13 #include "core/fxcrt/include/fx_basic.h" | |
| 14 #include "core/fxcrt/include/fx_coordinates.h" | |
| 15 | |
| 16 class CFX_Matrix; | |
| 17 class CFX_RenderDevice; | |
| 18 class CPDF_Annot; | |
| 19 class CPDFDoc_Environment; | |
| 20 class CPDFSDK_Annot; | |
| 21 class CPDFSDK_PageView; | |
| 22 class IPDFSDK_AnnotHandler; | |
| 23 | |
| 24 #ifdef PDF_ENABLE_XFA | |
| 25 class CXFA_FFWidget; | |
| 26 #endif // PDF_ENABLE_XFA | |
| 27 | |
| 28 class CPDFSDK_AnnotHandlerMgr { | |
| 29 public: | |
| 30 // Destroy the handler | |
|
dsinclair
2016/08/12 03:02:50
Remove comment
jaepark
2016/08/12 18:09:35
Done.
| |
| 31 explicit CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp); | |
| 32 virtual ~CPDFSDK_AnnotHandlerMgr(); | |
| 33 | |
| 34 void RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler); | |
| 35 void UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler); | |
| 36 | |
| 37 virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, | |
| 38 CPDFSDK_PageView* pPageView); | |
| 39 #ifdef PDF_ENABLE_XFA | |
| 40 virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, | |
| 41 CPDFSDK_PageView* pPageView); | |
| 42 #endif // PDF_ENABLE_XFA | |
| 43 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot); | |
| 44 | |
| 45 virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); | |
| 46 virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); | |
| 47 | |
| 48 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; | |
| 49 virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, | |
| 50 CPDFSDK_Annot* pAnnot, | |
| 51 CFX_RenderDevice* pDevice, | |
| 52 CFX_Matrix* pUser2Device, | |
| 53 uint32_t dwFlags); | |
| 54 | |
| 55 virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, | |
| 56 CPDFSDK_Annot* pAnnot, | |
| 57 uint32_t nFlags); | |
| 58 virtual void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, | |
| 59 CPDFSDK_Annot* pAnnot, | |
| 60 uint32_t nFlags); | |
| 61 virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, | |
| 62 CPDFSDK_Annot* pAnnot, | |
| 63 uint32_t nFlags, | |
| 64 const CFX_FloatPoint& point); | |
| 65 virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, | |
| 66 CPDFSDK_Annot* pAnnot, | |
| 67 uint32_t nFlags, | |
| 68 const CFX_FloatPoint& point); | |
| 69 virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 70 CPDFSDK_Annot* pAnnot, | |
| 71 uint32_t nFlags, | |
| 72 const CFX_FloatPoint& point); | |
| 73 virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 74 CPDFSDK_Annot* pAnnot, | |
| 75 uint32_t nFlags, | |
| 76 const CFX_FloatPoint& point); | |
| 77 virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 78 CPDFSDK_Annot* pAnnot, | |
| 79 uint32_t nFlags, | |
| 80 short zDelta, | |
| 81 const CFX_FloatPoint& point); | |
| 82 virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, | |
| 83 CPDFSDK_Annot* pAnnot, | |
| 84 uint32_t nFlags, | |
| 85 const CFX_FloatPoint& point); | |
| 86 virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, | |
| 87 CPDFSDK_Annot* pAnnot, | |
| 88 uint32_t nFlags, | |
| 89 const CFX_FloatPoint& point); | |
| 90 virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, | |
| 91 uint32_t nChar, | |
| 92 uint32_t nFlags); | |
| 93 virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, | |
| 94 int nKeyCode, | |
| 95 int nFlag); | |
| 96 virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); | |
| 97 | |
| 98 virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | |
| 99 virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | |
| 100 | |
| 101 #ifdef PDF_ENABLE_XFA | |
| 102 virtual FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot* pSetAnnot, | |
| 103 CPDFSDK_Annot* pKillAnnot); | |
| 104 #endif // PDF_ENABLE_XFA | |
| 105 | |
| 106 virtual CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, | |
| 107 CPDFSDK_Annot* pAnnot); | |
| 108 virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, | |
| 109 CPDFSDK_Annot* pAnnot, | |
| 110 const CFX_FloatPoint& point); | |
| 111 | |
| 112 private: | |
| 113 IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const; | |
| 114 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, FX_BOOL bNext); | |
| 115 | |
| 116 std::map<CFX_ByteString, std::unique_ptr<IPDFSDK_AnnotHandler>> | |
| 117 m_mapType2Handler; | |
| 118 CPDFDoc_Environment* m_pApp; | |
| 119 }; | |
| 120 | |
| 121 #endif // FPDFSDK_INCLUDE_CPDFSDK_ANNOTHANDLERMGR_H_ | |
| OLD | NEW |