AnnotationCollection.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/details/pointer_collection_helpers.h>
5 #include <system/collections/list.h>
6 #include <system/collections/ienumerator.h>
7 #include <system/collections/icollection.h>
8 #include <system/array.h>
9 #include <cstdint>
10 
11 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
12 
13 namespace Aspose
14 {
15 namespace Pdf
16 {
17 namespace Annotations
18 {
19 class Annotation;
20 class AnnotationSelector;
21 } // namespace Annotations
22 class Document;
23 namespace Engine
24 {
25 namespace CommonData
26 {
27 class IPage;
28 } // namespace CommonData
29 namespace Data
30 {
31 class IPdfDictionary;
32 class IPdfObject;
33 } // namespace Data
34 } // namespace Engine
35 namespace Facades
36 {
37 class PdfFileSignature;
38 } // namespace Facades
39 class Page;
40 namespace Tests
41 {
42 class RegressionTests_v20_09;
43 } // namespace Tests
44 } // namespace Pdf
45 } // namespace Aspose
46 
47 namespace Aspose {
48 
49 namespace Pdf {
50 
51 namespace Annotations {
52 
56 class ASPOSE_PDF_SHARED_CLASS AnnotationCollection final : public System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Pdf::Annotations::Annotation>>
57 {
60 
61  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
62  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
63 
64  friend class Aspose::Pdf::Document;
66  friend class Aspose::Pdf::Page;
67  friend class Aspose::Pdf::Tests::RegressionTests_v20_09;
68 
69 private:
70 
71  class AnnotationHandler : public System::Object
72  {
73  typedef AnnotationHandler ThisType;
74  typedef System::Object BaseType;
75 
76  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
77  RTTI_INFO_DECL();
78 
79  public:
80 
83 
86 
88 
89  private:
90 
94 
95  };
96 
97  class AnnotationList : public System::Collections::Generic::List<System::SharedPtr<Aspose::Pdf::Annotations::AnnotationCollection::AnnotationHandler>>
98  {
99  typedef AnnotationList ThisType;
101 
102  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
103  RTTI_INFO_DECL();
104 
105  public:
106 
107  int32_t IndexOf(const System::SharedPtr<Annotation>& annotation) const;
108  bool Remove(const System::SharedPtr<Annotation>& annotation);
109  void SetTemplateWeakPtr(uint32_t argument) override;
110 
111  protected:
112 
113  virtual ~AnnotationList();
114 
115  };
116 
117  class AnnotationsEnumerator : public System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Pdf::Annotations::Annotation>>
118  {
119  typedef AnnotationsEnumerator ThisType;
121 
122  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
123  RTTI_INFO_DECL();
124  CODEPORTING_ENUMERATOR_ITERATOR_METHODS_DECLARATION(CODEPORTING_ARGS(System::SharedPtr<Annotation>), CODEPORTING_NO_API_KEYWORD);
125 
126  public:
127 
128  const System::SharedPtr<Annotation>& get_Current() const override;
129 
131 
132  bool MoveNext() override;
133  void Reset() override;
134  void Dispose() override;
135 
136  private:
137 
139  int32_t _cursor;
141 
142  bool MoveNextImplementation();
143  System::SharedPtr<Annotation>* GetCurrentElementPointer();
144 
145  };
146 
147 
148 public:
149 
153  ASPOSE_PDF_SHARED_API bool get_IsSynchronized();
157  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> get_SyncRoot() const;
161  ASPOSE_PDF_SHARED_API int32_t get_Count() const override;
165  ASPOSE_PDF_SHARED_API bool get_IsReadOnly() const override;
166 
172  ASPOSE_PDF_SHARED_API void Add(System::SharedPtr<Annotation> annotation, bool considerRotation);
177  ASPOSE_PDF_SHARED_API void Add(const System::SharedPtr<Annotation>& annotation) override;
182  ASPOSE_PDF_SHARED_API void Delete(int32_t index);
186  ASPOSE_PDF_SHARED_API void Delete();
192  ASPOSE_PDF_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<Annotation>> array, int32_t index) override;
202  ASPOSE_PDF_SHARED_API void Accept(System::SharedPtr<AnnotationSelector> visitor);
207  ASPOSE_PDF_SHARED_API void Delete(System::SharedPtr<Annotation> annotation);
211  ASPOSE_PDF_SHARED_API void Clear() override;
217  ASPOSE_PDF_SHARED_API bool Contains(const System::SharedPtr<Annotation>& annotation) const override;
223  ASPOSE_PDF_SHARED_API bool Remove(const System::SharedPtr<Annotation>& annotation) override;
224 
230  ASPOSE_PDF_SHARED_API System::SharedPtr<Annotation> idx_get(int32_t index);
231 
237  ASPOSE_PDF_SHARED_API System::SharedPtr<Annotation> FindByName(System::String name);
238 
239 protected:
240 
242 
243  void assert_();
244 
250 
251  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(AnnotationCollection, CODEPORTING_ARGS(System::SharedPtr<Page> page));
252  System::SharedPtr<Annotation> GetUnrestricted(int32_t index);
256  void PreSave();
257 
258  virtual ASPOSE_PDF_SHARED_API ~AnnotationCollection();
259 
260 private:
261 
263  System::WeakPtr<Page> _page;
265 
266  bool IsValidAnnotationDictionary(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfDictionary> dict);
272  System::SharedPtr<Annotation> get(int32_t index);
273 
274 };
275 
276 } // namespace Annotations
277 } // namespace Pdf
278 } // namespace Aspose
279 
280 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
System::SharedPtr< Aspose::Pdf::Engine::CommonData::IPage > page
Definition: AnnotationCollection.h:241
Class representing PDF document
Definition: Document.h:625
Definition: signed_info.h:13
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Interface of enumerator which can be used to iterate through some elements. Objects of this class sho...
Definition: BaseOperatorCollection.h:47
Class representing page of PDF document.
Definition: Page.h:375
Definition: AFRelationship.h:4
Subclass of System::SmartPtr which sets itself to weak mode at construction. Please note that this cl...
Definition: TextFragmentState.h:69
Class representing annotation collection.
Definition: AnnotationCollection.h:56
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: Collection.h:41
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
Represents a class to sign a pdf file with a certificate.
Definition: PdfFileSignature.h:63
Whole PDF file will be submitted.