Aspose::Words::BuildingBlocks::BuildingBlock Class Reference

Detailed Description

Represents a glossary document entry such as a Building Block, AutoText or an AutoCorrect entry.

BuildingBlock can contain only Section nodes.

BuildingBlock can only be a child of GlossaryDocument.

You can create new building blocks and insert them into a glossary document. You can modify or delete existing building blocks. You can copy or move building blocks between documents. You can insert content of a building block into a document.

Corresponds to the docPart, docPartPr and docPartBody elements in OOXML.

See also
Aspose::Words::BuildingBlocks::GlossaryDocument

#include <Aspose.Words.Cpp/Model/BuildingBlocks/BuildingBlock.h>

+ Inheritance diagram for Aspose::Words::BuildingBlocks::BuildingBlock:

Public Member Functions

 BuildingBlock (SharedPtr< GlossaryDocument > glossaryDoc)
 Initializes a new instance of this class. More...
 
bool Accept (SharedPtr< DocumentVisitor > visitor) override
 Accepts a visitor. More...
 
BuildingBlockBehavior get_Behavior () const
 Specifies the behavior that shall be applied when the contents of the building block is inserted into the main document. More...
 
String get_Category () const
 Specifies the second-level categorization for the building block. More...
 
String get_Description () const
 Gets or sets the description associated with this building block. More...
 
SharedPtr< Sectionget_FirstSection ()
 Gets the first section in the building block. More...
 
BuildingBlockGallery get_Gallery () const
 Specifies the first-level categorization for the building block for the purposes of classification or user interface sorting. More...
 
Guid get_Guid () const
 Gets or sets an identifier (a 128-bit GUID) that uniquely identifies this building block. More...
 
SharedPtr< Sectionget_LastSection ()
 Gets the last section in the building block. More...
 
String get_Name () const
 Gets or sets the name of this building block. More...
 
NodeType get_NodeType () const override
 Returns the BuildingBlock value. More...
 
SharedPtr< SectionCollectionget_Sections ()
 Returns a collection that represents all sections in the building block. More...
 
BuildingBlockType get_Type () const
 Specifies the building block type. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_Behavior (BuildingBlockBehavior value)
 Specifies the behavior that shall be applied when the contents of the building block is inserted into the main document. More...
 
void set_Category (String value)
 Setter for get_Category. More...
 
void set_Description (String value)
 Setter for get_Description. More...
 
void set_Gallery (BuildingBlockGallery value)
 Setter for get_Gallery. More...
 
void set_Guid (Guid value)
 Setter for get_Guid. More...
 
void set_Name (String value)
 Setter for get_Name. More...
 
void set_Type (BuildingBlockType value)
 Setter for get_Type. More...
 
- Public Member Functions inherited from CompositeNode
SharedPtr< NodeAppendChild (SharedPtr< Node > newChild)
 Adds the specified node to the end of the list of child nodes for this node. More...
 
SharedPtr< NodeCollectionget_ChildNodes ()
 Gets all immediate child nodes of this node. More...
 
SharedPtr< CompositeNodeget_Container () override
 
int32_t get_Count ()
 Gets the number of immediate children of this node. More...
 
SharedPtr< Nodeget_FirstChild () const
 Gets the first child of the node. More...
 
bool get_HasChildNodes ()
 Returns true if this node has any child nodes. More...
 
bool get_IsComposite () override
 Returns true as this node can have child nodes. More...
 
SharedPtr< Nodeget_LastChild () const
 Gets the last child of the node. More...
 
SharedPtr< NodeGetChild (NodeType nodeType, int32_t index, bool isDeep)
 Returns an Nth child node that matches the specified type. More...
 
SharedPtr< NodeCollectionGetChildNodes (NodeType nodeType, bool isDeep)
 Returns a live collection of child nodes that match the specified type. More...
 
SharedPtr< NodeGetCurrentNode () override
 
SharedPtr< IEnumerator< SharedPtr< Node > > > GetEnumerator () override
 Provides support for the for each style iteration over the child nodes of this node. More...
 
SharedPtr< NodeGetNextMatchingNode (SharedPtr< Node > curNode) override
 
String GetText () override
 Gets the text of this node and of all its children. More...
 
int32_t IndexOf (SharedPtr< Node > child)
 Returns the index of the specified child node in the child node array. More...
 
SharedPtr< NodeInsertAfter (SharedPtr< Node > newChild, SharedPtr< Node > refChild)
 Inserts the specified node immediately after the specified reference node. More...
 
SharedPtr< NodeInsertBefore (SharedPtr< Node > newChild, SharedPtr< Node > refChild)
 Inserts the specified node immediately before the specified reference node. More...
 
SharedPtr< NodePrependChild (SharedPtr< Node > newChild)
 Adds the specified node to the beginning of the list of child nodes for this node. More...
 
void RemoveAllChildren ()
 Removes all the child nodes of the current node. More...
 
SharedPtr< NodeRemoveChild (SharedPtr< Node > oldChild)
 Removes the specified child node. More...
 
void RemoveSmartTags ()
 Removes all SmartTag descendant nodes of the current node. More...
 
SharedPtr< NodeListSelectNodes (String xpath)
 Selects a list of nodes matching the XPath expression. More...
 
SharedPtr< NodeSelectSingleNode (String xpath)
 Selects the first Node that matches the XPath expression. More...
 
- Public Member Functions inherited from Node
SharedPtr< NodeClone (bool isCloneChildren)
 Creates a duplicate of the node. More...
 
virtual SharedPtr< DocumentBaseget_Document () const
 Gets the document to which this node belongs. More...
 
SharedPtr< Nodeget_NextSibling ()
 Gets the node immediately following this node. More...
 
SharedPtr< CompositeNodeget_ParentNode ()
 Gets the immediate parent of this node. More...
 
SharedPtr< Nodeget_PreviousSibling ()
 Gets the node immediately preceding this node. More...
 
SharedPtr< Rangeget_Range ()
 Returns a Range object that represents the portion of a document that is contained in this node. More...
 
SharedPtr< CompositeNodeGetAncestor (NodeType ancestorType)
 Gets the first ancestor of the specified NodeType. More...
 
template<typename T >
GetAncestorOf ()
 
SharedPtr< NodeNextPreOrder (SharedPtr< Node > rootNode)
 Gets next node according to the pre-order tree traversal algorithm. More...
 
SharedPtr< NodePreviousPreOrder (SharedPtr< Node > rootNode)
 Gets the previous node according to the pre-order tree traversal algorithm. More...
 
void Remove ()
 Removes itself from the parent. More...
 
String ToString (SaveFormat saveFormat)
 Exports the content of the node into a string in the specified format. More...
 
String ToString (SharedPtr< SaveOptions > saveOptions)
 Exports the content of the node into a string using the specified save options. More...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 
- Public Member Functions inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Words::Node > >
EnumeratorBasedIterator< T, IEnumerator< T > > begin () noexcept
 
EnumeratorBasedIterator< T, IEnumerator< T > > cbegin () noexcept
 
EnumeratorBasedIterator< T, IEnumerator< T > > cend () noexcept
 
EnumeratorBasedIterator< T, IEnumerator< T > > end () noexcept
 
bool LINQ_All (std::function< bool(T)> predicate)
 
bool LINQ_Any ()
 
bool LINQ_Any (std::function< bool(T)> predicate)
 
SharedPtr< IEnumerable< ResultType > > LINQ_Cast ()
 
SharedPtr< IEnumerable< Result > > LINQ_Cast ()
 
bool LINQ_Contains (T value)
 
int LINQ_Count ()
 
int LINQ_Count (const Func< T, bool > &predicate)
 
LINQ_ElementAt (int index)
 
LINQ_First ()
 
LINQ_First (const Func< T, bool > &predicate)
 
LINQ_FirstOrDefault ()
 
LINQ_FirstOrDefault (std::function< bool(T)> predicate)
 
LINQ_Last ()
 
LINQ_LastOrDefault ()
 
SharedPtr< IEnumerable< ResultType > > LINQ_OfType ()
 
SharedPtr< IEnumerable< Result > > LINQ_OfType ()
 
SharedPtr< IEnumerable< Source > > LINQ_OrderBy (const Func< Source, Key > &keySelector)
 
SharedPtr< IEnumerable< T > > LINQ_OrderBy (const Func< T, Key > &keySelector)
 
SharedPtr< IEnumerable< Result > > LINQ_Select (const Func< Source, Result > &selector)
 
SharedPtr< IEnumerable< ResultType > > LINQ_Select (const Func< T, ResultType > &selector)
 
ArrayPtr< T > LINQ_ToArray ()
 
SharedPtr< List< T > > LINQ_ToList ()
 
SharedPtr< IEnumerable< T > > LINQ_Where (std::function< bool(T)> predicate)
 

Static Public Member Functions

static const TypeInfoType ()
 
- Static Public Member Functions inherited from CompositeNode
static const TypeInfoType ()
 
- Static Public Member Functions inherited from Node
static String NodeTypeToString (NodeType nodeType)
 A utility method that converts a node type enum value into a user friendly string. More...
 
static const TypeInfoType ()
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 
- Public Types inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Words::Node > >
typedef IEnumerator< T > IEnumeratorType
 
typedef T ValueType
 

Constructor & Destructor Documentation

◆ BuildingBlock()

Aspose::Words::BuildingBlocks::BuildingBlock::BuildingBlock ( System::SharedPtr< Aspose::Words::BuildingBlocks::GlossaryDocument glossaryDoc)

Initializes a new instance of this class.

When BuildingBlock is created, it belongs to the specified glossary document, but is not yet part of the glossary document and ParentNode is null.

To append BuildingBlock to a GlossaryDocument use AppendChild().

Parameters
glossaryDocThe owner document.

Member Function Documentation

◆ Accept()

bool Aspose::Words::BuildingBlocks::BuildingBlock::Accept ( System::SharedPtr< Aspose::Words::DocumentVisitor visitor)
overridevirtual

Accepts a visitor.

Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.

For more info see the Visitor design pattern.

Calls VisitBuildingBlockStart(), then calls Accept() for all child nodes of this building block, then calls VisitBuildingBlockEnd().

Note: A building block node and its children are not visited when you execute a Visitor over a Document. If you want to execute a Visitor over a building block, you need to execute the visitor over GlossaryDocument or call Accept().

Parameters
visitorThe visitor that will visit the nodes.
Returns
True if all nodes were visited; false if DocumentVisitor stopped the operation before visiting all nodes.

Implements Aspose::Words::Node.

◆ get_Behavior()

Aspose::Words::BuildingBlocks::BuildingBlockBehavior Aspose::Words::BuildingBlocks::BuildingBlock::get_Behavior ( ) const

Specifies the behavior that shall be applied when the contents of the building block is inserted into the main document.

◆ get_Category()

System::String Aspose::Words::BuildingBlocks::BuildingBlock::get_Category ( ) const

Specifies the second-level categorization for the building block.

Building blocks in Microsoft Word user interface are arranged into Galleries. Each Gallery can have multiple Categories. Each block within a Category has a Name.

Cannot be null and cannot be an empty string.

Corresponds to the docPartPr.category.name element in OOXML.

See also
Aspose::Words::BuildingBlocks::BuildingBlock::get_Gallery
Aspose::Words::BuildingBlocks::BuildingBlock::get_Name

◆ get_Description()

System::String Aspose::Words::BuildingBlocks::BuildingBlock::get_Description ( ) const

Gets or sets the description associated with this building block.

The description may contain any string content, usually additional information.

Cannot be null, but can be an empty string.

Corresponds to the docPartPr.description element in OOXML.

◆ get_FirstSection()

System::SharedPtr<Aspose::Words::Section> Aspose::Words::BuildingBlocks::BuildingBlock::get_FirstSection ( )

Gets the first section in the building block.

◆ get_Gallery()

Aspose::Words::BuildingBlocks::BuildingBlockGallery Aspose::Words::BuildingBlocks::BuildingBlock::get_Gallery ( ) const

Specifies the first-level categorization for the building block for the purposes of classification or user interface sorting.

Building blocks in Microsoft Word user interface are arranged into Galleries. Each Gallery can have multiple Categories. Each block within a Category has a Name.

Corresponds to the docPartPr.category.gallery element in OOXML.

See also
Aspose::Words::BuildingBlocks::BuildingBlock::get_Category
Aspose::Words::BuildingBlocks::BuildingBlock::get_Name

◆ get_Guid()

System::Guid Aspose::Words::BuildingBlocks::BuildingBlock::get_Guid ( ) const

Gets or sets an identifier (a 128-bit GUID) that uniquely identifies this building block.

Can be used by an application to uniquely reference a building block regardless of different naming due to localization.

Corresponds to the docPartPr.guid element in OOXML.

◆ get_LastSection()

System::SharedPtr<Aspose::Words::Section> Aspose::Words::BuildingBlocks::BuildingBlock::get_LastSection ( )

Gets the last section in the building block.

◆ get_Name()

System::String Aspose::Words::BuildingBlocks::BuildingBlock::get_Name ( ) const

Gets or sets the name of this building block.

The name may contain any string content, usually a friendly identifier. Multiple building blocks can have the same name.

Cannot be null and cannot be an empty string.

Corresponds to the docPartPr.name element in OOXML.

See also
Aspose::Words::BuildingBlocks::BuildingBlock::get_Gallery
Aspose::Words::BuildingBlocks::BuildingBlock::get_Category

◆ get_NodeType()

Aspose::Words::NodeType Aspose::Words::BuildingBlocks::BuildingBlock::get_NodeType ( ) const
overridevirtual

Returns the BuildingBlock value.

Implements Aspose::Words::Node.

◆ get_Sections()

System::SharedPtr<Aspose::Words::SectionCollection> Aspose::Words::BuildingBlocks::BuildingBlock::get_Sections ( )

Returns a collection that represents all sections in the building block.

◆ get_Type()

Aspose::Words::BuildingBlocks::BuildingBlockType Aspose::Words::BuildingBlocks::BuildingBlock::get_Type ( ) const

Specifies the building block type.

The building block type can influence the visibility and behavior of the building block in Microsoft Word.

Corresponds to the docPartPr.types element in OOXML.

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::BuildingBlocks::BuildingBlock::GetType ( ) const
overridevirtual

Reimplemented from Aspose::Words::CompositeNode.

◆ Is()

virtual bool Aspose::Words::BuildingBlocks::BuildingBlock::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from Aspose::Words::CompositeNode.

◆ set_Behavior()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Behavior ( Aspose::Words::BuildingBlocks::BuildingBlockBehavior  value)

Specifies the behavior that shall be applied when the contents of the building block is inserted into the main document.

◆ set_Category()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Category ( System::String  value)

◆ set_Description()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Description ( System::String  value)

◆ set_Gallery()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Gallery ( Aspose::Words::BuildingBlocks::BuildingBlockGallery  value)

◆ set_Guid()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Guid ( System::Guid  value)

◆ set_Name()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Name ( System::String  value)

◆ set_Type()

void Aspose::Words::BuildingBlocks::BuildingBlock::set_Type ( Aspose::Words::BuildingBlocks::BuildingBlockType  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::BuildingBlocks::BuildingBlock::Type ( )
static