OutlineCollection.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 //using System.Linq.Expressions;
4 
5 #include <system/collections/ienumerator.h>
6 
7 #include "Aspose.PDF.Cpp/Outlines/Outlines.h"
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 namespace Annotations
15 {
16 class GoToAction;
17 } // namespace Annotations
18 class Document;
19 namespace Engine
20 {
21 namespace Data
22 {
23 class IPdfDictionary;
24 class IPdfObject;
25 } // namespace Data
26 class IPdfDocument;
27 } // namespace Engine
28 namespace Facades
29 {
30 class PdfFileEditor;
31 } // namespace Facades
32 class OutlineItemCollection;
33 namespace Tests
34 {
35 namespace Facades
36 {
37 class PdfBookmarkEditorTests;
38 } // namespace Facades
39 } // namespace Tests
40 } // namespace Pdf
41 } // namespace Aspose
42 
43 namespace Aspose {
44 
45 namespace Pdf {
46 
50 class ASPOSE_PDF_SHARED_CLASS OutlineCollection final : public Aspose::Pdf::Outlines
51 {
54 
55  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
56  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
57 
58  friend class Aspose::Pdf::Document;
61  friend class Aspose::Pdf::Tests::Facades::PdfBookmarkEditorTests;
62 
63 protected:
64 
65  class OutlinesEnumerator : public System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Pdf::OutlineItemCollection>>
66  {
67  typedef OutlinesEnumerator ThisType;
69 
70  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
71  RTTI_INFO_DECL();
72  CODEPORTING_ENUMERATOR_ITERATOR_METHODS_DECLARATION(CODEPORTING_ARGS(System::SharedPtr<OutlineItemCollection>), CODEPORTING_NO_API_KEYWORD);
73 
74  public:
75 
76  const System::SharedPtr<OutlineItemCollection>& get_Current() const override;
77 
79 
80  bool MoveNext() override;
81  void Reset() override;
82  void Dispose() override;
83 
84  private:
85 
86  bool initialized;
90 
91  bool MoveNextImplementation();
92  System::SharedPtr<OutlineItemCollection>* GetCurrentElementPointer();
93 
94  };
95 
96  class OutlinesEnumeratorUnrestricted : public System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Pdf::OutlineItemCollection>>
97  {
98  typedef OutlinesEnumeratorUnrestricted ThisType;
100 
101  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
102  RTTI_INFO_DECL();
103  CODEPORTING_ENUMERATOR_ITERATOR_METHODS_DECLARATION(CODEPORTING_ARGS(System::SharedPtr<OutlineItemCollection>), CODEPORTING_NO_API_KEYWORD);
104 
105  public:
106 
107  const System::SharedPtr<OutlineItemCollection>& get_Current() const override;
108 
110 
111  bool MoveNext() override;
112  void Reset() override;
113  void Dispose() override;
114 
115  private:
116 
117  bool initialized;
121 
122  bool MoveNextImplementation();
123  System::SharedPtr<OutlineItemCollection>* GetCurrentElementPointer();
124 
125  };
126 
127 
128 public:
129 
133  ASPOSE_PDF_SHARED_API int32_t get_VisibleCount() override;
137  ASPOSE_PDF_SHARED_API int32_t get_Count() const override;
141  ASPOSE_PDF_SHARED_API System::SharedPtr<OutlineItemCollection> get_First() const;
145  ASPOSE_PDF_SHARED_API System::SharedPtr<OutlineItemCollection> get_Last();
149  ASPOSE_PDF_SHARED_API bool get_IsSynchronized();
153  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> get_SyncRoot() const;
157  ASPOSE_PDF_SHARED_API bool get_IsReadOnly() const override;
158 
163  ASPOSE_PDF_SHARED_API void Add(const System::SharedPtr<OutlineItemCollection>& outline) override;
167  ASPOSE_PDF_SHARED_API void Delete();
172  ASPOSE_PDF_SHARED_API void Delete(System::String name);
178  ASPOSE_PDF_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<OutlineItemCollection>> array, int32_t index) override;
183  //override System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
184  //{
185  // return new OutlinesEnumerator(document.Catalog.Outlines, document);
186  //}
195  ASPOSE_PDF_SHARED_API void Clear() override;
201  ASPOSE_PDF_SHARED_API bool Contains(const System::SharedPtr<OutlineItemCollection>& item) const override;
207  ASPOSE_PDF_SHARED_API bool Remove(const System::SharedPtr<OutlineItemCollection>& item) override;
212  ASPOSE_PDF_SHARED_API void Remove(int32_t index);
213 
219  // [Obfuscation(Feature = "virtualization", Exclude = false)]
220  ASPOSE_PDF_SHARED_API System::SharedPtr<OutlineItemCollection> idx_get(int32_t index);
221 
222 protected:
223 
228 
232  bool get_IsEmpty();
233 
239 
240  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(OutlineCollection, CODEPORTING_ARGS(System::SharedPtr<Document> document));
246  void Add(System::SharedPtr<OutlineItemCollection> outline, bool updateData);
247  void UpdateLast();
248  System::SharedPtr<Engine::Data::IPdfObject> GetOutlinesObject() const;
254  static void Delete(System::SharedPtr<Engine::Data::IPdfDictionary> outlines, System::String name);
255  ASPOSE_PDF_SHARED_API void UpdateVisibleCount() override;
257 
259 
260  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(OutlineCollection, CODEPORTING_ARGS(System::SharedPtr<Engine::IPdfDocument> document));
261 
262  virtual ASPOSE_PDF_SHARED_API ~OutlineCollection();
263 
264 private:
265 
267  System::WeakPtr<Document> _domDocument;
268 
269  int32_t CalculateVisibleCount();
270  void FixGoToAction(System::SharedPtr<Annotations::GoToAction> destination);
272  int32_t FindItem(System::SharedPtr<OutlineItemCollection> item) const;
273  int32_t FindItem(System::String name);
274 
275 };
276 
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
Represents document outline hierarchy.
Definition: OutlineCollection.h:50
Class representing PDF document
Definition: Document.h:620
Definition: OutlineCollection.h:65
Represents outline entry in outline hierarchy of PDF document.
Definition: OutlineItemCollection.h:68
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
Definition: AFRelationship.h:4
System::WeakPtr< Engine::IPdfDocument > document
Document instance.
Definition: OutlineCollection.h:227
Class describes collection of outlines.
Definition: Outlines.h:35
Implements operations with PDF file: concatenation, splitting, extracting pages, making booklet...
Definition: PdfFileEditor.h:105
Whole PDF file will be submitted.