blob: 5cbe8e3d57127e4d9bb3c89200598e1a47f69899 [file] [log] [blame]
jaepark611adb82016-08-17 11:34:36 -07001// 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
dsinclair114e46a2016-09-29 17:18:21 -07007#ifndef FPDFSDK_CBA_ANNOTITERATOR_H_
8#define FPDFSDK_CBA_ANNOTITERATOR_H_
jaepark611adb82016-08-17 11:34:36 -07009
10#include <vector>
11
dsinclair1727aee2016-09-29 13:12:56 -070012#include "core/fpdfdoc/cpdf_annot.h"
dsinclaira52ab742016-09-29 13:59:29 -070013#include "core/fxcrt/fx_coordinates.h"
14#include "core/fxcrt/fx_string.h"
jaepark611adb82016-08-17 11:34:36 -070015
16class CPDFSDK_Annot;
17class CPDFSDK_PageView;
18
19class CBA_AnnotIterator {
20 public:
21 enum TabOrder { STRUCTURE = 0, ROW, COLUMN };
22
23 CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
jaepark956553e2016-08-31 06:49:27 -070024 CPDF_Annot::Subtype nAnnotSubtype);
jaepark611adb82016-08-17 11:34:36 -070025 ~CBA_AnnotIterator();
26
27 CPDFSDK_Annot* GetFirstAnnot();
28 CPDFSDK_Annot* GetLastAnnot();
29 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot);
30 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);
31
32 private:
33 void GenerateResults();
dsinclair8afe15a2016-10-05 12:00:34 -070034 void CollectAnnots(std::vector<CPDFSDK_Annot*>* pArray);
35 CFX_FloatRect AddToAnnotsList(std::vector<CPDFSDK_Annot*>* sa, size_t idx);
36 void AddSelectedToAnnots(std::vector<CPDFSDK_Annot*>* sa,
37 std::vector<size_t>* aSelect);
jaepark611adb82016-08-17 11:34:36 -070038
39 TabOrder m_eTabOrder;
40 CPDFSDK_PageView* m_pPageView;
jaepark956553e2016-08-31 06:49:27 -070041 CPDF_Annot::Subtype m_nAnnotSubtype;
jaepark611adb82016-08-17 11:34:36 -070042 std::vector<CPDFSDK_Annot*> m_Annots;
43};
44
dsinclair114e46a2016-09-29 17:18:21 -070045#endif // FPDFSDK_CBA_ANNOTITERATOR_H_