Cell.h
1 // Copyright 2001-2020 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
9 #pragma once
10 
11 #include "Aspose.Words.Cpp/Model/Revisions/ITrackableNode.h"
12 #include "Aspose.Words.Cpp/Model/Nodes/CompositeNode.h"
13 #include "Aspose.Words.Cpp/Model/Formatting/ICellAttrSource.h"
14 
15 namespace Aspose { namespace Words { namespace Themes { class ThemeColorRemover; } } }
16 namespace Aspose { namespace Words { namespace Comparison { class FormattingComparer; } } }
17 namespace Aspose { namespace Words { namespace Comparison { class RowComparer; } } }
18 namespace Aspose { namespace Words { namespace Comparison { class TableComparer; } } }
19 namespace Aspose { namespace Words { namespace Themes { class ThemeColorUpdater; } } }
20 namespace Aspose { namespace Words { class DocumentInserter; } }
21 namespace Aspose { namespace Words { namespace Formatting { namespace Intern { class InternManager; } } } }
22 namespace Aspose { namespace Words { namespace Tables { class DocRtfGridHandler; } } }
23 namespace Aspose { namespace Words { namespace Tables { class TableMerger; } } }
24 namespace Aspose { namespace Words { namespace RW { namespace Markdown { namespace Writer { class MarkdownTableWriter; } } } } }
25 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Reader { class NrxCellReaderBase; } } } } }
26 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Css { namespace New { class DocumentFormatter; } } } } } }
27 namespace Aspose { namespace Words { class RevisionGroupCollection; } }
28 namespace Aspose { namespace Words { namespace Drawing { class ShapeSizeValidationHelper; } } }
29 namespace Aspose { namespace Words { namespace Fields { namespace Expressions { class FieldContext; } } } }
30 namespace Aspose { namespace Words { namespace Revisions { class RevisionUtil; } } }
31 namespace Aspose { namespace Words { namespace Tables { class CellSpan; } } }
32 namespace Aspose { namespace Words { namespace Tables { class RowSpan; } } }
33 namespace Aspose { namespace Words { namespace Tables { class FixedGridCalculator; } } }
34 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Writer { class TablePrWriter; } } } } }
35 namespace Aspose { namespace Words { namespace Fields { namespace Expressions { class OneDimensionCellRangeEnumerator; } } } }
36 namespace Aspose { namespace Words { namespace Fields { namespace Expressions { class UpDownCellRangeEnumerator; } } } }
37 namespace Aspose { namespace Words { namespace Markup { class StructuredDocumentTag; } } }
38 namespace Aspose { namespace Words { class NodeUtil; } }
39 namespace Aspose { namespace Words { namespace Layout { class AttributeConverter; } } }
40 namespace Aspose { namespace Words { namespace Layout { namespace Core { class SpanGenerator; } } } }
41 namespace Aspose { namespace Words { namespace Fields { namespace Expressions { class CellPosition; } } } }
42 namespace Aspose { namespace Words { namespace Fields { class NewResultEnumerator; } } }
43 namespace Aspose { namespace Words { class TableStyle; } }
44 namespace Aspose { namespace Words { namespace TableLayout { class Extensions; } } }
45 namespace Aspose { namespace Words { namespace Tables { class TableFormattingExpander; } } }
46 namespace Aspose { namespace Words { class DocumentBuilder; } }
47 namespace Aspose { namespace Words { namespace Validation { class DocumentPostLoader; } } }
48 namespace Aspose { namespace Words { namespace Validation { class DocumentValidator; } } }
49 namespace Aspose { namespace Words { class TableBuilder; } }
50 namespace Aspose { namespace Words { namespace Validation { class TableValidator; } } }
51 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Css { namespace New { class CssBackgroundColorPropertyDef; } } } } } }
52 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlTableWriter; } } } } }
53 namespace Aspose { namespace Words { namespace RW { namespace MarkupLanguage { namespace Writer { class MarkupLanguageTableWriterBase; } } } } }
54 namespace Aspose { namespace Words { namespace RW { namespace MarkupLanguage { namespace Writer { class MarkupLanguageDocumentTreeWriter; } } } } }
55 namespace Aspose { namespace Words { namespace RW { class MarkupResolver; } } }
56 namespace Aspose { namespace Words { namespace Lists { class ListLabelUtil; } } }
57 namespace Aspose { namespace Words { namespace TableLayout { class TableLayouter; } } }
58 namespace Aspose { namespace Words { namespace Tables { class CellCollection; } } }
59 namespace Aspose { namespace Words { namespace Tables { class Row; } } }
60 namespace Aspose { namespace Words { namespace Tables { class Table; } } }
61 namespace Aspose { namespace Words { class InlineHelper; } }
62 namespace Aspose { namespace Words { class Paragraph; } }
63 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxDocumentWriterBase; } } } } }
64 namespace Aspose { namespace Words { namespace RW { namespace Nrx { class NrxTableGrid; } } } }
65 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtTableCellReader; } } } } }
66 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtTableReader; } } } } }
67 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtParagraphReader; } } } } }
68 namespace Aspose { namespace Words { namespace RW { namespace Celler { class CellerTable; } } } }
69 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class ModelBuilder; } } } } }
70 namespace Aspose { namespace Words { namespace RW { namespace Html { class CssTable; } } } }
71 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlReader; } } } } }
72 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlTableReader; } } } } }
73 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtTextPropertiesWriter; } } } } }
74 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtCellPropertiesWriter; } } } } }
75 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtTableWriter; } } } } }
76 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtParagraphPropertiesWriter; } } } } }
77 namespace Aspose { namespace Words { namespace RW { namespace Txt { namespace Writer { class TxtTableBuilder; } } } } }
78 namespace Aspose { namespace Words { namespace Tables { class TableGridFromCellWidth; } } }
79 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfModelBuilder; } } } } }
80 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfTableDefWriter; } } } } }
81 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfWriter; } } } } }
82 namespace Aspose { namespace Words { namespace RW { namespace Txt { namespace Writer { class TxtWriter; } } } } }
83 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlRunPrReader; } } } } }
84 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlWriter; } } } } }
85 namespace Aspose { namespace Words { namespace Tables { class CellFormat; } } }
86 namespace Aspose { namespace Words { class ParagraphCollection; } }
87 namespace Aspose { namespace Words { namespace Tables { class TableCollection; } } }
88 namespace Aspose { namespace Words { namespace Tables { class CellPr; } } }
89 namespace Aspose { namespace Words { namespace Revisions { class EditRevision; } } }
90 namespace Aspose { namespace Words { namespace Revisions { class MoveRevision; } } }
91 namespace Aspose { namespace Words { class DocumentBase; } }
92 namespace Aspose { namespace Words { class Node; } }
93 namespace Aspose { namespace Words { class INodeCloningListener; } }
94 namespace Aspose { namespace Words { class DocumentVisitor; } }
95 namespace Aspose { namespace Words { enum class VisitorAction; } }
96 
97 namespace Aspose {
98 
99 namespace Words {
100 
101 namespace Tables {
102 
113 class Cell : public Aspose::Words::CompositeNode, public Aspose::Words::ICellAttrSource, public Aspose::Words::Revisions::ITrackableNode
114 {
115  typedef Cell ThisType;
117  typedef Aspose::Words::ICellAttrSource BaseType1;
118  typedef Aspose::Words::Revisions::ITrackableNode BaseType2;
119 
120  typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2> ThisTypeBaseTypesInfo;
121  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
122 
123  FRIEND_FUNCTION_System_MakeObject;
124  friend class Aspose::Words::Themes::ThemeColorRemover;
125  friend class Aspose::Words::Comparison::FormattingComparer;
126  friend class Aspose::Words::Comparison::RowComparer;
127  friend class Aspose::Words::Comparison::TableComparer;
128  friend class Aspose::Words::Themes::ThemeColorUpdater;
129  friend class Aspose::Words::DocumentInserter;
130  friend class Aspose::Words::Formatting::Intern::InternManager;
131  friend class Aspose::Words::Tables::DocRtfGridHandler;
132  friend class Aspose::Words::Tables::TableMerger;
133  friend class Aspose::Words::RW::Markdown::Writer::MarkdownTableWriter;
134  friend class Aspose::Words::RW::Nrx::Reader::NrxCellReaderBase;
135  friend class Aspose::Words::RW::Html::Css::New::DocumentFormatter;
137  friend class Aspose::Words::Drawing::ShapeSizeValidationHelper;
138  friend class Aspose::Words::Fields::Expressions::FieldContext;
139  friend class Aspose::Words::Revisions::RevisionUtil;
140  friend class Aspose::Words::Tables::CellSpan;
141  friend class Aspose::Words::Tables::RowSpan;
142  friend class Aspose::Words::Tables::FixedGridCalculator;
143  friend class Aspose::Words::RW::Doc::Writer::TablePrWriter;
144  friend class Aspose::Words::Fields::Expressions::OneDimensionCellRangeEnumerator;
145  friend class Aspose::Words::Fields::Expressions::UpDownCellRangeEnumerator;
147  friend class Aspose::Words::NodeUtil;
148  friend class Aspose::Words::Layout::AttributeConverter;
149  friend class Aspose::Words::Layout::Core::SpanGenerator;
150  friend class Aspose::Words::Fields::Expressions::CellPosition;
151  friend class Aspose::Words::Fields::NewResultEnumerator;
152  friend class Aspose::Words::TableStyle;
153  friend class Aspose::Words::TableLayout::Extensions;
154  friend class Aspose::Words::Tables::TableFormattingExpander;
155  friend class Aspose::Words::DocumentBuilder;
156  friend class Aspose::Words::Validation::DocumentPostLoader;
157  friend class Aspose::Words::Validation::DocumentValidator;
158  friend class Aspose::Words::TableBuilder;
159  friend class Aspose::Words::Validation::TableValidator;
160  friend class Aspose::Words::RW::Html::Css::New::CssBackgroundColorPropertyDef;
161  friend class Aspose::Words::RW::Html::Writer::HtmlTableWriter;
162  friend class Aspose::Words::RW::MarkupLanguage::Writer::MarkupLanguageTableWriterBase;
163  friend class Aspose::Words::RW::MarkupLanguage::Writer::MarkupLanguageDocumentTreeWriter;
164  friend class Aspose::Words::RW::MarkupResolver;
165  friend class Aspose::Words::Lists::ListLabelUtil;
166  friend class Aspose::Words::TableLayout::TableLayouter;
168  friend class Aspose::Words::Tables::Row;
169  friend class Aspose::Words::Tables::Table;
170  friend class Aspose::Words::InlineHelper;
171  friend class Aspose::Words::Paragraph;
172  friend class Aspose::Words::RW::Docx::Writer::DocxDocumentWriterBase;
173  friend class Aspose::Words::RW::Nrx::NrxTableGrid;
174  friend class Aspose::Words::RW::Odt::Reader::OdtTableCellReader;
175  friend class Aspose::Words::RW::Odt::Reader::OdtTableReader;
176  friend class Aspose::Words::RW::Odt::Reader::OdtParagraphReader;
177  friend class Aspose::Words::RW::Celler::CellerTable;
178  friend class Aspose::Words::RW::Doc::Reader::ModelBuilder;
179  friend class Aspose::Words::RW::Html::CssTable;
180  friend class Aspose::Words::RW::Html::Reader::HtmlReader;
181  friend class Aspose::Words::RW::Html::Reader::HtmlTableReader;
182  friend class Aspose::Words::RW::Odt::Writer::OdtTextPropertiesWriter;
183  friend class Aspose::Words::RW::Odt::Writer::OdtCellPropertiesWriter;
184  friend class Aspose::Words::RW::Odt::Writer::OdtTableWriter;
185  friend class Aspose::Words::RW::Odt::Writer::OdtParagraphPropertiesWriter;
186  friend class Aspose::Words::RW::Txt::Writer::TxtTableBuilder;
187  friend class Aspose::Words::Tables::TableGridFromCellWidth;
188  friend class Aspose::Words::RW::Rtf::Reader::RtfModelBuilder;
189  friend class Aspose::Words::RW::Rtf::Writer::RtfTableDefWriter;
190  friend class Aspose::Words::RW::Rtf::Writer::RtfWriter;
191  friend class Aspose::Words::RW::Txt::Writer::TxtWriter;
192  friend class Aspose::Words::RW::Wml::Reader::WmlRunPrReader;
193  friend class Aspose::Words::RW::Wml::Writer::WmlWriter;
194 
195 public:
196  using Aspose::Words::CompositeNode::Clone;
197 
198 public:
199 
203  virtual ASPOSE_WORDS_SHARED_API Aspose::Words::NodeType get_NodeType() const;
204 
210 
215 
220 
224  ASPOSE_WORDS_SHARED_API bool get_IsFirstCell();
225 
229  ASPOSE_WORDS_SHARED_API bool get_IsLastCell();
230 
235 
240 
245  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Revisions::EditRevision> get_InsertRevision();
246  ASPOSE_WORDS_SHARED_API void set_InsertRevision(System::SharedPtr<Aspose::Words::Revisions::EditRevision> value);
247  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Revisions::EditRevision> get_DeleteRevision();
248  ASPOSE_WORDS_SHARED_API void set_DeleteRevision(System::SharedPtr<Aspose::Words::Revisions::EditRevision> value);
249  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Revisions::MoveRevision> get_MoveFromRevision();
250  ASPOSE_WORDS_SHARED_API void set_MoveFromRevision(System::SharedPtr<Aspose::Words::Revisions::MoveRevision> value);
251  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Revisions::MoveRevision> get_MoveToRevision();
252  ASPOSE_WORDS_SHARED_API void set_MoveToRevision(System::SharedPtr<Aspose::Words::Revisions::MoveRevision> value);
253 
265 
279  virtual ASPOSE_WORDS_SHARED_API bool Accept(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor);
280 
284  ASPOSE_WORDS_SHARED_API void EnsureMinimum();
285  ASPOSE_WORDS_SHARED_API System::SharedPtr<System::Object> GetDirectCellAttr(int32_t key);
286  ASPOSE_WORDS_SHARED_API System::SharedPtr<System::Object> FetchCellAttr(int32_t key);
287  ASPOSE_WORDS_SHARED_API System::SharedPtr<System::Object> FetchInheritedCellAttr(int32_t key);
288  ASPOSE_WORDS_SHARED_API void SetCellAttr(int32_t key, System::SharedPtr<System::Object> value);
289  ASPOSE_WORDS_SHARED_API void ClearCellAttrs();
290 
291 protected:
292 
296  int32_t get_ColumnIndex();
297  int32_t get_RowIndex();
300 
302 
303  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> Clone(bool isCloneChildren, System::SharedPtr<Aspose::Words::INodeCloningListener> cloningListener);
304  virtual ASPOSE_WORDS_SHARED_API Aspose::Words::VisitorAction AcceptStart(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor);
305  virtual ASPOSE_WORDS_SHARED_API Aspose::Words::VisitorAction AcceptEnd(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor);
306  virtual ASPOSE_WORDS_SHARED_API bool CanInsert(System::SharedPtr<Aspose::Words::Node> newChild);
307  System::SharedPtr<System::Object> GetInheritedCellAttr(int32_t key);
309 
310  virtual ASPOSE_WORDS_SHARED_API ~Cell();
311 
312  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
313 
314 private:
315 
320 
321  void ExpandAttr(int32_t key, System::SharedPtr<Aspose::Words::Tables::CellPr> dstCellPr);
322  ThisType* CppMemberwiseClone() const override { return new ThisType(*this); }
323 
324 };
325 
326 }
327 }
328 }
@ Doc
Microsoft Word 95 or Word 97 - 2003 Document.
System::Details::SharedMembersType shared_members_type
@ Odt
ODF Text Document.
@ Html
Base class for all nodes of a Word document.
Definition: Node.h:212
Represents a structured document tag (SDT or content control) in a document.
Definition: StructuredDocumentTag.h:96
@ Nrx
Common modules that are shared between DOCX/WML reader/writer modules.
System::SharedPtr< Aspose::Words::Tables::Row > get_ParentRow()
Returns the parent row of the cell.
Formatting
@ Rtf
RTF format.
@ Words
virtual bool Accept(System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)
Accepts a visitor.
System::SharedPtr< Aspose::Words::Tables::CellFormat > get_CellFormat()
Provides access to the formatting properties of the cell.
@ New
Other document is used as a base during comparison.
virtual Aspose::Words::NodeType get_NodeType() const
Returns NodeType.Cell.
Base class for nodes that can contain other nodes.
Definition: CompositeNode.h:133
Represents a table style.
Definition: TableStyle.h:68
@ StructuredDocumentTag
Provides methods to insert text, images and other content, specify font, paragraph and section format...
Definition: DocumentBuilder.h:130
Represents a table in a Word document.
Definition: Table.h:92
@ Docx
Office Open XML WordprocessingML Document (macro-free).
NodeType
Specifies the type of a Word document node.
Definition: NodeType.h:23
System::SharedPtr< Aspose::Words::Tables::TableCollection > get_Tables()
Gets a collection of tables that are immediate children of the cell.
bool get_IsFirstCell()
True if this is the first cell inside a row; false otherwise.
System::SharedPtr< Aspose::Words::Paragraph > get_LastParagraph()
Gets the last paragraph among the immediate children.
Represents a table cell.
Definition: Cell.h:114
Represents a paragraph of text.
Definition: Paragraph.h:218
System::SharedPtr< Aspose::Words::Paragraph > get_FirstParagraph()
Gets the first paragraph among the immediate children.
@ Markdown
Markdown text document.
Provides typed access to a collection of Cell nodes.
Definition: CellCollection.h:28
@ Node
@ Tables
@ Layout
Module that builds a document layout.
Represents a table row.
Definition: Row.h:100
bool get_IsLastCell()
True if this is the last cell inside a row; false otherwise.
Cell(System::SharedPtr< Aspose::Words::DocumentBase > doc)
Initializes a new instance of the Cell class.
System::SharedPtr< Aspose::Words::ParagraphCollection > get_Paragraphs()
Gets a collection of paragraphs that are immediate children of the cell.
@ Paragraph
Specifies that the building block shall be inserted into its own paragraph.
VisitorAction
Allows the visitor to control the enumeration of nodes.
Definition: VisitorAction.h:23
void EnsureMinimum()
If the last child is not a paragraph, creates and appends one empty paragraph.
A collection of RevisionGroup objects that represent revision groups in the document.
Definition: RevisionGroupCollection.h:43