Cell.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/string.h>
5 #include <system/icloneable.h>
6 #include <system/enum_helpers.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 enum class BorderCornerType;
16 class BorderInfo;
17 class Color;
18 enum class HorizontalAlignment;
19 class Image;
20 class MarginInfo;
21 class Operator;
22 class Page;
23 class Paragraphs;
24 class Rectangle;
25 class Row;
26 class Table;
27 namespace Tests
28 {
29 class RegressionTests_v21_11;
30 } // namespace Tests
31 namespace Text
32 {
33 class TextState;
34 } // namespace Text
35 enum class VerticalAlignment;
36 } // namespace Pdf
37 namespace Pub
38 {
39 class PdfConverter;
40 } // namespace Pub
41 } // namespace Aspose
42 namespace System
43 {
44 namespace Collections
45 {
46 namespace Generic
47 {
48 template <typename> class List;
49 } // namespace Generic
50 } // namespace Collections
51 namespace Xml
52 {
53 class XmlReader;
54 class XmlTextWriter;
55 } // namespace Xml
56 } // namespace System
57 
58 namespace Aspose {
59 
60 namespace Pdf {
61 
65 class ASPOSE_PDF_SHARED_CLASS Cell final : public System::ICloneable
66 {
67  typedef Cell ThisType;
69 
70  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
71  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
72 
73  friend class Aspose::Pdf::Row;
74  friend class Aspose::Pdf::Table;
75  friend class Aspose::Pdf::Tests::RegressionTests_v21_11;
76  friend class Aspose::Pub::PdfConverter;
77 
78 public:
79 
83  ASPOSE_PDF_SHARED_API bool get_IsNoBorder() const;
87  ASPOSE_PDF_SHARED_API void set_IsNoBorder(bool value);
91  ASPOSE_PDF_SHARED_API const System::SharedPtr<MarginInfo>& get_Margin() const;
95  ASPOSE_PDF_SHARED_API void set_Margin(System::SharedPtr<MarginInfo> value);
99  ASPOSE_PDF_SHARED_API const System::SharedPtr<BorderInfo>& get_Border() const;
103  ASPOSE_PDF_SHARED_API void set_Border(System::SharedPtr<BorderInfo> value);
107  ASPOSE_PDF_SHARED_API const System::SharedPtr<Color>& get_BackgroundColor() const;
111  ASPOSE_PDF_SHARED_API void set_BackgroundColor(System::SharedPtr<Color> value);
116  ASPOSE_PDF_SHARED_API System::String get_BackgroundImageFile() const;
121  ASPOSE_PDF_SHARED_API void set_BackgroundImageFile(System::String value);
125  ASPOSE_PDF_SHARED_API const System::SharedPtr<Image>& get_BackgroundImage() const;
129  ASPOSE_PDF_SHARED_API void set_BackgroundImage(System::SharedPtr<Image> value);
133  ASPOSE_PDF_SHARED_API HorizontalAlignment get_Alignment() const;
137  ASPOSE_PDF_SHARED_API void set_Alignment(HorizontalAlignment value);
141  ASPOSE_PDF_SHARED_API System::SharedPtr<Text::TextState> get_DefaultCellTextState();
145  ASPOSE_PDF_SHARED_API void set_DefaultCellTextState(System::SharedPtr<Text::TextState> value);
149  ASPOSE_PDF_SHARED_API bool get_IsOverrideByFragment() const;
153  ASPOSE_PDF_SHARED_API void set_IsOverrideByFragment(bool value);
157  ASPOSE_PDF_SHARED_API const System::SharedPtr<Aspose::Pdf::Paragraphs>& get_Paragraphs() const;
161  ASPOSE_PDF_SHARED_API void set_Paragraphs(System::SharedPtr<Aspose::Pdf::Paragraphs> value);
165  ASPOSE_PDF_SHARED_API bool get_IsWordWrapped() const;
169  ASPOSE_PDF_SHARED_API void set_IsWordWrapped(bool value);
173  ASPOSE_PDF_SHARED_API Aspose::Pdf::VerticalAlignment get_VerticalAlignment() const;
177  ASPOSE_PDF_SHARED_API void set_VerticalAlignment(Aspose::Pdf::VerticalAlignment value);
181  ASPOSE_PDF_SHARED_API int32_t get_ColSpan() const;
185  ASPOSE_PDF_SHARED_API void set_ColSpan(int32_t value);
189  ASPOSE_PDF_SHARED_API int32_t get_RowSpan() const;
193  ASPOSE_PDF_SHARED_API void set_RowSpan(int32_t value);
197  ASPOSE_PDF_SHARED_API double get_Width() const;
198 
203  ASPOSE_PDF_SHARED_API Cell(System::SharedPtr<Rectangle> rect);
207  ASPOSE_PDF_SHARED_API Cell();
208 
213  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Clone() override;
214 
215 protected:
216 
220  bool get_IsHorizontalAlignmentSet() const;
224  void set_IsHorizontalAlignmentSet(bool value);
228  int32_t get_ProcessedParagraphsCount() const;
232  bool get_IsNothingWrited() const;
236  void set_IsNothingWrited(bool value);
240  const System::SharedPtr<Rectangle>& get_Rect() const;
244  void set_Rect(System::SharedPtr<Rectangle> value);
248  ASPOSE_PDF_SHARED_API void set_Width(double value);
252  double get_Height() const;
256  void set_Height(double value);
260  bool get_IsHeightExceedSize() const;
264  void set_IsHeightExceedSize(bool value);
268  bool get_IsSpanAdditionalCell() const;
272  void set_IsSpanAdditionalCell(bool value);
276  bool get_IsLeftBorderOpened() const;
280  void set_IsLeftBorderOpened(bool value);
284  bool get_IsRightBorderOpened() const;
288  void set_IsRightBorderOpened(bool value);
292  bool get_IsInsertedInternally() const;
296  void set_IsInsertedInternally(bool value);
297 
301  bool CalculateHeight(System::SharedPtr<Table> table, System::SharedPtr<Page> page, double bottomY, double curY, bool isScaleParagraphs);
306  void ApplyCellTextParagraphs(System::SharedPtr<Text::TextState> textState);
307  void DrawBackGround(System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Operator>>> list, double roundedBorderRadius);
319  System::SharedPtr<Table> GetTableFromParagraphs();
320  void CalculateRoundedBorders(int32_t rowIndex, int32_t rowCount, int32_t cellIndex, int32_t cellCount);
321  void CalculateRect(double curX, double curY, System::SharedPtr<Row> row, System::SharedPtr<Table> table, int32_t i, double pureHeight);
322  void Serialize(System::SharedPtr<System::Xml::XmlTextWriter> writer);
323  void Deserialize(System::SharedPtr<System::Xml::XmlReader> reader);
324 
325 private:
326 
327  HorizontalAlignment alignment;
328  System::SharedPtr<Text::TextState> defaultCellTextState;
329  bool isPrevHeightExceedSize;
330  BorderCornerType cornerType;
331  bool pr_IsHorizontalAlignmentSet;
332  bool pr_IsNoBorder;
335  System::SharedPtr<Color> pr_BackgroundColor;
336  System::String pr_BackgroundImageFile;
337  System::SharedPtr<Image> pr_BackgroundImage;
338  bool pr_IsOverrideByFragment;
340  int32_t pr_ProcessedParagraphsCount;
341 
345  void set_ProcessedParagraphsCount(int32_t value);
346 
347  bool pr_IsNothingWrited;
348  bool pr_IsWordWrapped;
350  Aspose::Pdf::VerticalAlignment pr_VerticalAlignment;
351  int32_t pr_ColSpan;
352  int32_t pr_RowSpan;
353  double pr_Width;
354  double pr_Height;
355  bool pr_IsHeightExceedSize;
356  bool pr_IsSpanAdditionalCell;
357  bool pr_IsLeftBorderOpened;
358  bool pr_IsRightBorderOpened;
359  bool pr_IsInsertedInternally;
360 
362 
363 };
364 
365 } // namespace Pdf
366 } // namespace Aspose
367 
368 
VerticalAlignment
Enumeration of possible vertical alignment values.
Definition: VerticalAlignment.h:16
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
Definition: Artifact.h:67
HorizontalAlignment
Describes horizontal alignment.
Definition: HorizontalAlignment.h:16
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.
means saving in XML format
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
Represents a row of the table.
Definition: Row.h:53
Represents a cell of the table&#39;s row.
Definition: Cell.h:65
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
means saving without change of format, i.e. as PDF use it please instead of &#39;SaveFormat.None&#39;, that is obsolete one
Represents a table that can be added to the page.
Definition: Table.h:86
Whole PDF file will be submitted.