1 // Copyright 2017 The PDFium Authors 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 7 #ifndef FPDFSDK_CPDFSDK_ANNOTITERATION_H_ 8 #define FPDFSDK_CPDFSDK_ANNOTITERATION_H_ 9 10 #include <vector> 11 12 #include "fpdfsdk/cpdfsdk_annot.h" 13 14 class CPDFSDK_PageView; 15 16 class CPDFSDK_AnnotIteration { 17 public: 18 using const_iterator = 19 std::vector<ObservedPtr<CPDFSDK_Annot>>::const_iterator; 20 21 static CPDFSDK_AnnotIteration CreateForDrawing(CPDFSDK_PageView* page_view); 22 23 explicit CPDFSDK_AnnotIteration(CPDFSDK_PageView* page_view); 24 CPDFSDK_AnnotIteration(const CPDFSDK_AnnotIteration&) = delete; 25 CPDFSDK_AnnotIteration& operator=(const CPDFSDK_AnnotIteration&) = delete; 26 ~CPDFSDK_AnnotIteration(); 27 begin()28 const_iterator begin() const { return list_.begin(); } end()29 const_iterator end() const { return list_.end(); } 30 31 private: 32 CPDFSDK_AnnotIteration(CPDFSDK_PageView* page_view, 33 bool put_focused_annot_at_end); 34 35 std::vector<ObservedPtr<CPDFSDK_Annot>> list_; 36 }; 37 38 #endif // FPDFSDK_CPDFSDK_ANNOTITERATION_H_ 39