Represents a structured document tag (SDT or content control) in a document.
Structured document tags (SDTs) allow to embed customer-defined semantics as well as its behavior and appearance into a document.
In this version Aspose.Words provides a number of public methods and properties to manipulate the behavior and content of StructuredDocumentTag. Mapping of SDT nodes to custom XML packages within a document can be performed with using the XmlMapping property.
StructuredDocumentTag can occur in a document in the following places:
Shows how to work with styles for content control elements.
#include <Aspose.Words.Cpp/Markup/StructuredDocumentTag.h>
Public Member Functions | |
StructuredDocumentTag (SharedPtr< DocumentBase > doc, SdtType type, MarkupLevel level) | |
Initializes a new instance of the Structured document tag class. More... | |
bool | Accept (SharedPtr< DocumentVisitor > visitor) override |
Accepts a visitor. More... | |
void | Clear () |
Clears contents of this structured document tag and displays a placeholder if it is defined. More... | |
String | get_BuildingBlockCategory () |
Specifies category of building block for this SDT node. Can not be null. More... | |
String | get_BuildingBlockGallery () |
Specifies type of building block for this SDT. Can not be null. More... | |
SdtCalendarType | get_CalendarType () |
Specifies the type of calendar for this SDT. Default is Default More... | |
bool | get_Checked () |
Gets/Sets current state of the Checkbox SDT. Default value for this property is false. More... | |
Color | get_Color () |
Gets or sets the color of the structured document tag. More... | |
SharedPtr< Font > | get_ContentsFont () |
Font formatting that will be applied to text entered into SDT. More... | |
String | get_DateDisplayFormat () |
String that represents the format in which dates are displayed. Can not be null. More... | |
int32_t | get_DateDisplayLocale () |
Allows to set/get the language format for the date displayed in this SDT. More... | |
SdtDateStorageFormat | get_DateStorageFormat () |
Gets/sets format in which the date for a date SDT is stored when the SDT is bound to an XML node in the document's data store. Default value is DateTime More... | |
SharedPtr< Font > | get_EndCharacterFont () |
Font formatting that will be applied to the last character of text entered into SDT. More... | |
DateTime | get_FullDate () |
Specifies the full date and time last entered into this SDT. More... | |
int32_t | get_Id () |
Specifies a unique read-only persistent numerical Id for this SDT. More... | |
bool | get_IsShowingPlaceholderText () const |
Specifies whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT). if set to true, this state shall be resumed (showing placeholder text) upon opening this document. More... | |
bool | get_IsTemporary () const |
Specifies whether this SDT shall be removed from the WordProcessingML document when its contents are modified. More... | |
MarkupLevel | get_Level () const |
Gets the level at which this SDT occurs in the document tree. More... | |
MarkupLevel | get_Level_IMarkupNode () override |
SharedPtr< SdtListItemCollection > | get_ListItems () |
Gets SdtListItemCollection associated with this SDT. More... | |
bool | get_LockContentControl () const |
When set to true, this property will prohibit a user from deleting this SDT. More... | |
bool | get_LockContents () const |
When set to true, this property will prohibit a user from editing the contents of this SDT. More... | |
bool | get_Multiline () |
Specifies whether this SDT allows multiple lines of text. More... | |
NodeType | get_NodeType () const override |
Returns NodeType.StructuredDocumentTag. More... | |
SharedPtr< BuildingBlock > | get_Placeholder () const |
Gets the BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty, the associated mapped XML element is empty as specified via the XmlMapping element or the IsShowingPlaceholderText element is true. More... | |
String | get_PlaceholderName () const |
Gets or sets Name of the BuildingBlock containing placeholder text. BuildingBlock with this name Name has to be present in the GlossaryDocument otherwise InvalidOperationException will occur. More... | |
SdtType | get_SdtType () |
Gets type of this Structured document tag. More... | |
SharedPtr< Style > | get_Style () |
Gets or sets the Style of the structured document tag. More... | |
String | get_StyleName () |
Gets or sets the name of the style applied to the structured document tag. More... | |
String | get_Tag () const |
Specifies a tag associated with the current SDT node. Can not be null. More... | |
String | get_Title () const |
Specifies the friendly name associated with this SDT. Can not be null. More... | |
SharedPtr< XmlMapping > | get_XmlMapping () const |
Gets an object that represents the mapping of this structured document tag to XML data in a custom XML part of the current document. More... | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
void | RemoveMoveRevisions () override |
void | RemoveSelfOnly () |
Removes just this SDT node itself, but keeps the content of it inside the document tree. More... | |
void | set_BuildingBlockCategory (String value) |
Setter for get_BuildingBlockCategory. More... | |
void | set_BuildingBlockGallery (String value) |
Setter for get_BuildingBlockGallery. More... | |
void | set_CalendarType (SdtCalendarType value) |
Setter for get_CalendarType. More... | |
void | set_Checked (bool value) |
Setter for get_Checked. More... | |
void | set_Color (Color value) |
Setter for get_Color. More... | |
void | set_DateDisplayFormat (String value) |
Setter for get_DateDisplayFormat. More... | |
void | set_DateDisplayLocale (int32_t value) |
Setter for get_DateDisplayLocale. More... | |
void | set_DateStorageFormat (SdtDateStorageFormat value) |
Setter for get_DateStorageFormat. More... | |
void | set_FullDate (DateTime value) |
Setter for get_FullDate. More... | |
void | set_IsShowingPlaceholderText (bool value) |
Setter for get_IsShowingPlaceholderText. More... | |
void | set_IsTemporary (bool value) |
Setter for get_IsTemporary. More... | |
void | set_LockContentControl (bool value) |
Setter for get_LockContentControl. More... | |
void | set_LockContents (bool value) |
Setter for get_LockContents. More... | |
void | set_Multiline (bool value) |
Setter for get_Multiline. More... | |
void | set_PlaceholderName (String value) |
Setter for get_PlaceholderName. More... | |
void | set_Style (SharedPtr< Style > value) |
Setter for get_Style. More... | |
void | set_StyleName (String value) |
Setter for get_StyleName. More... | |
void | set_Tag (String value) |
Setter for get_Tag. More... | |
void | set_Title (String value) |
Setter for get_Title. More... | |
void | SetCheckedSymbol (int32_t characterCode, String fontName) |
Sets the symbol used to represent the checked state of a check box content control. More... | |
void | SetUncheckedSymbol (int32_t characterCode, String fontName) |
Sets the symbol used to represent the unchecked state of a check box content control. More... | |
![]() | |
SharedPtr< Node > | AppendChild (SharedPtr< Node > newChild) |
Adds the specified node to the end of the list of child nodes for this node. More... | |
SharedPtr< NodeCollection > | get_ChildNodes () |
Gets all immediate child nodes of this node. More... | |
SharedPtr< CompositeNode > | get_Container () override |
int32_t | get_Count () |
Gets the number of immediate children of this node. More... | |
SharedPtr< Node > | get_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< Node > | get_LastChild () const |
Gets the last child of the node. More... | |
SharedPtr< Node > | GetChild (NodeType nodeType, int32_t index, bool isDeep) |
Returns an Nth child node that matches the specified type. More... | |
SharedPtr< NodeCollection > | GetChildNodes (NodeType nodeType, bool isDeep) |
Returns a live collection of child nodes that match the specified type. More... | |
SharedPtr< Node > | GetCurrentNode () override |
SharedPtr< IEnumerator< SharedPtr< Node > > > | GetEnumerator () override |
Provides support for the for each style iteration over the child nodes of this node. More... | |
SharedPtr< Node > | GetNextMatchingNode (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< Node > | InsertAfter (SharedPtr< Node > newChild, SharedPtr< Node > refChild) |
Inserts the specified node immediately after the specified reference node. More... | |
SharedPtr< Node > | InsertBefore (SharedPtr< Node > newChild, SharedPtr< Node > refChild) |
Inserts the specified node immediately before the specified reference node. More... | |
SharedPtr< Node > | PrependChild (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< Node > | RemoveChild (SharedPtr< Node > oldChild) |
Removes the specified child node. More... | |
void | RemoveSmartTags () |
Removes all SmartTag descendant nodes of the current node. More... | |
SharedPtr< NodeList > | SelectNodes (String xpath) |
Selects a list of nodes matching the XPath expression. More... | |
SharedPtr< Node > | SelectSingleNode (String xpath) |
Selects the first Node that matches the XPath expression. More... | |
![]() | |
SharedPtr< Node > | Clone (bool isCloneChildren) |
Creates a duplicate of the node. More... | |
int32_t | get_CustomNodeId () const |
Specifies custom node identifier. More... | |
virtual SharedPtr< DocumentBase > | get_Document () const |
Gets the document to which this node belongs. More... | |
SharedPtr< Node > | get_NextSibling () |
Gets the node immediately following this node. More... | |
SharedPtr< CompositeNode > | get_ParentNode () |
Gets the immediate parent of this node. More... | |
SharedPtr< Node > | get_PreviousSibling () |
Gets the node immediately preceding this node. More... | |
SharedPtr< Range > | get_Range () |
Returns a Range object that represents the portion of a document that is contained in this node. More... | |
SharedPtr< CompositeNode > | GetAncestor (NodeType ancestorType) |
Gets the first ancestor of the specified NodeType. More... | |
template<typename T > | |
T | GetAncestorOf () |
SharedPtr< Node > | NextPreOrder (SharedPtr< Node > rootNode) |
Gets next node according to the pre-order tree traversal algorithm. More... | |
SharedPtr< Node > | PreviousPreOrder (SharedPtr< Node > rootNode) |
Gets the previous node according to the pre-order tree traversal algorithm. More... | |
void | Remove () |
Removes itself from the parent. More... | |
void | set_CustomNodeId (int32_t value) |
Setter for get_CustomNodeId. 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... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
![]() | |
static const TypeInfo & | Type () |
![]() | |
static String | NodeTypeToString (NodeType nodeType) |
A utility method that converts a node type enum value into a user friendly string. More... | |
static const TypeInfo & | Type () |
Aspose::Words::Markup::StructuredDocumentTag::StructuredDocumentTag | ( | System::SharedPtr< Aspose::Words::DocumentBase > | doc, |
Aspose::Words::Markup::SdtType | type, | ||
Aspose::Words::Markup::MarkupLevel | level | ||
) |
Initializes a new instance of the Structured document tag class.
The following types of SDT can be created:
doc | The owner document. |
type | Type of SDT node. |
level | Level of SDT node within the document. |
Show how to create a structured document tag in the form of a check box.
|
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.
visitor | The visitor that will visit the nodes. |
Shows how to print the node structure of every structured document tag in a document.
Implements Aspose::Words::Node.
void Aspose::Words::Markup::StructuredDocumentTag::Clear | ( | ) |
Clears contents of this structured document tag and displays a placeholder if it is defined.
It is not possible to clear contents of a structured document tag if it has revisions.
If this structured document tag is mapped to custom XML (with using the XmlMapping property), the referenced XML node is cleared.
Shows how to delete contents of structured document tag elements.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_BuildingBlockCategory | ( | ) |
Specifies category of building block for this SDT node. Can not be null.
Accessing this property will only work for BuildingBlockGallery and DocPartObj SDT types. It is read-only for SDT of the document part type.
For all other SDT types exception will occur.
Shows how to insert a structured document tag as a building block, and set its category and gallery.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_BuildingBlockGallery | ( | ) |
Specifies type of building block for this SDT. Can not be null.
Accessing this property will only work for BuildingBlockGallery and DocPartObj SDT types. It is read-only for SDT of the document part type.
For all other SDT types exception will occur.
Shows how to insert a structured document tag as a building block, and set its category and gallery.
Aspose::Words::Markup::SdtCalendarType Aspose::Words::Markup::StructuredDocumentTag::get_CalendarType | ( | ) |
Specifies the type of calendar for this SDT. Default is Default
Accessing this property will only work for Date SDT type.
For all other SDT types exception will occur.
Shows how to prompt the user to enter a date with a structured document tag.
bool Aspose::Words::Markup::StructuredDocumentTag::get_Checked | ( | ) |
Gets/Sets current state of the Checkbox SDT. Default value for this property is false.
Accessing this property will only work for Checkbox SDT types.
For all other SDT types exception will occur.
Show how to create a structured document tag in the form of a check box.
System::Drawing::Color Aspose::Words::Markup::StructuredDocumentTag::get_Color | ( | ) |
Gets or sets the color of the structured document tag.
Shows how to create a structured document tag in a plain text box and modify its appearance.
System::SharedPtr<Aspose::Words::Font> Aspose::Words::Markup::StructuredDocumentTag::get_ContentsFont | ( | ) |
Font formatting that will be applied to text entered into SDT.
Shows how to create a structured document tag in a plain text box and modify its appearance.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_DateDisplayFormat | ( | ) |
String that represents the format in which dates are displayed. Can not be null.
Accessing this property will only work for Date SDT type.
For all other SDT types exception will occur.
Shows how to prompt the user to enter a date with a structured document tag.
int32_t Aspose::Words::Markup::StructuredDocumentTag::get_DateDisplayLocale | ( | ) |
Allows to set/get the language format for the date displayed in this SDT.
Accessing this property will only work for Date SDT type.
For all other SDT types exception will occur.
Shows how to prompt the user to enter a date with a structured document tag.
Aspose::Words::Markup::SdtDateStorageFormat Aspose::Words::Markup::StructuredDocumentTag::get_DateStorageFormat | ( | ) |
Gets/sets format in which the date for a date SDT is stored when the SDT is bound to an XML node in the document's data store. Default value is DateTime
Accessing this property will only work for Date SDT type.
For all other SDT types exception will occur.
Shows how to prompt the user to enter a date with a structured document tag.
System::SharedPtr<Aspose::Words::Font> Aspose::Words::Markup::StructuredDocumentTag::get_EndCharacterFont | ( | ) |
Font formatting that will be applied to the last character of text entered into SDT.
Shows how to create a structured document tag in a plain text box and modify its appearance.
System::DateTime Aspose::Words::Markup::StructuredDocumentTag::get_FullDate | ( | ) |
Specifies the full date and time last entered into this SDT.
Accessing this property will only work for Date SDT type.
For all other SDT types exception will occur.
Shows how to prompt the user to enter a date with a structured document tag.
int32_t Aspose::Words::Markup::StructuredDocumentTag::get_Id | ( | ) |
Specifies a unique read-only persistent numerical Id for this SDT.
Id attribute shall follow these rules:
Shows how to create a structured document tag in a plain text box and modify its appearance.
bool Aspose::Words::Markup::StructuredDocumentTag::get_IsShowingPlaceholderText | ( | ) | const |
Specifies whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT). if set to true, this state shall be resumed (showing placeholder text) upon opening this document.
Shows how to use a building block's contents as a custom placeholder text for a structured document tag.
bool Aspose::Words::Markup::StructuredDocumentTag::get_IsTemporary | ( | ) | const |
Specifies whether this SDT shall be removed from the WordProcessingML document when its contents are modified.
Shows how to make single-use controls.
Aspose::Words::Markup::MarkupLevel Aspose::Words::Markup::StructuredDocumentTag::get_Level | ( | ) | const |
Gets the level at which this SDT occurs in the document tree.
Shows how to create a structured document tag in a plain text box and modify its appearance.
|
override |
System::SharedPtr<Aspose::Words::Markup::SdtListItemCollection> Aspose::Words::Markup::StructuredDocumentTag::get_ListItems | ( | ) |
Gets SdtListItemCollection associated with this SDT.
Accessing this property will only work for ComboBox or DropDownList SDT types.
For all other SDT types exception will occur.
Shows how to work with drop down-list structured document tags.
bool Aspose::Words::Markup::StructuredDocumentTag::get_LockContentControl | ( | ) | const |
When set to true, this property will prohibit a user from deleting this SDT.
Shows how to apply editing restrictions to structured document tags.
bool Aspose::Words::Markup::StructuredDocumentTag::get_LockContents | ( | ) | const |
When set to true, this property will prohibit a user from editing the contents of this SDT.
Shows how to apply editing restrictions to structured document tags.
bool Aspose::Words::Markup::StructuredDocumentTag::get_Multiline | ( | ) |
Specifies whether this SDT allows multiple lines of text.
Accessing this property will only work for RichText and PlainText SDT type.
For all other SDT types exception will occur.
Shows how to create a structured document tag in a plain text box and modify its appearance.
|
overridevirtual |
Returns NodeType.StructuredDocumentTag.
Shows how to work with styles for content control elements.
Implements Aspose::Words::Node.
System::SharedPtr<Aspose::Words::BuildingBlocks::BuildingBlock> Aspose::Words::Markup::StructuredDocumentTag::get_Placeholder | ( | ) | const |
Gets the BuildingBlock containing placeholder text which should be displayed when this SDT run contents are empty, the associated mapped XML element is empty as specified via the XmlMapping element or the IsShowingPlaceholderText element is true.
Shows how to use a building block's contents as a custom placeholder text for a structured document tag.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_PlaceholderName | ( | ) | const |
Gets or sets Name of the BuildingBlock containing placeholder text. BuildingBlock with this name Name has to be present in the GlossaryDocument otherwise InvalidOperationException will occur.
Shows how to use a building block's contents as a custom placeholder text for a structured document tag.
Aspose::Words::Markup::SdtType Aspose::Words::Markup::StructuredDocumentTag::get_SdtType | ( | ) |
Gets type of this Structured document tag.
Shows how to get the type of a structured document tag.
System::SharedPtr<Aspose::Words::Style> Aspose::Words::Markup::StructuredDocumentTag::get_Style | ( | ) |
Gets or sets the Style of the structured document tag.
Shows how to work with styles for content control elements.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_StyleName | ( | ) |
Gets or sets the name of the style applied to the structured document tag.
Shows how to work with styles for content control elements.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_Tag | ( | ) | const |
Specifies a tag associated with the current SDT node. Can not be null.
Shows how to create a structured document tag in a plain text box and modify its appearance.
System::String Aspose::Words::Markup::StructuredDocumentTag::get_Title | ( | ) | const |
Specifies the friendly name associated with this SDT. Can not be null.
Shows how to create a structured document tag in a plain text box and modify its appearance.
System::SharedPtr<Aspose::Words::Markup::XmlMapping> Aspose::Words::Markup::StructuredDocumentTag::get_XmlMapping | ( | ) | const |
Gets an object that represents the mapping of this structured document tag to XML data in a custom XML part of the current document.
Shows how to create a structured document tag with custom XML data.
|
overridevirtual |
Reimplemented from Aspose::Words::CompositeNode.
|
overridevirtual |
Reimplemented from Aspose::Words::CompositeNode.
|
override |
void Aspose::Words::Markup::StructuredDocumentTag::RemoveSelfOnly | ( | ) |
Removes just this SDT node itself, but keeps the content of it inside the document tree.
Shows how to create a structured document tag in a plain text box and modify its appearance.
void Aspose::Words::Markup::StructuredDocumentTag::set_BuildingBlockCategory | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_BuildingBlockGallery | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_CalendarType | ( | Aspose::Words::Markup::SdtCalendarType | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_Checked | ( | bool | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_Color | ( | System::Drawing::Color | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_DateDisplayFormat | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_DateDisplayLocale | ( | int32_t | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_DateStorageFormat | ( | Aspose::Words::Markup::SdtDateStorageFormat | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_FullDate | ( | System::DateTime | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_IsShowingPlaceholderText | ( | bool | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_IsTemporary | ( | bool | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_LockContentControl | ( | bool | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_LockContents | ( | bool | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_Multiline | ( | bool | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_PlaceholderName | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_Style | ( | System::SharedPtr< Aspose::Words::Style > | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_StyleName | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_Tag | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::set_Title | ( | System::String | value | ) |
void Aspose::Words::Markup::StructuredDocumentTag::SetCheckedSymbol | ( | int32_t | characterCode, |
System::String | fontName | ||
) |
Sets the symbol used to represent the checked state of a check box content control.
Accessing this method will only work for Checkbox SDT types.
For all other SDT types exception will occur.
characterCode | The character code for the specified symbol. |
fontName | The name of the font that contains the symbol. |
void Aspose::Words::Markup::StructuredDocumentTag::SetUncheckedSymbol | ( | int32_t | characterCode, |
System::String | fontName | ||
) |
Sets the symbol used to represent the unchecked state of a check box content control.
Accessing this method will only work for Checkbox SDT types.
For all other SDT types exception will occur.
characterCode | The character code for the specified symbol. |
fontName | The name of the font that contains the symbol. |
|
static |