Heading.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/shared_ptr.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/Text/TextFragment.h"
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 class Document;
15 class MarginInfo;
16 enum class NumberingStyle;
17 class Page;
18 class PageGenerator;
19 namespace Plugins
20 {
21 class TocGenerator;
22 } // namespace Plugins
23 class Rectangle;
24 namespace Text
25 {
26 class TextFragment;
27 class TextParagraph;
28 class TextSegment;
29 class TextState;
30 } // namespace Text
31 class TocInfo;
32 } // namespace Pdf
33 } // namespace Aspose
34 namespace System
35 {
36 namespace Collections
37 {
38 namespace Generic
39 {
40 template <typename> class List;
41 } // namespace Generic
42 } // namespace Collections
43 class String;
44 namespace Xml
45 {
46 class XmlReader;
47 class XmlTextWriter;
48 } // namespace Xml
49 } // namespace System
50 
51 namespace Aspose {
52 
53 namespace Pdf {
54 
58 class ASPOSE_PDF_SHARED_CLASS Heading final : public Aspose::Pdf::Text::TextFragment
59 {
60  typedef Heading ThisType;
62 
63  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
64  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
65 
66  friend class Aspose::Pdf::PageGenerator;
67  friend class Aspose::Pdf::Document;
69 
70 public:
71 
75  ASPOSE_PDF_SHARED_API const System::SharedPtr<Aspose::Pdf::Page>& get_TocPage() const;
79  ASPOSE_PDF_SHARED_API void set_TocPage(System::SharedPtr<Aspose::Pdf::Page> value);
83  ASPOSE_PDF_SHARED_API double get_Top() const;
87  ASPOSE_PDF_SHARED_API void set_Top(double value);
91  ASPOSE_PDF_SHARED_API int32_t get_StartNumber() const;
95  ASPOSE_PDF_SHARED_API void set_StartNumber(int32_t value);
99  ASPOSE_PDF_SHARED_API bool get_IsAutoSequence() const;
103  ASPOSE_PDF_SHARED_API void set_IsAutoSequence(bool value);
107  ASPOSE_PDF_SHARED_API bool get_IsInList() const;
111  ASPOSE_PDF_SHARED_API void set_IsInList(bool value);
115  ASPOSE_PDF_SHARED_API const System::SharedPtr<Aspose::Pdf::Page>& get_DestinationPage() const;
119  ASPOSE_PDF_SHARED_API void set_DestinationPage(System::SharedPtr<Aspose::Pdf::Page> value);
123  ASPOSE_PDF_SHARED_API int32_t get_Level() const;
127  ASPOSE_PDF_SHARED_API void set_Level(int32_t value);
131  ASPOSE_PDF_SHARED_API NumberingStyle get_Style() const;
135  ASPOSE_PDF_SHARED_API void set_Style(NumberingStyle value);
139  ASPOSE_PDF_SHARED_API const System::SharedPtr<Text::TextSegment>& get_UserLabel() const;
143  ASPOSE_PDF_SHARED_API void set_UserLabel(System::SharedPtr<Text::TextSegment> value);
144 
149  ASPOSE_PDF_SHARED_API Heading(int32_t level);
150 
155  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Clone() override;
160  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> CloneWithSegments() override;
161 
162 protected:
163 
168  static System::SharedPtr<TocInfo> get_DefaultTOC();
172  double get_Left() const;
176  void set_Left(double value);
180  System::SharedPtr<Text::TextSegment> get_Number() const;
181 
182  Heading();
183 
184  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Heading, CODEPORTING_ARGS());
185  System::String GetDashString();
192  ASPOSE_PDF_SHARED_API void Serialize(System::SharedPtr<System::Xml::XmlTextWriter> writer) override;
193  ASPOSE_PDF_SHARED_API void Deserialize(System::SharedPtr<System::Xml::XmlReader> reader) override;
194 
195  virtual ASPOSE_PDF_SHARED_API ~Heading();
196 
197 private:
198 
199  static System::SharedPtr<TocInfo> defaultTOC;
201  double tabstopDefaultInterval;
202  int32_t indexForLastFragment;
204  double pr_Left;
205  double pr_Top;
206  int32_t pr_StartNumber;
207  bool pr_IsAutoSequence;
208  bool pr_IsInList;
209  System::SharedPtr<Aspose::Pdf::Page> pr_DestinationPage;
210  int32_t pr_Level;
211  NumberingStyle pr_Style;
213 
214  bool IsFormatArrayCorrect(System::SharedPtr<TocInfo> tocInfo);
215  void ProcessLink(System::SharedPtr<Aspose::Pdf::Page> page, System::SharedPtr<MarginInfo> marginInfo, double width, double height, double curX, double curY);
216  void ProcessDots(System::SharedPtr<Text::TextParagraph>& paragraph, System::SharedPtr<Aspose::Pdf::Text::TextState> textState, double realWidth, System::SharedPtr<Aspose::Pdf::Page> page, float subsequentLinesIndent, System::SharedPtr<Aspose::Pdf::Rectangle> rect, int32_t& dotsCount);
219  void ProcessTabs(System::SharedPtr<Aspose::Pdf::Text::TextState> textState);
220  System::SharedPtr<Text::TextParagraph> ProcessHeadingToc(double curX, double curY, System::SharedPtr<Aspose::Pdf::Page> page, double realWidth, double width, System::SharedPtr<MarginInfo> marginInfo, System::SharedPtr<Aspose::Pdf::Rectangle> rect);
221 
222 };
223 
224 } // namespace Pdf
225 } // namespace Aspose
226 
227 
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
NumberingStyle
Enumeration of supported page numbering style for PageLabel class.
Definition: NumberingStyle.h:16
Represents fragment of Pdf text.
Definition: TextFragment.h:173
Class representing PDF document
Definition: Document.h:625
Definition: Artifact.h:67
Represents heading.
Definition: Heading.h:58
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.
means saving in XML format
Represents Aspose.PDF TocGenerator plugin.
Definition: TocGenerator.h:33
Definition: AFRelationship.h:4
Defies a method that enables object cloning - creating a copy of an object. Objects of this class sho...
Definition: icloneable.h:15
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
ASPOSE_PDF_SHARED_API System::SharedPtr< ResultContainer > Process(System::SharedPtr< IPluginOptions > options) override
Starts the PdfGenerator processing with the specified parameters.
Represents a abstract base object can be added to the page(doc.Paragraphs.Add()). ...
Definition: BaseParagraph.h:66
Whole PDF file will be submitted.