| 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 FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ | 7 #ifndef FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ |
| 8 #define FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ | 8 #define FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "core/fpdfdoc/include/cpdf_annot.h" |
| 12 #include "core/fxcrt/include/fx_coordinates.h" | 13 #include "core/fxcrt/include/fx_coordinates.h" |
| 13 #include "core/fxcrt/include/fx_string.h" | 14 #include "core/fxcrt/include/fx_string.h" |
| 14 | 15 |
| 15 class CPDFSDK_Annot; | 16 class CPDFSDK_Annot; |
| 16 class CPDFSDK_PageView; | 17 class CPDFSDK_PageView; |
| 17 | 18 |
| 18 class CBA_AnnotIterator { | 19 class CBA_AnnotIterator { |
| 19 public: | 20 public: |
| 20 enum TabOrder { STRUCTURE = 0, ROW, COLUMN }; | 21 enum TabOrder { STRUCTURE = 0, ROW, COLUMN }; |
| 21 | 22 |
| 22 CBA_AnnotIterator(CPDFSDK_PageView* pPageView, | 23 CBA_AnnotIterator(CPDFSDK_PageView* pPageView, |
| 23 const CFX_ByteString& sAnnotSubtype); | 24 CPDF_Annot::Subtype nAnnotSubtype); |
| 24 ~CBA_AnnotIterator(); | 25 ~CBA_AnnotIterator(); |
| 25 | 26 |
| 26 CPDFSDK_Annot* GetFirstAnnot(); | 27 CPDFSDK_Annot* GetFirstAnnot(); |
| 27 CPDFSDK_Annot* GetLastAnnot(); | 28 CPDFSDK_Annot* GetLastAnnot(); |
| 28 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); | 29 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); |
| 29 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); | 30 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 void GenerateResults(); | 33 void GenerateResults(); |
| 33 static CFX_FloatRect GetAnnotRect(const CPDFSDK_Annot* pAnnot); | 34 static CFX_FloatRect GetAnnotRect(const CPDFSDK_Annot* pAnnot); |
| 34 | 35 |
| 35 // Function signature compatible with std::sort(). | 36 // Function signature compatible with std::sort(). |
| 36 static bool CompareByLeftAscending(const CPDFSDK_Annot* p1, | 37 static bool CompareByLeftAscending(const CPDFSDK_Annot* p1, |
| 37 const CPDFSDK_Annot* p2); | 38 const CPDFSDK_Annot* p2); |
| 38 static bool CompareByTopDescending(const CPDFSDK_Annot* p1, | 39 static bool CompareByTopDescending(const CPDFSDK_Annot* p1, |
| 39 const CPDFSDK_Annot* p2); | 40 const CPDFSDK_Annot* p2); |
| 40 | 41 |
| 41 TabOrder m_eTabOrder; | 42 TabOrder m_eTabOrder; |
| 42 CPDFSDK_PageView* m_pPageView; | 43 CPDFSDK_PageView* m_pPageView; |
| 43 CFX_ByteString m_sAnnotSubtype; | 44 CPDF_Annot::Subtype m_nAnnotSubtype; |
| 44 std::vector<CPDFSDK_Annot*> m_Annots; | 45 std::vector<CPDFSDK_Annot*> m_Annots; |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 #endif // FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ | 48 #endif // FPDFSDK_INCLUDE_CBA_ANNOTITERATOR_H_ |
| OLD | NEW |