TextSegmentCollection.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/multicast_delegate.h>
5 #include <system/eventargs.h>
6 #include <system/event.h>
7 #include <system/collections/ienumerator.h>
8 #include <system/collections/icollection.h>
9 #include <system/array.h>
10 #include <cstdint>
11 
12 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
13 
14 namespace Aspose
15 {
16 namespace Pdf
17 {
18 namespace LogicalStructure
19 {
20 class MCRElement;
21 } // namespace LogicalStructure
22 namespace Tests
23 {
24 namespace Text
25 {
26 class TextBuilderTests;
27 class TextParagraphAbsorberTests;
28 } // namespace Text
29 } // namespace Tests
30 namespace Text
31 {
32 class TextBuilder;
33 class TextFragment;
34 class TextFragmentAbsorber;
35 class TextFragmentState;
36 class TextParagraph;
37 class TextSegment;
38 } // namespace Text
39 } // namespace Pdf
40 } // namespace Aspose
41 namespace System
42 {
43 namespace Collections
44 {
45 namespace Generic
46 {
47 template <typename> class IEnumerable;
48 template <typename> class List;
49 } // namespace Generic
50 } // namespace Collections
51 } // namespace System
52 
53 namespace Aspose {
54 
55 namespace Pdf {
56 
57 namespace Text {
58 
62 class ASPOSE_PDF_SHARED_CLASS TextSegmentCollection final : public System::Collections::Generic::ICollection<System::SharedPtr<Aspose::Pdf::Text::TextSegment>>
63 {
66 
67  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
68  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
69 
76  friend class Aspose::Pdf::Tests::Text::TextParagraphAbsorberTests;
77  friend class Aspose::Pdf::Tests::Text::TextBuilderTests;
78 
79 protected:
80 
82  using TextSegmentsEventHandler = System::MulticastDelegate<void(System::SharedPtr<System::Object>, System::SharedPtr<TextSegmentCollection::TextSegmentEventArgs>)>;
83 
84 
85 protected:
86 
88  {
89  typedef TextSegmentEventArgs ThisType;
90  typedef System::EventArgs BaseType;
91 
92  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
93  RTTI_INFO_DECL();
94 
95  public:
96 
98 
100 
101  };
102 
103 
104 private:
105 
106  class TextSegmentsEnumerator : public System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Pdf::Text::TextSegment>>
107  {
108  typedef TextSegmentsEnumerator ThisType;
110 
111  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
112  RTTI_INFO_DECL();
113  CODEPORTING_ENUMERATOR_ITERATOR_METHODS_DECLARATION(CODEPORTING_ARGS(System::SharedPtr<TextSegment>), CODEPORTING_NO_API_KEYWORD);
114 
115  public:
116 
117  const System::SharedPtr<TextSegment>& get_Current() const override;
118 
120 
121  bool MoveNext() override;
122  void Reset() override;
123  void Dispose() override;
124 
125  private:
126 
128  int32_t viewed;
129  static uint64_t key;
130 
131  static struct __StaticConstructor__ { __StaticConstructor__(); } s_constructor__;
132 
133  bool MoveNextImplementation();
134  System::SharedPtr<TextSegment>* GetCurrentElementPointer();
135 
136  };
137 
138 
139 public:
140 
144  ASPOSE_PDF_SHARED_API int32_t get_Count() const override;
148  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> get_SyncRoot() const;
152  ASPOSE_PDF_SHARED_API bool get_IsSynchronized();
156  ASPOSE_PDF_SHARED_API bool get_IsReadOnly() const override;
157 
162  ASPOSE_PDF_SHARED_API void Add(const System::SharedPtr<TextSegment>& segment) override;
173  //[Obfuscation(Feature = "virtualization", Exclude = false)]
174  ASPOSE_PDF_SHARED_API void CopyTo(System::ArrayPtr<System::SharedPtr<TextSegment>> array, int32_t index) override;
175 
181  //[Obfuscation(Feature = "virtualization", Exclude = false)]
182  ASPOSE_PDF_SHARED_API System::SharedPtr<TextSegment> idx_get(int32_t index);
183 
187  ASPOSE_PDF_SHARED_API void Clear() override;
193  ASPOSE_PDF_SHARED_API bool Contains(const System::SharedPtr<TextSegment>& item) const override;
199  ASPOSE_PDF_SHARED_API bool Remove(const System::SharedPtr<TextSegment>& item) override;
200 
201 protected:
202 
204 
207 
212 
213  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TextSegmentCollection, CODEPORTING_ARGS());
217  void Delete(int32_t index);
221  void ExcludeAt(int32_t index);
227  bool Exclude(System::SharedPtr<TextSegment> item);
231  void Insert(int32_t index, System::SharedPtr<TextSegment> segment);
232  void CopyToUnrestricted(System::ArrayPtr<System::SharedPtr<TextSegment>> array, int32_t index);
236  System::SharedPtr<TextSegment> GetUnrestricted(int32_t index);
237 
238  virtual ASPOSE_PDF_SHARED_API ~TextSegmentCollection();
239 
240 private:
241 
244 
245 };
246 
247 } // namespace Text
248 } // namespace Pdf
249 } // namespace Aspose
250 
251 
MulticastDelegate< Args... > Event
Represents an event - a mechanism through which subscribers are notified about an occurence of intere...
Definition: event.h:14
Represents a text segments collection
Definition: TextSegmentCollection.h:62
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:17
Represents fragment of Pdf text.
Definition: TextFragment.h:173
Definition: Artifact.h:67
Represents text paragraphs as multiline text object.
Definition: TextParagraph.h:86
The base class for classes that represent a context that is passed to the event subscribers when an e...
Definition: eventargs.h:18
Represents an absorber object of text fragments. Performs text search and provides access to search r...
Definition: TextFragmentAbsorber.h:81
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
Represents a text type.
Appends text object to Pdf page.
Definition: TextBuilder.h:73
Represents marked-content reference object in logical structure.
Definition: MCRElement.h:63
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::MulticastDelegate< void(System::SharedPtr< System::Object >, System::SharedPtr< TextSegmentCollection::TextSegmentEventArgs >)> TextSegmentsEventHandler
Definition: TextSegmentCollection.h:82
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
Represents a text state of a text fragment.
Definition: TextFragmentState.h:97
System::SharedPtr< TextSegment > Segment
Definition: TextSegmentCollection.h:97
Whole PDF file will be submitted.