Element.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/string.h>
5 #include <system/collections/list.h>
6 #include <system/collections/ienumerable.h>
7 #include <cstdint>
8 
9 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
10 
11 namespace Aspose
12 {
13 namespace Pdf
14 {
15 namespace Collections
16 {
17 template <typename, typename> class AsposeHashDictionary;
18 } // namespace Collections
19 namespace Engine
20 {
21 namespace Data
22 {
23 class IPdfDictionary;
24 class IPdfObject;
25 class IPdfPrimitive;
26 class ITrailerable;
27 } // namespace Data
28 } // namespace Engine
29 namespace Structure
30 {
31 class Element;
32 class ElementFactory;
33 class FigureElement;
34 class RootElement;
35 class StructElement;
36 class TextElement;
37 } // namespace Structure
38 namespace Tests
39 {
40 class RegressionTests_v23_10;
41 class RegressionTests_v24_02;
42 } // namespace Tests
43 class XmlConverter;
44 } // namespace Pdf
45 } // namespace Aspose
46 namespace System
47 {
48 namespace Collections
49 {
50 namespace Generic
51 {
52 template <typename> class IEnumerator;
53 } // namespace Generic
54 } // namespace Collections
55 } // namespace System
56 
57 namespace Aspose {
58 
59 namespace Pdf {
60 
61 namespace Structure {
62 
66 class ASPOSE_PDF_SHARED_CLASS ElementCollection : public System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Pdf::Structure::Element>>
67 {
70 
71  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
72  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
73 
75 
76 public:
87 
88 public:
89 
93  ASPOSE_PDF_SHARED_API int32_t get_Count();
94 
100  ASPOSE_PDF_SHARED_API bool Remove(System::SharedPtr<Element> item);
106 
112  ASPOSE_PDF_SHARED_API System::SharedPtr<Element> idx_get(int32_t index);
113 
116  ASPOSE_PDF_SHARED_API iterator begin() noexcept;
119  ASPOSE_PDF_SHARED_API iterator end() noexcept;
122  ASPOSE_PDF_SHARED_API const_iterator begin() const noexcept;
125  ASPOSE_PDF_SHARED_API const_iterator end() const noexcept;
128  ASPOSE_PDF_SHARED_API const_iterator cbegin() const noexcept;
131  ASPOSE_PDF_SHARED_API const_iterator cend() const noexcept;
136  ASPOSE_PDF_SHARED_API virtualized_iterator* virtualizeBeginIterator() override;
141  ASPOSE_PDF_SHARED_API virtualized_iterator* virtualizeEndIterator() override;
146  ASPOSE_PDF_SHARED_API virtualized_iterator* virtualizeBeginConstIterator() const override;
151  ASPOSE_PDF_SHARED_API virtualized_iterator* virtualizeEndConstIterator() const override;
152 
153 protected:
154 
155  ElementCollection(System::SharedPtr<Element> parent);
156 
157  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(ElementCollection, CODEPORTING_ARGS(System::SharedPtr<Element> parent));
158 
159  virtual ASPOSE_PDF_SHARED_API ~ElementCollection();
160 
161 private:
162 
163  System::SharedPtr<Element> _parent;
164  System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Element>>> _elements;
165 
166  static void RemoveFromParent(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfDictionary> parent, System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfPrimitive> primitive);
167  static void UnregisterSubTree(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfPrimitive> primitive);
168  void Init();
169 
170 };
171 
175 class ASPOSE_PDF_SHARED_CLASS Element : public System::Object
176 {
177  typedef Element ThisType;
178  typedef System::Object BaseType;
179 
180  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
181  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
182 
188  friend class Aspose::Pdf::XmlConverter;
189  friend class Aspose::Pdf::Tests::RegressionTests_v23_10;
190  friend class Aspose::Pdf::Tests::RegressionTests_v24_02;
191 
192 public:
193 
197  ASPOSE_PDF_SHARED_API System::SharedPtr<ElementCollection> get_Children();
203  virtual ASPOSE_PDF_SHARED_API System::String get_Lang();
209  virtual ASPOSE_PDF_SHARED_API void set_Lang(System::String value);
216  virtual ASPOSE_PDF_SHARED_API System::String get_ActualText();
223  virtual ASPOSE_PDF_SHARED_API void set_ActualText(System::String value);
229  virtual ASPOSE_PDF_SHARED_API System::String get_Alt();
235  virtual ASPOSE_PDF_SHARED_API void set_Alt(System::String value);
239  virtual ASPOSE_PDF_SHARED_API System::String get_E();
243  virtual ASPOSE_PDF_SHARED_API void set_E(System::String value);
244 
248  ASPOSE_PDF_SHARED_API void Remove();
249 
250 protected:
251 
254 
255  System::String get_Type();
256  void set_Type(System::String value);
257  System::String get_StructureType();
258  System::SharedPtr<Element> get_Parent() const;
260 
268 
269  virtual ASPOSE_PDF_SHARED_API ~Element();
270 
271 private:
272 
276 
278 
279 };
280 
281 //TODO: remove next classes to separate files.
285 class ASPOSE_PDF_SHARED_CLASS StructElement : public Aspose::Pdf::Structure::Element
286 {
287  typedef StructElement ThisType;
288  typedef Aspose::Pdf::Structure::Element BaseType;
289 
290  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
291  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
292 
293  friend class Aspose::Pdf::Structure::ElementFactory;
294 
295 protected:
296 
298 
299  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(StructElement, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfDictionary> engineDict, System::SharedPtr<Element> parent));
300 
302 
303  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(StructElement, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfObject> obj, System::SharedPtr<Element> parent));
304 
305 };
306 
310 class ASPOSE_PDF_SHARED_CLASS RootElement : public Aspose::Pdf::Structure::Element
311 {
312  typedef RootElement ThisType;
313  typedef Aspose::Pdf::Structure::Element BaseType;
314 
315  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
316  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
317 
318  friend class Aspose::Pdf::Structure::ElementFactory;
319  friend class Aspose::Pdf::XmlConverter;
320 
321 protected:
322 
324 
326 
327  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(RootElement, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfDictionary> engineDict, System::SharedPtr<Element> parent));
328 
330 
331  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(RootElement, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfObject> obj, System::SharedPtr<Element> parent));
332 
333 private:
334 
337 
338 };
339 
340 } // namespace Structure
341 } // namespace Pdf
342 } // namespace Aspose
343 
344 
typename iterator_holder_type::virtualized_iterator virtualized_iterator
Virtualized type.
Definition: Element.h:86
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfDictionary > EngineDict
Definition: Element.h:252
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
Definition: Artifact.h:67
T virtualized_iterator_element
Inner iterator element type.
Definition: ienumerable.h:232
System::Details::VirtualizedIteratorBase< T > virtualized_iterator
Inner iterator base type.
Definition: ienumerable.h:230
General structure element.
Definition: Element.h:285
Collection of base logical structure elements.
Definition: Element.h:66
ASPOSECPP_SHARED_API Object()
Creates object. Initializes all internal data structures.
ASPOSE_PDF_SHARED_API void Remove()
Remove element.
General text element of document logical structure.
Definition: TextElement.h:40
typename iterator_holder_type::iterator iterator
Iterator type.
Definition: Element.h:80
System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfObject > PdfObject
Definition: Element.h:253
Definition: signed_info.h:13
Class representing base element of logical structure.
Definition: Element.h:175
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Definition: AFRelationship.h:4
typename iterator_holder_type::virtualized_iterator_element virtualized_iterator_element
Virtualized element type.
Definition: Element.h:84
List forward declaration.
Definition: Artifact.h:74
Interface of object providing enumerator on contained elements.
Definition: Document.h:584
Root structure element.
Definition: Element.h:310
Class representing logical structure figure.
Definition: FigureElement.h:51
vector_t::iterator iterator
Iterator type.
Definition: list.h:145
typename iterator_holder_type::const_iterator const_iterator
Const iterator type.
Definition: Element.h:82
vector_t::const_iterator const_iterator
Const iterator type.
Definition: list.h:147
This value is used for internal purposes and is not intended to be used directly from your code...
Whole PDF file will be submitted.