ArtifactCollection.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/collections/ienumerator.h>
5 #include <system/collections/icollection.h>
6 #include <cstdint>
7 
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 #include "Aspose.PDF.Cpp/Artifacts/Artifact.h"
10 
11 namespace Aspose
12 {
13 namespace Pdf
14 {
15 class BackgroundArtifact;
16 namespace Engine
17 {
18 namespace Data
19 {
20 class IPdfDictionary;
21 } // namespace Data
22 } // namespace Engine
23 class Matrix;
24 class Operator;
25 class OperatorCollection;
26 class Page;
27 class Resources;
28 } // namespace Pdf
29 } // namespace Aspose
30 namespace System
31 {
32 namespace Collections
33 {
34 namespace Generic
35 {
36 template <typename> class List;
37 } // namespace Generic
38 } // namespace Collections
39 } // namespace System
40 
41 namespace Aspose {
42 
43 namespace Pdf {
44 
48 class ASPOSE_PDF_SHARED_CLASS ArtifactCollection : public System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Pdf::Artifact>>
49 {
52 
53  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
54  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
55 
56  friend class Aspose::Pdf::Page;
57  friend class Aspose::Pdf::Artifact;
59 
60 private:
61 
62  enum class WatermarkType
63  {
64  Unknown,
65  Text,
66  Image,
67  Page
68  };
69 
70 
71 private:
72 
73  class ArtifactEnumerator : public System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Pdf::Artifact>>
74  {
75  typedef ArtifactEnumerator ThisType;
77 
78  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
79  RTTI_INFO_DECL();
80  CODEPORTING_ENUMERATOR_ITERATOR_METHODS_DECLARATION(CODEPORTING_ARGS(System::SharedPtr<Artifact>), CODEPORTING_NO_API_KEYWORD);
81 
82  public:
83 
84  const System::SharedPtr<Artifact>& get_Current() const override;
85 
86  ArtifactEnumerator(System::SharedPtr<ArtifactCollection> collection);
87 
88  bool MoveNext() override;
89  void Reset() override;
90  void Dispose() override;
91 
92  private:
93 
95  int32_t current;
96 
97  bool MoveNextImplementation();
98  System::SharedPtr<Artifact>* GetCurrentElementPointer();
99 
100  };
101 
102 
103 public:
104 
108  ASPOSE_PDF_SHARED_API bool get_IsSynchronized();
112  ASPOSE_PDF_SHARED_API int32_t get_Count() const override;
116  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> get_SyncRoot() const;
120  ASPOSE_PDF_SHARED_API bool get_IsReadOnly() const override;
121 
127  ASPOSE_PDF_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<Artifact>> dest, int32_t index) override;
133 
139  ASPOSE_PDF_SHARED_API System::SharedPtr<Artifact> idx_get(int32_t index);
140 
145  ASPOSE_PDF_SHARED_API void Add(const System::SharedPtr<Artifact>& artifact) override;
157  ASPOSE_PDF_SHARED_API void Delete(System::SharedPtr<Artifact> artifact);
162  ASPOSE_PDF_SHARED_API void Update(System::SharedPtr<Artifact> artifact);
167  ASPOSE_PDF_SHARED_API void Delete(int32_t index);
168 
169 protected:
170 
171  System::SharedPtr<Aspose::Pdf::Page> get_Page() const;
172 
174 
175  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(ArtifactCollection, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Page> page));
176 
177  virtual ASPOSE_PDF_SHARED_API ~ArtifactCollection();
178 
179 private:
180 
184 
186  ArtifactCollection::WatermarkType GetWatermarkType(System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Operator>>> operators, System::SharedPtr<Resources> res);
190  void UpdateCollection();
191  int32_t FindOperatorByTag(System::String Tag);
192  void DeleteOperator(int32_t startIndex);
193  bool OperatorsEqual(System::SharedPtr<Operator> op1, System::SharedPtr<Operator> op2);
200  int32_t GetIndex(System::SharedPtr<Artifact> artifact);
204  void Clear() override;
209  bool Contains(const System::SharedPtr<Artifact>& item) const override;
214  bool Remove(const System::SharedPtr<Artifact>& item) override;
215 
216 };
217 
218 } // namespace Pdf
219 } // namespace Aspose
220 
221 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:17
Class descibes background artifact. This artifact allows to set background of the page...
Definition: BackgroundArtifact.h:48
Definition: Artifact.h:67
Class represents artifact collection.
Definition: ArtifactCollection.h:48
This field represents an unknown type.
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:364
Definition: AFRelationship.h:4
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: Form.h:84
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
Represents image.
Definition: Image.h:66
Class represents PDF Artifact object.
Definition: Artifact.h:90
Whole PDF file will be submitted.