jaepark | 611adb8 | 2016-08-17 11:34:36 -0700 | [diff] [blame] | 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 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 7 | #ifndef FPDFSDK_CBA_ANNOTITERATOR_H_ |
| 8 | #define FPDFSDK_CBA_ANNOTITERATOR_H_ |
jaepark | 611adb8 | 2016-08-17 11:34:36 -0700 | [diff] [blame] | 9 | |
| 10 | #include <vector> |
| 11 | |
dsinclair | 1727aee | 2016-09-29 13:12:56 -0700 | [diff] [blame] | 12 | #include "core/fpdfdoc/cpdf_annot.h" |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 13 | #include "core/fxcrt/fx_coordinates.h" |
| 14 | #include "core/fxcrt/fx_string.h" |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 15 | #include "core/fxcrt/unowned_ptr.h" |
jaepark | 611adb8 | 2016-08-17 11:34:36 -0700 | [diff] [blame] | 16 | |
| 17 | class CPDFSDK_Annot; |
| 18 | class CPDFSDK_PageView; |
| 19 | |
| 20 | class CBA_AnnotIterator { |
| 21 | public: |
| 22 | enum TabOrder { STRUCTURE = 0, ROW, COLUMN }; |
| 23 | |
| 24 | CBA_AnnotIterator(CPDFSDK_PageView* pPageView, |
jaepark | 956553e | 2016-08-31 06:49:27 -0700 | [diff] [blame] | 25 | CPDF_Annot::Subtype nAnnotSubtype); |
jaepark | 611adb8 | 2016-08-17 11:34:36 -0700 | [diff] [blame] | 26 | ~CBA_AnnotIterator(); |
| 27 | |
| 28 | CPDFSDK_Annot* GetFirstAnnot(); |
| 29 | CPDFSDK_Annot* GetLastAnnot(); |
| 30 | CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); |
| 31 | CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); |
| 32 | |
| 33 | private: |
| 34 | void GenerateResults(); |
dsinclair | 8afe15a | 2016-10-05 12:00:34 -0700 | [diff] [blame] | 35 | void CollectAnnots(std::vector<CPDFSDK_Annot*>* pArray); |
| 36 | CFX_FloatRect AddToAnnotsList(std::vector<CPDFSDK_Annot*>* sa, size_t idx); |
| 37 | void AddSelectedToAnnots(std::vector<CPDFSDK_Annot*>* sa, |
| 38 | std::vector<size_t>* aSelect); |
jaepark | 611adb8 | 2016-08-17 11:34:36 -0700 | [diff] [blame] | 39 | |
| 40 | TabOrder m_eTabOrder; |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 41 | UnownedPtr<CPDFSDK_PageView> m_pPageView; |
jaepark | 956553e | 2016-08-31 06:49:27 -0700 | [diff] [blame] | 42 | CPDF_Annot::Subtype m_nAnnotSubtype; |
jaepark | 611adb8 | 2016-08-17 11:34:36 -0700 | [diff] [blame] | 43 | std::vector<CPDFSDK_Annot*> m_Annots; |
| 44 | }; |
| 45 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 46 | #endif // FPDFSDK_CBA_ANNOTITERATOR_H_ |