Provides the abstract base class for a main document and a glossary document of a Word document. More...
#include "Aspose.Words.Cpp/Model/Document/DocumentBase.h"
Inherits Aspose::Words::CompositeNode.
Inherited by Aspose::Words::BuildingBlocks::GlossaryDocument, and Aspose::Words::Document.
Public Member Functions | |
virtual System::SharedPtr< Aspose::Words::DocumentBase > | get_Document () |
Gets the document to which this node belongs. More... | |
System::SharedPtr< Aspose::Words::INodeChangingCallback > | get_NodeChangingCallback () |
Called when a node is inserted or removed in the document. More... | |
void | set_NodeChangingCallback (System::SharedPtr< Aspose::Words::INodeChangingCallback > value) |
Setter for Aspose::Words::DocumentBase::get_NodeChangingCallback. More... | |
System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > | get_ResourceLoadingCallback () const |
Allows to control how external resources are loaded. More... | |
void | set_ResourceLoadingCallback (System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > value) |
Setter for Aspose::Words::DocumentBase::get_ResourceLoadingCallback. More... | |
System::SharedPtr< Aspose::Words::Fonts::FontInfoCollection > | get_FontInfos () const |
Provides access to properties of fonts used in this document. More... | |
System::SharedPtr< Aspose::Words::StyleCollection > | get_Styles () const |
Returns a collection of styles defined in the document. More... | |
System::SharedPtr< Aspose::Words::Lists::ListCollection > | get_Lists () const |
Provides access to the list formatting used in the document. More... | |
System::SharedPtr< Aspose::Words::IWarningCallback > | get_WarningCallback () const |
Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss. More... | |
void | set_WarningCallback (System::SharedPtr< Aspose::Words::IWarningCallback > value) |
Setter for Aspose::Words::DocumentBase::get_WarningCallback. More... | |
System::SharedPtr< Aspose::Words::Drawing::Shape > | get_BackgroundShape () const |
Gets or sets the background shape of the document. Can be null. More... | |
void | set_BackgroundShape (System::SharedPtr< Aspose::Words::Drawing::Shape > value) |
Setter for Aspose::Words::DocumentBase::get_BackgroundShape. More... | |
System::Drawing::Color | get_PageColor () |
Gets or sets the page color of the document. This property is a simpler version of Aspose::Words::DocumentBase::get_BackgroundShape. More... | |
void | set_PageColor (System::Drawing::Color value) |
Setter for Aspose::Words::DocumentBase::get_PageColor. More... | |
System::SharedPtr< Aspose::Words::Node > | ImportNode (System::SharedPtr< Aspose::Words::Node > srcNode, bool isImportChildren) |
System::SharedPtr< Aspose::Words::Node > | ImportNode (System::SharedPtr< Aspose::Words::Node > srcNode, bool isImportChildren, Aspose::Words::ImportFormatMode importFormatMode) |
![]() | |
virtual bool | get_IsComposite () |
Returns true as this node can have child nodes. More... | |
bool | get_HasChildNodes () |
Returns true if this node has any child nodes. More... | |
System::SharedPtr< Aspose::Words::NodeCollection > | get_ChildNodes () |
Gets all immediate child nodes of this node. More... | |
System::SharedPtr< Aspose::Words::Node > | get_FirstChild () const |
Gets the first child of the node. More... | |
System::SharedPtr< Aspose::Words::Node > | get_LastChild () const |
Gets the last child of the node. More... | |
int32_t | get_Count () |
Gets the number of immediate children of this node. More... | |
System::SharedPtr< Aspose::Words::CompositeNode > | get_Container () |
virtual | ~CompositeNode () |
virtual System::String | GetText () |
Gets the text of this node and of all its children. More... | |
System::SharedPtr< Aspose::Words::NodeCollection > | GetChildNodes (Aspose::Words::NodeType nodeType, bool isDeep) |
Returns a live collection of child nodes that match the specified type. More... | |
System::SharedPtr< Aspose::Words::Node > | GetChild (Aspose::Words::NodeType nodeType, int32_t index, bool isDeep) |
Returns an Nth child node that matches the specified type. More... | |
System::SharedPtr< Aspose::Words::NodeList > | SelectNodes (System::String xpath) |
Selects a list of nodes matching the XPath expression. More... | |
System::SharedPtr< Aspose::Words::Node > | SelectSingleNode (System::String xpath) |
Selects the first Node that matches the XPath expression. More... | |
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Aspose::Words::Node > > > | GetEnumerator () |
Provides support for the for each style iteration over the child nodes of this node. More... | |
System::SharedPtr< Aspose::Words::Node > | AppendChild (System::SharedPtr< Aspose::Words::Node > newChild) |
Adds the specified node to the end of the list of child nodes for this node. More... | |
System::SharedPtr< Aspose::Words::Node > | PrependChild (System::SharedPtr< Aspose::Words::Node > newChild) |
Adds the specified node to the beginning of the list of child nodes for this node. More... | |
System::SharedPtr< Aspose::Words::Node > | InsertAfter (System::SharedPtr< Aspose::Words::Node > newChild, System::SharedPtr< Aspose::Words::Node > refChild) |
Inserts the specified node immediately after the specified reference node. More... | |
System::SharedPtr< Aspose::Words::Node > | InsertBefore (System::SharedPtr< Aspose::Words::Node > newChild, System::SharedPtr< Aspose::Words::Node > refChild) |
Inserts the specified node immediately before the specified reference node. More... | |
System::SharedPtr< Aspose::Words::Node > | RemoveChild (System::SharedPtr< Aspose::Words::Node > oldChild) |
Removes the specified child node. More... | |
void | RemoveAllChildren () |
Removes all the child nodes of the current node. More... | |
void | RemoveSmartTags () |
Removes all Aspose::Words::Markup::SmartTag descendant nodes of the current node. More... | |
int32_t | IndexOf (System::SharedPtr< Aspose::Words::Node > child) |
Returns the index of the specified child node in the child node array. More... | |
System::SharedPtr< Aspose::Words::Node > | GetNextMatchingNode (System::SharedPtr< Aspose::Words::Node > &curNode) |
![]() | |
virtual Aspose::Words::NodeType | get_NodeType () const =0 |
Gets the type of this node. More... | |
System::SharedPtr< Aspose::Words::CompositeNode > | get_ParentNode () |
Gets the immediate parent of this node. More... | |
System::SharedPtr< Aspose::Words::Node > | get_PreviousSibling () |
Gets the node immediately preceding this node. More... | |
System::SharedPtr< Aspose::Words::Node > | get_NextSibling () |
Gets the node immediately following this node. More... | |
System::SharedPtr< Aspose::Words::Range > | get_Range () |
Returns a Range object that represents the portion of a document that is contained in this node. More... | |
System::SharedPtr< Aspose::Words::Node > | Clone (bool isCloneChildren) |
virtual bool | Accept (System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)=0 |
Accepts a visitor. More... | |
template<typename T > | |
T | GetAncestorOf () |
System::SharedPtr< Aspose::Words::CompositeNode > | GetAncestor (Aspose::Words::NodeType ancestorType) |
Gets the first ancestor of the specified Aspose::Words::NodeType. More... | |
void | Remove () |
Removes itself from the parent. More... | |
System::SharedPtr< Aspose::Words::Node > | NextPreOrder (System::SharedPtr< Aspose::Words::Node > rootNode) |
Gets next node according to the pre-order tree traversal algorithm. More... | |
System::SharedPtr< Aspose::Words::Node > | PreviousPreOrder (System::SharedPtr< Aspose::Words::Node > rootNode) |
Gets the previous node according to the pre-order tree traversal algorithm. More... | |
System::String | ToString (Aspose::Words::SaveFormat saveFormat) |
Exports the content of the node into a string in the specified format. More... | |
System::String | ToString (System::SharedPtr< Aspose::Words::Saving::SaveOptions > saveOptions) |
Exports the content of the node into a string using the specified save options. More... | |
![]() | |
Object () | |
Creates object. Initializes all internal data structures. More... | |
virtual | ~Object () |
Destroys object. Frees all internal data structures. More... | |
Object (Object const &x) | |
Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More... | |
Object & | operator= (Object const &x) |
Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More... | |
Object * | SharedRefAdded () |
Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
int | SharedRefRemovedSafe () |
Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
int | RemovedSharedRefs (int count) |
Decreases shared reference count by specified value. More... | |
Detail::SmartPtrCounter * | WeakRefAdded () |
Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
void | WeakRefRemoved () |
Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
Detail::SmartPtrCounter * | GetCounter () |
Gets reference counter data structure associated with the object. More... | |
int | SharedCount () const |
Gets current value of shared refernce counter. More... | |
void | Lock () |
Implements C# lock() statement locking. Call directly or use LockContext sentry object. More... | |
void | Unlock () |
Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More... | |
virtual bool | Equals (ptr obj) |
Compares objects using C# Object.Equals semantics. More... | |
virtual int | GetHashCode () const |
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More... | |
virtual String | ToString () ASPOSE_CONST |
Analog of C# Object.ToString() method. Enables converting custom objects to string. More... | |
virtual ptr | MemberwiseClone () const |
Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More... | |
virtual const TypeInfo & | GetType () const |
Gets actual type of object. Analog of C# System.Object.GetType() call. More... | |
virtual bool | Is (const TypeInfo &targetType) const |
Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More... | |
virtual void | SetTemplateWeakPtr (unsigned int argument) |
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More... | |
Additional Inherited Members | |
![]() | |
typedef SmartPtr< Object > | ptr |
Alias for smart pointer type. More... | |
typedef System::Details::SharedMembersType | shared_members_type |
structure to keep list of shared pointers contained in object. More... | |
![]() | |
typedef IEnumerator< System::SharedPtr< Aspose::Words::Node > > | IEnumeratorType |
Enumerator type. More... | |
![]() | |
static System::String | NodeTypeToString (Aspose::Words::NodeType nodeType) |
A utility method that converts a node type enum value into a user friendly string. More... | |
![]() | |
static bool | ReferenceEquals (ptr const &objA, ptr const &objB) |
Compares objects by reference. More... | |
template<typename T > | |
static std::enable_if<!IsSmartPtr< T >::value, bool >::type | ReferenceEquals (T const &objA, T const &objB) |
Compares objects by reference. More... | |
template<typename T > | |
static std::enable_if<!IsSmartPtr< T >::value, bool >::type | ReferenceEquals (T const &objA, std::nullptr_t) |
Reference-compares value type object with nullptr. More... | |
template<typename T1 , typename T2 > | |
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type | Equals (T1 const &objA, T2 const &objB) |
Compares reference type objects in C# style. More... | |
template<typename T1 , typename T2 > | |
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type | Equals (T1 const &objA, T2 const &objB) |
Compares value type objects in C# style. More... | |
static const TypeInfo & | Type () |
Impleemnts C# typeof(System.Object) construct. More... | |
template<> | |
bool | Equals (float const &objA, float const &objB) |
template<> | |
bool | Equals (double const &objA, double const &objB) |
template<> | |
bool | ReferenceEquals (String const &str, std::nullptr_t) |
template<> | |
bool | ReferenceEquals (String const &str1, String const &str2) |
Provides the abstract base class for a main document and a glossary document of a Word document.
Aspose.Words represents a Word document as a tree of nodes. Aspose::Words::DocumentBase is a root node of the tree that contains all other nodes of the document.
Aspose::Words::DocumentBase also stores document-wide information such as Aspose::Words::DocumentBase::get_Styles and Aspose::Words::DocumentBase::get_Lists that the tree nodes might refer to.
System::SharedPtr<Aspose::Words::Drawing::Shape> Aspose::Words::DocumentBase::get_BackgroundShape | ( | ) | const |
Gets or sets the background shape of the document. Can be null.
Microsoft Word allows only a shape that has its Aspose::Words::Drawing::ShapeBase::get_ShapeType property equal to Aspose::Words::Drawing::ShapeType::Rectangle to be used as a background shape for a document.
Microsoft Word supports only the fill properties of a background shape. All other properties are ignored.
Setting this property to a non-null value will also set the Aspose::Words::Settings::ViewOptions::get_DisplayBackgroundShape to true.
|
virtual |
Gets the document to which this node belongs.
The node always belongs to a document even if it has just been created and not yet added to the tree, or if it has been removed from the tree.
Reimplemented from Aspose::Words::Node.
System::SharedPtr<Aspose::Words::Fonts::FontInfoCollection> Aspose::Words::DocumentBase::get_FontInfos | ( | ) | const |
Provides access to properties of fonts used in this document.
This collection of font definitions is loaded as is from the document. Font definitions might be optional, missing or incomplete in some documents.
Do not rely on this collection to ascertain that a particular font is used in the document. You should only use this collection to get information about fonts that might be used in the document.
System::SharedPtr<Aspose::Words::Lists::ListCollection> Aspose::Words::DocumentBase::get_Lists | ( | ) | const |
Provides access to the list formatting used in the document.
For more information see the description of the Aspose::Words::Lists::ListCollection class.
System::SharedPtr<Aspose::Words::INodeChangingCallback> Aspose::Words::DocumentBase::get_NodeChangingCallback | ( | ) |
Called when a node is inserted or removed in the document.
System::Drawing::Color Aspose::Words::DocumentBase::get_PageColor | ( | ) |
Gets or sets the page color of the document. This property is a simpler version of Aspose::Words::DocumentBase::get_BackgroundShape.
This property provides a simple way to specify a solid page color for the document. Setting this property creates and sets an appropriate Aspose::Words::DocumentBase::get_BackgroundShape.
If the page color is not set (e.g. there is no background shape in the document) returns System::Drawing::Color::Empty.
System::SharedPtr<Aspose::Words::Loading::IResourceLoadingCallback> Aspose::Words::DocumentBase::get_ResourceLoadingCallback | ( | ) | const |
Allows to control how external resources are loaded.
System::SharedPtr<Aspose::Words::StyleCollection> Aspose::Words::DocumentBase::get_Styles | ( | ) | const |
Returns a collection of styles defined in the document.
For more information see the description of the Aspose::Words::StyleCollection class.
System::SharedPtr<Aspose::Words::IWarningCallback> Aspose::Words::DocumentBase::get_WarningCallback | ( | ) | const |
Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss.
Document may generate warnings at any stage of its existence, so it's important to setup warning callback as early as possible to avoid the warnings loss. E.g. such properties as Aspose::Words::Document::get_PageCount actually build the document layout which is used later for rendering, and the layout warnings may be lost if warning callback is specified just for the rendering calls later.
System::SharedPtr<Aspose::Words::Node> Aspose::Words::DocumentBase::ImportNode | ( | System::SharedPtr< Aspose::Words::Node > | srcNode, |
bool | isImportChildren | ||
) |
Imports a node from another document to the current document.
This method uses the Aspose::Words::ImportFormatMode::UseDestinationStyles option to resolve formatting.
Importing a node creates a copy of the source node belonging to the importing document. The returned node has no parent. The source node is not altered or removed from the original document.
Before a node from another document can be inserted into this document, it must be imported. During import, document-specific properties such as references to styles and lists are translated from the original to the importing document. After the node was imported, it can be inserted into the appropriate place in the document using Aspose::Words::CompositeNode::InsertBefore(System::SharedPtr<Aspose::Words::Node>, System::SharedPtr<Aspose::Words::Node>) or Aspose::Words::CompositeNode::InsertAfter(System::SharedPtr<Aspose::Words::Node>, System::SharedPtr<Aspose::Words::Node>).
If the source node already belongs to the destination document, then simply a deep clone of the source node is created.
srcNode | The node being imported. |
isImportChildren | True to import all child nodes recursively; otherwise, false. |
System::SharedPtr<Aspose::Words::Node> Aspose::Words::DocumentBase::ImportNode | ( | System::SharedPtr< Aspose::Words::Node > | srcNode, |
bool | isImportChildren, | ||
Aspose::Words::ImportFormatMode | importFormatMode | ||
) |
Imports a node from another document to the current document with an option to control formatting.
This overload is useful to control how styles and list formatting are imported.
Importing a node creates a copy of the source node belonging to the importing document. The returned node has no parent. The source node is not altered or removed from the original document.
Before a node from another document can be inserted into this document, it must be imported. During import, document-specific properties such as references to styles and lists are translated from the original to the importing document. After the node was imported, it can be inserted into the appropriate place in the document using Aspose::Words::CompositeNode::InsertBefore(System::SharedPtr<Aspose::Words::Node>, System::SharedPtr<Aspose::Words::Node>) or Aspose::Words::CompositeNode::InsertAfter(System::SharedPtr<Aspose::Words::Node>, System::SharedPtr<Aspose::Words::Node>).
If the source node already belongs to the destination document, then simply a deep clone of the source node is created.
srcNode | The node to imported. |
isImportChildren | True to import all child nodes recursively; otherwise, false. |
importFormatMode | Specifies how to merge style formatting that clashes. |
void Aspose::Words::DocumentBase::set_BackgroundShape | ( | System::SharedPtr< Aspose::Words::Drawing::Shape > | value | ) |
Setter for Aspose::Words::DocumentBase::get_BackgroundShape.
void Aspose::Words::DocumentBase::set_NodeChangingCallback | ( | System::SharedPtr< Aspose::Words::INodeChangingCallback > | value | ) |
void Aspose::Words::DocumentBase::set_PageColor | ( | System::Drawing::Color | value | ) |
Setter for Aspose::Words::DocumentBase::get_PageColor.
void Aspose::Words::DocumentBase::set_ResourceLoadingCallback | ( | System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > | value | ) |
void Aspose::Words::DocumentBase::set_WarningCallback | ( | System::SharedPtr< Aspose::Words::IWarningCallback > | value | ) |
Setter for Aspose::Words::DocumentBase::get_WarningCallback.