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_ANNOTHANDLER_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "core/include/fxcrt/fx_basic.h" | 13 #include "core/include/fxcrt/fx_basic.h" |
14 | 14 |
15 class CFFL_IFormFiller; | 15 class CFFL_IFormFiller; |
16 class CFX_RenderDevice; | 16 class CFX_RenderDevice; |
17 class CPDFDoc_Environment; | 17 class CPDFDoc_Environment; |
18 class CPDFSDK_Annot; | 18 class CPDFSDK_Annot; |
19 class CPDFSDK_PageView; | 19 class CPDFSDK_PageView; |
20 class CPDF_Annot; | 20 class CPDF_Annot; |
21 class CPDF_Matrix; | 21 class CFX_Matrix; |
22 class CPDF_Point; | 22 class CPDF_Point; |
23 class CPDF_Rect; | 23 class CPDF_Rect; |
24 | 24 |
25 class IPDFSDK_AnnotHandler { | 25 class IPDFSDK_AnnotHandler { |
26 public: | 26 public: |
27 virtual ~IPDFSDK_AnnotHandler() {} | 27 virtual ~IPDFSDK_AnnotHandler() {} |
28 | 28 |
29 virtual CFX_ByteString GetType() = 0; | 29 virtual CFX_ByteString GetType() = 0; |
30 | 30 |
31 virtual CFX_ByteString GetName() = 0; | 31 virtual CFX_ByteString GetName() = 0; |
(...skipping 10 matching lines...) Expand all Loading... |
42 virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, | 42 virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, |
43 CPDFSDK_Annot* pAnnot) = 0; | 43 CPDFSDK_Annot* pAnnot) = 0; |
44 | 44 |
45 virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | 45 virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, |
46 CPDFSDK_Annot* pAnnot, | 46 CPDFSDK_Annot* pAnnot, |
47 const CPDF_Point& point) = 0; | 47 const CPDF_Point& point) = 0; |
48 | 48 |
49 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 49 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
50 CPDFSDK_Annot* pAnnot, | 50 CPDFSDK_Annot* pAnnot, |
51 CFX_RenderDevice* pDevice, | 51 CFX_RenderDevice* pDevice, |
52 CPDF_Matrix* pUser2Device, | 52 CFX_Matrix* pUser2Device, |
53 FX_DWORD dwFlags) = 0; | 53 FX_DWORD dwFlags) = 0; |
54 | 54 |
55 virtual void OnDrawSleep(CPDFSDK_PageView* pPageView, | 55 virtual void OnDrawSleep(CPDFSDK_PageView* pPageView, |
56 CPDFSDK_Annot* pAnnot, | 56 CPDFSDK_Annot* pAnnot, |
57 CFX_RenderDevice* pDevice, | 57 CFX_RenderDevice* pDevice, |
58 CPDF_Matrix* pUser2Device, | 58 CFX_Matrix* pUser2Device, |
59 const CPDF_Rect& rcWindow, | 59 const CPDF_Rect& rcWindow, |
60 FX_DWORD dwFlags) = 0; | 60 FX_DWORD dwFlags) = 0; |
61 | 61 |
62 virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; | 62 virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; |
63 | 63 |
64 virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; | 64 virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; |
65 | 65 |
66 virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; | 66 virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; |
67 | 67 |
68 virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0; | 68 virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; | 135 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; |
136 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override {} | 136 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override {} |
137 CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, | 137 CPDF_Rect GetViewBBox(CPDFSDK_PageView* pPageView, |
138 CPDFSDK_Annot* pAnnot) override; | 138 CPDFSDK_Annot* pAnnot) override; |
139 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | 139 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, |
140 CPDFSDK_Annot* pAnnot, | 140 CPDFSDK_Annot* pAnnot, |
141 const CPDF_Point& point) override; | 141 const CPDF_Point& point) override; |
142 void OnDraw(CPDFSDK_PageView* pPageView, | 142 void OnDraw(CPDFSDK_PageView* pPageView, |
143 CPDFSDK_Annot* pAnnot, | 143 CPDFSDK_Annot* pAnnot, |
144 CFX_RenderDevice* pDevice, | 144 CFX_RenderDevice* pDevice, |
145 CPDF_Matrix* pUser2Device, | 145 CFX_Matrix* pUser2Device, |
146 FX_DWORD dwFlags) override; | 146 FX_DWORD dwFlags) override; |
147 void OnDrawSleep(CPDFSDK_PageView* pPageView, | 147 void OnDrawSleep(CPDFSDK_PageView* pPageView, |
148 CPDFSDK_Annot* pAnnot, | 148 CPDFSDK_Annot* pAnnot, |
149 CFX_RenderDevice* pDevice, | 149 CFX_RenderDevice* pDevice, |
150 CPDF_Matrix* pUser2Device, | 150 CFX_Matrix* pUser2Device, |
151 const CPDF_Rect& rcWindow, | 151 const CPDF_Rect& rcWindow, |
152 FX_DWORD dwFlags) override {} | 152 FX_DWORD dwFlags) override {} |
153 void OnCreate(CPDFSDK_Annot* pAnnot) override; | 153 void OnCreate(CPDFSDK_Annot* pAnnot) override; |
154 void OnLoad(CPDFSDK_Annot* pAnnot) override; | 154 void OnLoad(CPDFSDK_Annot* pAnnot) override; |
155 void OnDelete(CPDFSDK_Annot* pAnnot) override {} | 155 void OnDelete(CPDFSDK_Annot* pAnnot) override {} |
156 void OnRelease(CPDFSDK_Annot* pAnnot) override {} | 156 void OnRelease(CPDFSDK_Annot* pAnnot) override {} |
157 void OnMouseEnter(CPDFSDK_PageView* pPageView, | 157 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
158 CPDFSDK_Annot* pAnnot, | 158 CPDFSDK_Annot* pAnnot, |
159 FX_DWORD nFlag) override; | 159 FX_DWORD nFlag) override; |
160 void OnMouseExit(CPDFSDK_PageView* pPageView, | 160 void OnMouseExit(CPDFSDK_PageView* pPageView, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot); | 229 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot); |
230 | 230 |
231 virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); | 231 virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); |
232 virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); | 232 virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); |
233 | 233 |
234 public: | 234 public: |
235 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; | 235 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; |
236 virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, | 236 virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, |
237 CPDFSDK_Annot* pAnnot, | 237 CPDFSDK_Annot* pAnnot, |
238 CFX_RenderDevice* pDevice, | 238 CFX_RenderDevice* pDevice, |
239 CPDF_Matrix* pUser2Device, | 239 CFX_Matrix* pUser2Device, |
240 FX_DWORD dwFlags); | 240 FX_DWORD dwFlags); |
241 | 241 |
242 virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, | 242 virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, |
243 CPDFSDK_Annot* pAnnot, | 243 CPDFSDK_Annot* pAnnot, |
244 FX_DWORD nFlags); | 244 FX_DWORD nFlags); |
245 virtual void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, | 245 virtual void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, |
246 CPDFSDK_Annot* pAnnot, | 246 CPDFSDK_Annot* pAnnot, |
247 FX_DWORD nFlags); | 247 FX_DWORD nFlags); |
248 | 248 |
249 virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, | 249 virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 private: | 314 private: |
315 CPDFSDK_Annot* NextAnnot(); | 315 CPDFSDK_Annot* NextAnnot(); |
316 CPDFSDK_Annot* PrevAnnot(); | 316 CPDFSDK_Annot* PrevAnnot(); |
317 | 317 |
318 std::vector<CPDFSDK_Annot*> m_iteratorAnnotList; | 318 std::vector<CPDFSDK_Annot*> m_iteratorAnnotList; |
319 const bool m_bReverse; | 319 const bool m_bReverse; |
320 size_t m_pos; | 320 size_t m_pos; |
321 }; | 321 }; |
322 | 322 |
323 #endif // FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ | 323 #endif // FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ |
OLD | NEW |