Run.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 <system/array.h>
12 
13 #include "Aspose.Words.Cpp/Model/Text/Inline.h"
14 
15 namespace Aspose { namespace Words { namespace Fields { class FieldQuoteUpdater; } } }
16 namespace Aspose { namespace Words { namespace ApsBuilder { namespace Dml { namespace Text { class DmlTextShapeToShapeConvertor; } } } } }
17 namespace Aspose { namespace Words { namespace ApsBuilder { namespace Math { class MathTextElement; } } } }
18 namespace Aspose { namespace Words { namespace Comparison { class ComparerNodeUtil; } } }
19 namespace Aspose { namespace Words { namespace Comparison { class StoryComparer; } } }
20 namespace Aspose { namespace Words { namespace Validation { class ComplexScriptRunUpdater; } } }
21 namespace Aspose { namespace Words { class DocumentInserter; } }
22 namespace Aspose { namespace Words { namespace Fields { class ToaEntry; } } }
23 namespace Aspose { namespace Words { class NodeEnumerator; } }
24 namespace Aspose { namespace Words { namespace Validation { namespace VmlToDml { class VmlShapeToDmlShapeConverter; } } } }
25 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Reader { class NrxRunReaderBase; } } } } }
26 namespace Aspose { namespace Words { namespace Replacing { class FindReplace; } } }
27 namespace Aspose { namespace Words { namespace Fields { class FieldAppender; } } }
28 namespace Aspose { namespace Words { namespace Fields { class FieldBarcodeUtil; } } }
29 namespace Aspose { namespace Words { namespace Revisions { class RevisionUtil; } } }
30 namespace Aspose { namespace Words { class Ruby; } }
31 namespace Aspose { namespace Words { namespace Fields { class FieldReplacer; } } }
32 namespace Aspose { namespace Words { namespace Fields { class FieldIndex; } } }
33 namespace Aspose { namespace Words { namespace Fields { class FieldTextHelper; } } }
34 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxBidiControlCharReader; } } } } }
35 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlRubyReader; } } } } }
36 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Writer { class NrxRunWriter; } } } } }
37 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxAltChunkReader; } } } } }
38 namespace Aspose { namespace Words { namespace Fields { class FieldSymbol; } } }
39 namespace Aspose { namespace Words { namespace Fields { class ParagraphTocEntry; } } }
40 namespace Aspose { namespace Words { namespace Fields { class TocEntryNodeModifier; } } }
41 namespace Aspose { namespace Words { namespace MailMerging { class TagReplacer; } } }
42 namespace Aspose { namespace Words { class NodeRange; } }
43 namespace Aspose { namespace Words { namespace Layout { class DocumentRunSplitter; } } }
44 namespace Aspose { namespace Words { class Bookmark; } }
45 namespace Aspose { namespace Words { namespace Fields { class NewResultEnumerator; } } }
46 namespace Aspose { namespace Words { class DocumentBuilder; } }
47 namespace Aspose { namespace Words { namespace Validation { class RubyConverter; } } }
48 namespace Aspose { namespace Words { namespace RW { namespace Txt { namespace Reader { class TxtFontSetter; } } } } }
49 namespace Aspose { namespace Words { namespace Fields { class FieldRefUtil; } } }
50 namespace Aspose { namespace Words { class RunPr; } }
51 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxDocumentWriterBase; } } } } }
52 namespace Aspose { namespace Words { namespace RW { class MiscRwUtil; } } }
53 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfSpecialFieldHandler; } } } } }
54 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtParagraphReader; } } } } }
55 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtFieldReader; } } } } }
56 namespace Aspose { namespace Words { class WordUtil; } }
57 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class ModelBuilder; } } } } }
58 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlReader; } } } } }
59 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtFootnoteWriter; } } } } }
60 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfPictureHandler; } } } } }
61 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfModelBuilder; } } } } }
62 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfOleHandler; } } } } }
63 namespace Aspose { namespace Words { class DocumentBase; } }
64 namespace Aspose { namespace Words { class DocumentVisitor; } }
65 
66 namespace Aspose {
67 
68 namespace Words {
69 
184 class ASPOSE_WORDS_SHARED_CLASS Run : public Aspose::Words::Inline
185 {
186  typedef Run ThisType;
188 
189  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
190  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
191 
192  FRIEND_FUNCTION_System_MakeObject;
193  friend class Aspose::Words::Fields::FieldQuoteUpdater;
194  friend class Aspose::Words::ApsBuilder::Dml::Text::DmlTextShapeToShapeConvertor;
195  friend class Aspose::Words::ApsBuilder::Math::MathTextElement;
196  friend class Aspose::Words::Comparison::ComparerNodeUtil;
197  friend class Aspose::Words::Comparison::StoryComparer;
198  friend class Aspose::Words::Validation::ComplexScriptRunUpdater;
199  friend class Aspose::Words::DocumentInserter;
200  friend class Aspose::Words::Fields::ToaEntry;
201  friend class Aspose::Words::NodeEnumerator;
202  friend class Aspose::Words::Validation::VmlToDml::VmlShapeToDmlShapeConverter;
203  friend class Aspose::Words::RW::Nrx::Reader::NrxRunReaderBase;
204  friend class Aspose::Words::Replacing::FindReplace;
205  friend class Aspose::Words::Fields::FieldAppender;
206  friend class Aspose::Words::Fields::FieldBarcodeUtil;
207  friend class Aspose::Words::Revisions::RevisionUtil;
208  friend class Aspose::Words::Ruby;
209  friend class Aspose::Words::Fields::FieldReplacer;
211  friend class Aspose::Words::Fields::FieldTextHelper;
212  friend class Aspose::Words::Fields::FieldTextHelper;
213  friend class Aspose::Words::RW::Docx::Reader::DocxBidiControlCharReader;
214  friend class Aspose::Words::RW::Html::Reader::HtmlRubyReader;
215  friend class Aspose::Words::RW::Nrx::Writer::NrxRunWriter;
216  friend class Aspose::Words::RW::Docx::Reader::DocxAltChunkReader;
218  friend class Aspose::Words::Fields::ParagraphTocEntry;
219  friend class Aspose::Words::Fields::TocEntryNodeModifier;
220  friend class Aspose::Words::MailMerging::TagReplacer;
221  friend class Aspose::Words::NodeRange;
222  friend class Aspose::Words::Layout::DocumentRunSplitter;
223  friend class Aspose::Words::Bookmark;
224  friend class Aspose::Words::Fields::NewResultEnumerator;
225  friend class Aspose::Words::DocumentBuilder;
226  friend class Aspose::Words::Validation::RubyConverter;
227  friend class Aspose::Words::RW::Txt::Reader::TxtFontSetter;
228  friend class Aspose::Words::Fields::FieldRefUtil;
229  friend class Aspose::Words::Inline;
230  friend class Aspose::Words::RunPr;
231  friend class Aspose::Words::RW::Docx::Writer::DocxDocumentWriterBase;
232  friend class Aspose::Words::RW::MiscRwUtil;
233  friend class Aspose::Words::RW::Rtf::Reader::RtfSpecialFieldHandler;
234  friend class Aspose::Words::RW::Odt::Reader::OdtParagraphReader;
235  friend class Aspose::Words::RW::Odt::Reader::OdtFieldReader;
236  friend class Aspose::Words::WordUtil;
237  friend class Aspose::Words::RW::Doc::Reader::ModelBuilder;
238  friend class Aspose::Words::RW::Html::Reader::HtmlReader;
239  friend class Aspose::Words::RW::Odt::Writer::OdtFootnoteWriter;
240  friend class Aspose::Words::RW::Rtf::Reader::RtfPictureHandler;
241  friend class Aspose::Words::RW::Rtf::Reader::RtfModelBuilder;
242  friend class Aspose::Words::RW::Rtf::Reader::RtfOleHandler;
243 
244 public:
245 
247  ASPOSE_WORDS_SHARED_API Aspose::Words::NodeType get_NodeType() const override;
300  ASPOSE_WORDS_SHARED_API System::String get_Text() const;
302  ASPOSE_WORDS_SHARED_API void set_Text(System::String value);
303 
396 
406  ASPOSE_WORDS_SHARED_API bool Accept(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor) override;
410  ASPOSE_WORDS_SHARED_API System::String GetText() override;
411 
412 protected:
413 
414  bool get_IsSymbolic();
415 
416  static System::ArrayPtr<int32_t>& KeysToIgnoreInComparisonOnJoinLtrRuns();
417  static System::ArrayPtr<int32_t>& KeysToIgnoreInComparisonOnJoinRtlRuns();
418 
420 
421  System::SharedPtr<Aspose::Words::Run> CutText(int32_t startIndex, int32_t length, bool isClone);
422  System::SharedPtr<Aspose::Words::Run> SplitBefore(int32_t leftPartLength);
423  System::SharedPtr<Aspose::Words::Run> SplitAfter(int32_t leftPartLength);
424  static bool IsSymbolicCharacter(System::String text);
425 
426  virtual ASPOSE_WORDS_SHARED_API ~Run();
427 
428 private:
429 
430  System::String mText;
431 
432  ThisType* CppMemberwiseClone() const override { return new ThisType(*this); }
433 
434 };
435 
436 }
437 }
Run(System::SharedPtr< Aspose::Words::DocumentBase > doc)
Initializes a new instance of the Run class.
@ Doc
Microsoft Word 95 or Word 97 - 2003 Document.
@ Odt
ODF Text Document.
@ FieldIndex
Specifies the INDEX field.
@ Html
Base class for all nodes of a Word document.
Definition: Node.h:287
@ Text
@ Nrx
Common modules that are shared between DOCX/WML reader/writer modules.
@ Dml
Drawing Markup Language is used to define the shape.
Run(System::SharedPtr< Aspose::Words::DocumentBase > doc, System::String text)
Initializes a new instance of the Run class.
Represents a single bookmark.
Definition: Bookmark.h:51
Implements the INDEX field.
Definition: FieldIndex.h:164
System::String get_Text() const
Gets or sets the text of the run.
@ Rtf
RTF format.
@ Words
@ FieldSymbol
Specifies the SYMBOL field.
void set_Text(System::String value)
Setter for Aspose::Words::Run::get_Text.
Provides methods to insert text, images and other content, specify font, paragraph and section format...
Definition: DocumentBuilder.h:257
@ Docx
Office Open XML WordprocessingML Document (macro-free).
NodeType
Specifies the type of a Word document node.
Definition: NodeType.h:45
Base class for inline-level nodes that can have character formatting associated with them,...
Definition: Inline.h:167
Implements a SYMBOL field.
Definition: FieldSymbol.h:82
@ Layout
Module that builds a document layout.
Aspose::Words::NodeType get_NodeType() const override
Returns NodeType.Run.
bool Accept(System::SharedPtr< Aspose::Words::DocumentVisitor > visitor) override
Accepts a visitor.
Represents a run of characters with the same font formatting.
Definition: Run.h:185
System::String GetText() override
Gets the text of the run.