| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_FSDK_ANNOTHANDLER_H_ | |
| 8 #define FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 #include <vector> | |
| 13 | |
| 14 #include "core/fxcrt/include/fx_basic.h" | |
| 15 #include "core/fxcrt/include/fx_coordinates.h" | |
| 16 | |
| 17 #ifdef PDF_ENABLE_XFA | |
| 18 #define FSDK_XFAWIDGET_TYPENAME "XFAWidget" | |
| 19 #endif // PDF_ENABLE_XFA | |
| 20 | |
| 21 class CFFL_IFormFiller; | |
| 22 class CFX_RenderDevice; | |
| 23 class CPDFDoc_Environment; | |
| 24 class CPDFSDK_Annot; | |
| 25 class CPDFSDK_PageView; | |
| 26 class CPDF_Annot; | |
| 27 class CFX_Matrix; | |
| 28 class CFX_FloatPoint; | |
| 29 #ifdef PDF_ENABLE_XFA | |
| 30 class CXFA_FFWidget; | |
| 31 class CXFA_FFWidgetHandler; | |
| 32 #endif // PDF_ENABLE_XFA | |
| 33 | |
| 34 class IPDFSDK_AnnotHandler { | |
| 35 public: | |
| 36 virtual ~IPDFSDK_AnnotHandler() {} | |
| 37 | |
| 38 virtual CFX_ByteString GetType() = 0; | |
| 39 virtual CFX_ByteString GetName() = 0; | |
| 40 virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0; | |
| 41 virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, | |
| 42 CPDFSDK_PageView* pPage) = 0; | |
| 43 | |
| 44 #ifdef PDF_ENABLE_XFA | |
| 45 virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, | |
| 46 CPDFSDK_PageView* pPage) = 0; | |
| 47 #endif // PDF_ENABLE_XFA | |
| 48 | |
| 49 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0; | |
| 50 virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0; | |
| 51 virtual CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, | |
| 52 CPDFSDK_Annot* pAnnot) = 0; | |
| 53 virtual FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | |
| 54 CPDFSDK_Annot* pAnnot, | |
| 55 const CFX_FloatPoint& point) = 0; | |
| 56 virtual void OnDraw(CPDFSDK_PageView* pPageView, | |
| 57 CPDFSDK_Annot* pAnnot, | |
| 58 CFX_RenderDevice* pDevice, | |
| 59 CFX_Matrix* pUser2Device, | |
| 60 uint32_t dwFlags) = 0; | |
| 61 virtual void OnDrawSleep(CPDFSDK_PageView* pPageView, | |
| 62 CPDFSDK_Annot* pAnnot, | |
| 63 CFX_RenderDevice* pDevice, | |
| 64 CFX_Matrix* pUser2Device, | |
| 65 const CFX_FloatRect& rcWindow, | |
| 66 uint32_t dwFlags) = 0; | |
| 67 | |
| 68 virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; | |
| 69 virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0; | |
| 70 virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; | |
| 71 virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0; | |
| 72 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, | |
| 73 CPDFSDK_Annot* pAnnot, | |
| 74 uint32_t nFlag) = 0; | |
| 75 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, | |
| 76 CPDFSDK_Annot* pAnnot, | |
| 77 uint32_t nFlag) = 0; | |
| 78 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | |
| 79 CPDFSDK_Annot* pAnnot, | |
| 80 uint32_t nFlags, | |
| 81 const CFX_FloatPoint& point) = 0; | |
| 82 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | |
| 83 CPDFSDK_Annot* pAnnot, | |
| 84 uint32_t nFlags, | |
| 85 const CFX_FloatPoint& point) = 0; | |
| 86 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 87 CPDFSDK_Annot* pAnnot, | |
| 88 uint32_t nFlags, | |
| 89 const CFX_FloatPoint& point) = 0; | |
| 90 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 91 CPDFSDK_Annot* pAnnot, | |
| 92 uint32_t nFlags, | |
| 93 const CFX_FloatPoint& point) = 0; | |
| 94 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 95 CPDFSDK_Annot* pAnnot, | |
| 96 uint32_t nFlags, | |
| 97 short zDelta, | |
| 98 const CFX_FloatPoint& point) = 0; | |
| 99 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | |
| 100 CPDFSDK_Annot* pAnnot, | |
| 101 uint32_t nFlags, | |
| 102 const CFX_FloatPoint& point) = 0; | |
| 103 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | |
| 104 CPDFSDK_Annot* pAnnot, | |
| 105 uint32_t nFlags, | |
| 106 const CFX_FloatPoint& point) = 0; | |
| 107 virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 108 CPDFSDK_Annot* pAnnot, | |
| 109 uint32_t nFlags, | |
| 110 const CFX_FloatPoint& point) = 0; | |
| 111 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | |
| 112 uint32_t nChar, | |
| 113 uint32_t nFlags) = 0; | |
| 114 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; | |
| 115 virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0; | |
| 116 virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0; | |
| 117 virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0; | |
| 118 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) = 0; | |
| 119 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) = 0; | |
| 120 #ifdef PDF_ENABLE_XFA | |
| 121 virtual FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, | |
| 122 CPDFSDK_Annot* pNewAnnot) = 0; | |
| 123 #endif // PDF_ENABLE_XFA | |
| 124 }; | |
| 125 | |
| 126 class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { | |
| 127 public: | |
| 128 explicit CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp); | |
| 129 ~CPDFSDK_BFAnnotHandler() override; | |
| 130 | |
| 131 // IPDFSDK_AnnotHandler | |
| 132 CFX_ByteString GetType() override; | |
| 133 CFX_ByteString GetName() override; | |
| 134 FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; | |
| 135 CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; | |
| 136 #ifdef PDF_ENABLE_XFA | |
| 137 CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* hWidget, | |
| 138 CPDFSDK_PageView* pPage) override; | |
| 139 #endif // PDF_ENABLE_XFA | |
| 140 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; | |
| 141 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; | |
| 142 CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, | |
| 143 CPDFSDK_Annot* pAnnot) override; | |
| 144 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | |
| 145 CPDFSDK_Annot* pAnnot, | |
| 146 const CFX_FloatPoint& point) override; | |
| 147 void OnDraw(CPDFSDK_PageView* pPageView, | |
| 148 CPDFSDK_Annot* pAnnot, | |
| 149 CFX_RenderDevice* pDevice, | |
| 150 CFX_Matrix* pUser2Device, | |
| 151 uint32_t dwFlags) override; | |
| 152 void OnDrawSleep(CPDFSDK_PageView* pPageView, | |
| 153 CPDFSDK_Annot* pAnnot, | |
| 154 CFX_RenderDevice* pDevice, | |
| 155 CFX_Matrix* pUser2Device, | |
| 156 const CFX_FloatRect& rcWindow, | |
| 157 uint32_t dwFlags) override; | |
| 158 void OnCreate(CPDFSDK_Annot* pAnnot) override; | |
| 159 void OnLoad(CPDFSDK_Annot* pAnnot) override; | |
| 160 void OnDelete(CPDFSDK_Annot* pAnnot) override; | |
| 161 void OnRelease(CPDFSDK_Annot* pAnnot) override; | |
| 162 void OnMouseEnter(CPDFSDK_PageView* pPageView, | |
| 163 CPDFSDK_Annot* pAnnot, | |
| 164 uint32_t nFlag) override; | |
| 165 void OnMouseExit(CPDFSDK_PageView* pPageView, | |
| 166 CPDFSDK_Annot* pAnnot, | |
| 167 uint32_t nFlag) override; | |
| 168 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | |
| 169 CPDFSDK_Annot* pAnnot, | |
| 170 uint32_t nFlags, | |
| 171 const CFX_FloatPoint& point) override; | |
| 172 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | |
| 173 CPDFSDK_Annot* pAnnot, | |
| 174 uint32_t nFlags, | |
| 175 const CFX_FloatPoint& point) override; | |
| 176 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 177 CPDFSDK_Annot* pAnnot, | |
| 178 uint32_t nFlags, | |
| 179 const CFX_FloatPoint& point) override; | |
| 180 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 181 CPDFSDK_Annot* pAnnot, | |
| 182 uint32_t nFlags, | |
| 183 const CFX_FloatPoint& point) override; | |
| 184 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 185 CPDFSDK_Annot* pAnnot, | |
| 186 uint32_t nFlags, | |
| 187 short zDelta, | |
| 188 const CFX_FloatPoint& point) override; | |
| 189 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | |
| 190 CPDFSDK_Annot* pAnnot, | |
| 191 uint32_t nFlags, | |
| 192 const CFX_FloatPoint& point) override; | |
| 193 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | |
| 194 CPDFSDK_Annot* pAnnot, | |
| 195 uint32_t nFlags, | |
| 196 const CFX_FloatPoint& point) override; | |
| 197 FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 198 CPDFSDK_Annot* pAnnot, | |
| 199 uint32_t nFlags, | |
| 200 const CFX_FloatPoint& point) override; | |
| 201 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | |
| 202 uint32_t nChar, | |
| 203 uint32_t nFlags) override; | |
| 204 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
| 205 FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
| 206 void OnDeSelected(CPDFSDK_Annot* pAnnot) override {} | |
| 207 void OnSelected(CPDFSDK_Annot* pAnnot) override {} | |
| 208 FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; | |
| 209 FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; | |
| 210 #ifdef PDF_ENABLE_XFA | |
| 211 FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, | |
| 212 CPDFSDK_Annot* pNewAnnot) override; | |
| 213 #endif // PDF_ENABLE_XFA | |
| 214 | |
| 215 void SetFormFiller(CFFL_IFormFiller* pFiller) { m_pFormFiller = pFiller; } | |
| 216 CFFL_IFormFiller* GetFormFiller() { return m_pFormFiller; } | |
| 217 | |
| 218 private: | |
| 219 CPDFDoc_Environment* m_pApp; | |
| 220 CFFL_IFormFiller* m_pFormFiller; | |
| 221 }; | |
| 222 | |
| 223 #ifdef PDF_ENABLE_XFA | |
| 224 class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler { | |
| 225 public: | |
| 226 explicit CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp); | |
| 227 ~CPDFSDK_XFAAnnotHandler() override; | |
| 228 | |
| 229 // IPDFSDK_AnnotHandler | |
| 230 CFX_ByteString GetType() override; | |
| 231 CFX_ByteString GetName() override; | |
| 232 FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) override; | |
| 233 CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) override; | |
| 234 CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, | |
| 235 CPDFSDK_PageView* pPage) override; | |
| 236 void ReleaseAnnot(CPDFSDK_Annot* pAnnot) override; | |
| 237 void DeleteAnnot(CPDFSDK_Annot* pAnnot) override; | |
| 238 CFX_FloatRect GetViewBBox(CPDFSDK_PageView* pPageView, | |
| 239 CPDFSDK_Annot* pAnnot) override; | |
| 240 FX_BOOL HitTest(CPDFSDK_PageView* pPageView, | |
| 241 CPDFSDK_Annot* pAnnot, | |
| 242 const CFX_FloatPoint& point) override; | |
| 243 void OnDraw(CPDFSDK_PageView* pPageView, | |
| 244 CPDFSDK_Annot* pAnnot, | |
| 245 CFX_RenderDevice* pDevice, | |
| 246 CFX_Matrix* pUser2Device, | |
| 247 uint32_t dwFlags) override; | |
| 248 void OnDrawSleep(CPDFSDK_PageView* pPageView, | |
| 249 CPDFSDK_Annot* pAnnot, | |
| 250 CFX_RenderDevice* pDevice, | |
| 251 CFX_Matrix* pUser2Device, | |
| 252 const CFX_FloatRect& rcWindow, | |
| 253 uint32_t dwFlags) override; | |
| 254 void OnCreate(CPDFSDK_Annot* pAnnot) override; | |
| 255 void OnLoad(CPDFSDK_Annot* pAnnot) override; | |
| 256 void OnDelete(CPDFSDK_Annot* pAnnot) override; | |
| 257 void OnRelease(CPDFSDK_Annot* pAnnot) override; | |
| 258 void OnMouseEnter(CPDFSDK_PageView* pPageView, | |
| 259 CPDFSDK_Annot* pAnnot, | |
| 260 uint32_t nFlag) override; | |
| 261 void OnMouseExit(CPDFSDK_PageView* pPageView, | |
| 262 CPDFSDK_Annot* pAnnot, | |
| 263 uint32_t nFlag) override; | |
| 264 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | |
| 265 CPDFSDK_Annot* pAnnot, | |
| 266 uint32_t nFlags, | |
| 267 const CFX_FloatPoint& point) override; | |
| 268 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | |
| 269 CPDFSDK_Annot* pAnnot, | |
| 270 uint32_t nFlags, | |
| 271 const CFX_FloatPoint& point) override; | |
| 272 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 273 CPDFSDK_Annot* pAnnot, | |
| 274 uint32_t nFlags, | |
| 275 const CFX_FloatPoint& point) override; | |
| 276 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 277 CPDFSDK_Annot* pAnnot, | |
| 278 uint32_t nFlags, | |
| 279 const CFX_FloatPoint& point) override; | |
| 280 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 281 CPDFSDK_Annot* pAnnot, | |
| 282 uint32_t nFlags, | |
| 283 short zDelta, | |
| 284 const CFX_FloatPoint& point) override; | |
| 285 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | |
| 286 CPDFSDK_Annot* pAnnot, | |
| 287 uint32_t nFlags, | |
| 288 const CFX_FloatPoint& point) override; | |
| 289 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | |
| 290 CPDFSDK_Annot* pAnnot, | |
| 291 uint32_t nFlags, | |
| 292 const CFX_FloatPoint& point) override; | |
| 293 FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 294 CPDFSDK_Annot* pAnnot, | |
| 295 uint32_t nFlags, | |
| 296 const CFX_FloatPoint& point) override; | |
| 297 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | |
| 298 uint32_t nChar, | |
| 299 uint32_t nFlags) override; | |
| 300 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
| 301 FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override; | |
| 302 void OnDeSelected(CPDFSDK_Annot* pAnnot) override; | |
| 303 void OnSelected(CPDFSDK_Annot* pAnnot) override; | |
| 304 FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; | |
| 305 FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override; | |
| 306 FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, | |
| 307 CPDFSDK_Annot* pNewAnnot) override; | |
| 308 | |
| 309 private: | |
| 310 CXFA_FFWidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot); | |
| 311 uint32_t GetFWLFlags(uint32_t dwFlag); | |
| 312 | |
| 313 private: | |
| 314 CPDFDoc_Environment* m_pApp; | |
| 315 }; | |
| 316 #endif // PDF_ENABLE_XFA | |
| 317 | |
| 318 class CPDFSDK_AnnotHandlerMgr { | |
| 319 public: | |
| 320 // Destroy the handler | |
| 321 explicit CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp); | |
| 322 virtual ~CPDFSDK_AnnotHandlerMgr(); | |
| 323 | |
| 324 public: | |
| 325 void RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler); | |
| 326 void UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler); | |
| 327 | |
| 328 virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, | |
| 329 CPDFSDK_PageView* pPageView); | |
| 330 #ifdef PDF_ENABLE_XFA | |
| 331 virtual CPDFSDK_Annot* NewAnnot(CXFA_FFWidget* pAnnot, | |
| 332 CPDFSDK_PageView* pPageView); | |
| 333 #endif // PDF_ENABLE_XFA | |
| 334 virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot); | |
| 335 | |
| 336 virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); | |
| 337 virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); | |
| 338 | |
| 339 public: | |
| 340 IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const; | |
| 341 virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, | |
| 342 CPDFSDK_Annot* pAnnot, | |
| 343 CFX_RenderDevice* pDevice, | |
| 344 CFX_Matrix* pUser2Device, | |
| 345 uint32_t dwFlags); | |
| 346 | |
| 347 virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, | |
| 348 CPDFSDK_Annot* pAnnot, | |
| 349 uint32_t nFlags); | |
| 350 virtual void Annot_OnMouseExit(CPDFSDK_PageView* pPageView, | |
| 351 CPDFSDK_Annot* pAnnot, | |
| 352 uint32_t nFlags); | |
| 353 | |
| 354 virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView, | |
| 355 CPDFSDK_Annot* pAnnot, | |
| 356 uint32_t nFlags, | |
| 357 const CFX_FloatPoint& point); | |
| 358 virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView, | |
| 359 CPDFSDK_Annot* pAnnot, | |
| 360 uint32_t nFlags, | |
| 361 const CFX_FloatPoint& point); | |
| 362 virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView, | |
| 363 CPDFSDK_Annot* pAnnot, | |
| 364 uint32_t nFlags, | |
| 365 const CFX_FloatPoint& point); | |
| 366 | |
| 367 virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView, | |
| 368 CPDFSDK_Annot* pAnnot, | |
| 369 uint32_t nFlags, | |
| 370 const CFX_FloatPoint& point); | |
| 371 virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView, | |
| 372 CPDFSDK_Annot* pAnnot, | |
| 373 uint32_t nFlags, | |
| 374 short zDelta, | |
| 375 const CFX_FloatPoint& point); | |
| 376 virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView, | |
| 377 CPDFSDK_Annot* pAnnot, | |
| 378 uint32_t nFlags, | |
| 379 const CFX_FloatPoint& point); | |
| 380 virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView, | |
| 381 CPDFSDK_Annot* pAnnot, | |
| 382 uint32_t nFlags, | |
| 383 const CFX_FloatPoint& point); | |
| 384 | |
| 385 virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, | |
| 386 uint32_t nChar, | |
| 387 uint32_t nFlags); | |
| 388 virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, | |
| 389 int nKeyCode, | |
| 390 int nFlag); | |
| 391 virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); | |
| 392 | |
| 393 virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | |
| 394 virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | |
| 395 | |
| 396 #ifdef PDF_ENABLE_XFA | |
| 397 virtual FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot* pSetAnnot, | |
| 398 CPDFSDK_Annot* pKillAnnot); | |
| 399 #endif // PDF_ENABLE_XFA | |
| 400 | |
| 401 virtual CFX_FloatRect Annot_OnGetViewBBox(CPDFSDK_PageView* pPageView, | |
| 402 CPDFSDK_Annot* pAnnot); | |
| 403 virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView* pPageView, | |
| 404 CPDFSDK_Annot* pAnnot, | |
| 405 const CFX_FloatPoint& point); | |
| 406 | |
| 407 private: | |
| 408 IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const; | |
| 409 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, FX_BOOL bNext); | |
| 410 | |
| 411 private: | |
| 412 std::map<CFX_ByteString, std::unique_ptr<IPDFSDK_AnnotHandler>> | |
| 413 m_mapType2Handler; | |
| 414 CPDFDoc_Environment* m_pApp; | |
| 415 }; | |
| 416 | |
| 417 class CPDFSDK_AnnotIterator { | |
| 418 public: | |
| 419 CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView, bool bReverse); | |
| 420 ~CPDFSDK_AnnotIterator(); | |
| 421 | |
| 422 CPDFSDK_Annot* Next(); | |
| 423 | |
| 424 private: | |
| 425 CPDFSDK_Annot* NextAnnot(); | |
| 426 CPDFSDK_Annot* PrevAnnot(); | |
| 427 | |
| 428 std::vector<CPDFSDK_Annot*> m_iteratorAnnotList; | |
| 429 const bool m_bReverse; | |
| 430 size_t m_pos; | |
| 431 }; | |
| 432 | |
| 433 #endif // FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ | |
| OLD | NEW |