| 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 CORE_FPDFDOC_CPDF_ANNOT_H_ | |
| 8 #define CORE_FPDFDOC_CPDF_ANNOT_H_ | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 | |
| 13 #include "core/fxcrt/include/fx_coordinates.h" | |
| 14 #include "core/fxcrt/include/fx_string.h" | |
| 15 #include "core/fxcrt/include/fx_system.h" | |
| 16 | |
| 17 class CFX_RenderDevice; | |
| 18 class CPDF_Dictionary; | |
| 19 class CPDF_Document; | |
| 20 class CPDF_Form; | |
| 21 class CPDF_Page; | |
| 22 class CPDF_RenderContext; | |
| 23 class CPDF_RenderOptions; | |
| 24 class CPDF_Stream; | |
| 25 | |
| 26 #define ANNOTFLAG_INVISIBLE 0x0001 | |
| 27 #define ANNOTFLAG_HIDDEN 0x0002 | |
| 28 #define ANNOTFLAG_PRINT 0x0004 | |
| 29 #define ANNOTFLAG_NOZOOM 0x0008 | |
| 30 #define ANNOTFLAG_NOROTATE 0x0010 | |
| 31 #define ANNOTFLAG_NOVIEW 0x0020 | |
| 32 #define ANNOTFLAG_READONLY 0x0040 | |
| 33 #define ANNOTFLAG_LOCKED 0x0080 | |
| 34 #define ANNOTFLAG_TOGGLENOVIEW 0x0100 | |
| 35 | |
| 36 class CPDF_Annot { | |
| 37 public: | |
| 38 enum AppearanceMode { Normal, Rollover, Down }; | |
| 39 | |
| 40 CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument); | |
| 41 ~CPDF_Annot(); | |
| 42 | |
| 43 CFX_ByteString GetSubType() const; | |
| 44 uint32_t GetFlags() const; | |
| 45 void GetRect(CFX_FloatRect& rect) const; | |
| 46 const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; } | |
| 47 CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; } | |
| 48 FX_BOOL DrawAppearance(CPDF_Page* pPage, | |
| 49 CFX_RenderDevice* pDevice, | |
| 50 const CFX_Matrix* pUser2Device, | |
| 51 AppearanceMode mode, | |
| 52 const CPDF_RenderOptions* pOptions); | |
| 53 FX_BOOL DrawInContext(const CPDF_Page* pPage, | |
| 54 CPDF_RenderContext* pContext, | |
| 55 const CFX_Matrix* pUser2Device, | |
| 56 AppearanceMode mode); | |
| 57 void ClearCachedAP(); | |
| 58 void DrawBorder(CFX_RenderDevice* pDevice, | |
| 59 const CFX_Matrix* pUser2Device, | |
| 60 const CPDF_RenderOptions* pOptions); | |
| 61 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); | |
| 62 | |
| 63 private: | |
| 64 CPDF_Dictionary* const m_pAnnotDict; | |
| 65 CPDF_Document* const m_pDocument; | |
| 66 const CFX_ByteString m_sSubtype; | |
| 67 std::map<CPDF_Stream*, std::unique_ptr<CPDF_Form>> m_APMap; | |
| 68 }; | |
| 69 | |
| 70 #endif // CORE_FPDFDOC_CPDF_ANNOT_H_ | |
| OLD | NEW |