blob: fd7cbdc6b10243a9c3a4fc67fe96b3dd056fec84 [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
Dan Sinclaircbf76e62018-03-28 21:00:35 +00007#ifndef FPDFSDK_CPDFSDK_ANNOTITERATOR_H_
8#define FPDFSDK_CPDFSDK_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"
Dan Sinclairaee0db02017-09-21 16:53:58 -040015#include "core/fxcrt/unowned_ptr.h"
jaepark611adb82016-08-17 11:34:36 -070016
17class CPDFSDK_Annot;
18class CPDFSDK_PageView;
19
Dan Sinclaircbf76e62018-03-28 21:00:35 +000020class CPDFSDK_AnnotIterator {
jaepark611adb82016-08-17 11:34:36 -070021 public:
Lei Zhang7fb895f2018-10-09 19:02:24 +000022 enum TabOrder : uint8_t { STRUCTURE = 0, ROW, COLUMN };
jaepark611adb82016-08-17 11:34:36 -070023
Dan Sinclaircbf76e62018-03-28 21:00:35 +000024 CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView,
25 CPDF_Annot::Subtype nAnnotSubtype);
26 ~CPDFSDK_AnnotIterator();
jaepark611adb82016-08-17 11:34:36 -070027
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();
dsinclair8afe15a2016-10-05 12:00:34 -070035 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);
jaepark611adb82016-08-17 11:34:36 -070039
Lei Zhang7fb895f2018-10-09 19:02:24 +000040 UnownedPtr<CPDFSDK_PageView> const m_pPageView;
jaepark956553e2016-08-31 06:49:27 -070041 CPDF_Annot::Subtype m_nAnnotSubtype;
Lei Zhang7fb895f2018-10-09 19:02:24 +000042 const TabOrder m_eTabOrder;
jaepark611adb82016-08-17 11:34:36 -070043 std::vector<CPDFSDK_Annot*> m_Annots;
44};
45
Dan Sinclaircbf76e62018-03-28 21:00:35 +000046#endif // FPDFSDK_CPDFSDK_ANNOTITERATOR_H_