| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ | 7 #ifndef CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ |
| 8 #define CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ | 8 #define CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 void DrawBorder(CFX_RenderDevice* pDevice, | 93 void DrawBorder(CFX_RenderDevice* pDevice, |
| 94 const CFX_Matrix* pUser2Device, | 94 const CFX_Matrix* pUser2Device, |
| 95 const CPDF_RenderOptions* pOptions); | 95 const CPDF_RenderOptions* pOptions); |
| 96 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); | 96 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); |
| 97 void SetOpenState(bool bOpenState) { m_bOpenState = bOpenState; } | 97 void SetOpenState(bool bOpenState) { m_bOpenState = bOpenState; } |
| 98 CPDF_Annot* GetPopupAnnot() const { return m_pPopupAnnot; } | 98 CPDF_Annot* GetPopupAnnot() const { return m_pPopupAnnot; } |
| 99 void SetPopupAnnot(CPDF_Annot* pAnnot) { m_pPopupAnnot = pAnnot; } | 99 void SetPopupAnnot(CPDF_Annot* pAnnot) { m_pPopupAnnot = pAnnot; } |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 void GenerateAPIfNeeded(); | 102 void GenerateAPIfNeeded(); |
| 103 bool ShouldDrawAnnotation(); |
| 103 | 104 |
| 104 // For regular annotations, |m_pAnnotDict| is not owned. For | 105 // For regular annotations, |m_pAnnotDict| is not owned. For |
| 105 // our artificially created popup annotations, |m_pAnnotDict| | 106 // our artificially created popup annotations, |m_pAnnotDict| |
| 106 // is owned by this class. | 107 // is owned by this class. |
| 107 bool m_bOwnedAnnotDict; | 108 bool m_bOwnedAnnotDict; |
| 108 CPDF_Dictionary* m_pAnnotDict; | 109 CPDF_Dictionary* m_pAnnotDict; |
| 109 CPDF_Document* const m_pDocument; | 110 CPDF_Document* const m_pDocument; |
| 110 CPDF_Annot::Subtype m_nSubtype; | 111 CPDF_Annot::Subtype m_nSubtype; |
| 111 std::map<CPDF_Stream*, std::unique_ptr<CPDF_Form>> m_APMap; | 112 std::map<CPDF_Stream*, std::unique_ptr<CPDF_Form>> m_APMap; |
| 112 // |m_bOpenState| is only set for popup annotations. | 113 // |m_bOpenState| is only set for popup annotations. |
| 113 bool m_bOpenState; | 114 bool m_bOpenState; |
| 114 // Not owned. If there is a valid pointer in |m_pPopupAnnot|, | 115 // Not owned. If there is a valid pointer in |m_pPopupAnnot|, |
| 115 // then this annot is never a popup. | 116 // then this annot is never a popup. |
| 116 CPDF_Annot* m_pPopupAnnot; | 117 CPDF_Annot* m_pPopupAnnot; |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, | 120 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, |
| 120 CPDF_Annot::AppearanceMode mode); | 121 CPDF_Annot::AppearanceMode mode); |
| 121 | 122 |
| 122 #endif // CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ | 123 #endif // CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ |
| OLD | NEW |