Aspose::Words::Style Class Reference

Represents a single built-in or user-defined style. More...

#include "Aspose.Words.Cpp/Model/Styles/Style.h"

Inherits IParaAttrSource, and IRunAttrSource.

Inherited by Aspose::Words::TableStyle.

Public Member Functions

System::String get_Name () const
 Gets or sets the name of the style. More...
 
void set_Name (System::String value)
 Setter for Aspose::Words::Style::get_Name. More...
 
Aspose::Words::StyleIdentifier get_StyleIdentifier () const
 Gets the locale independent style identifier for a built-in style. More...
 
System::ArrayPtr< System::Stringget_Aliases ()
 Gets all aliases of this style. If style has no aliases then empty array of string is returned. More...
 
bool get_IsHeading ()
 True when the style is one of the built-in Heading styles. More...
 
Aspose::Words::StyleType get_Type () const
 Gets the style type (paragraph or character). More...
 
System::SharedPtr< Aspose::Words::DocumentBaseget_Document ()
 Gets the owner document. More...
 
System::String get_LinkedStyleName ()
 Gets the name of the Style linked to this one. Returns Empty string if no styles are linked. More...
 
System::String get_BaseStyleName ()
 Gets/sets the name of the style this style is based on. More...
 
void set_BaseStyleName (System::String value)
 Setter for Aspose::Words::Style::get_BaseStyleName. More...
 
System::String get_NextParagraphStyleName ()
 Gets/sets the name of the style to be applied automatically to a new paragraph inserted after a paragraph formatted with the specified style. More...
 
void set_NextParagraphStyleName (System::String value)
 Setter for Aspose::Words::Style::get_NextParagraphStyleName. More...
 
bool get_BuiltIn ()
 True if this style is one of the built-in styles in MS Word. More...
 
System::SharedPtr< Aspose::Words::Fontget_Font ()
 Gets the character formatting of the style. More...
 
System::SharedPtr< Aspose::Words::ParagraphFormatget_ParagraphFormat ()
 Gets the paragraph formatting of the style. More...
 
System::SharedPtr< Aspose::Words::Lists::Listget_List ()
 Gets the list that defines formatting of this list style. More...
 
System::SharedPtr< Aspose::Words::ListFormatget_ListFormat ()
 Provides access to the list formatting properties of a paragraph style. More...
 
bool get_IsQuickStyle () const
 Specifies whether this style is shown in the Quick Style gallery inside MS Word UI. More...
 
void set_IsQuickStyle (bool value)
 Setter for Aspose::Words::Style::get_IsQuickStyle. More...
 
System::SharedPtr< Aspose::Words::StyleCollectionget_Styles () const
 Gets the collection of styles this style belongs to. More...
 
void Remove ()
 Removes the specified style from the document. More...
 
bool Equals (System::SharedPtr< Aspose::Words::Style > style)
 Compares with the specified style. Styles Istds are compared for built-in styles only. Styles defaults are not included in comparison. Base style, linked style and next paragraph style are recursively compared. More...
 
System::SharedPtr< System::ObjectGetDirectParaAttr (int32_t key)
 
System::SharedPtr< System::ObjectFetchParaAttr (int32_t key)
 
System::SharedPtr< System::ObjectFetchInheritedParaAttr (int32_t key)
 
void SetParaAttr (int32_t key, System::SharedPtr< System::Object > value)
 
void RemoveParaAttr (int32_t key)
 
void ClearParaAttrs ()
 
System::SharedPtr< System::ObjectGetDirectRunAttr (int32_t key)
 
System::SharedPtr< System::ObjectFetchInheritedRunAttr (int32_t key)
 
void SetRunAttr (int32_t key, System::SharedPtr< System::Object > value)
 
void RemoveRunAttr (int32_t key)
 
void ClearRunAttrs ()
 

Detailed Description

Represents a single built-in or user-defined style.

Member Function Documentation

◆ ClearParaAttrs()

void Aspose::Words::Style::ClearParaAttrs ( )

◆ ClearRunAttrs()

void Aspose::Words::Style::ClearRunAttrs ( )

◆ Equals()

bool Aspose::Words::Style::Equals ( System::SharedPtr< Aspose::Words::Style style)

Compares with the specified style. Styles Istds are compared for built-in styles only. Styles defaults are not included in comparison. Base style, linked style and next paragraph style are recursively compared.

◆ FetchInheritedParaAttr()

System::SharedPtr<System::Object> Aspose::Words::Style::FetchInheritedParaAttr ( int32_t  key)

◆ FetchInheritedRunAttr()

System::SharedPtr<System::Object> Aspose::Words::Style::FetchInheritedRunAttr ( int32_t  key)

◆ FetchParaAttr()

System::SharedPtr<System::Object> Aspose::Words::Style::FetchParaAttr ( int32_t  key)

◆ get_Aliases()

System::ArrayPtr<System::String> Aspose::Words::Style::get_Aliases ( )

Gets all aliases of this style. If style has no aliases then empty array of string is returned.

◆ get_BaseStyleName()

System::String Aspose::Words::Style::get_BaseStyleName ( )

Gets/sets the name of the style this style is based on.

This will be an empty string if the style is not based on any other style and it can be set to an empty string.

◆ get_BuiltIn()

bool Aspose::Words::Style::get_BuiltIn ( )

True if this style is one of the built-in styles in MS Word.

◆ get_Document()

System::SharedPtr<Aspose::Words::DocumentBase> Aspose::Words::Style::get_Document ( )

Gets the owner document.

◆ get_Font()

System::SharedPtr<Aspose::Words::Font> Aspose::Words::Style::get_Font ( )

Gets the character formatting of the style.

For list styles this property returns null.

◆ get_IsHeading()

bool Aspose::Words::Style::get_IsHeading ( )

True when the style is one of the built-in Heading styles.

◆ get_IsQuickStyle()

bool Aspose::Words::Style::get_IsQuickStyle ( ) const

Specifies whether this style is shown in the Quick Style gallery inside MS Word UI.

◆ get_LinkedStyleName()

System::String Aspose::Words::Style::get_LinkedStyleName ( )

Gets the name of the Style linked to this one. Returns Empty string if no styles are linked.

◆ get_List()

System::SharedPtr<Aspose::Words::Lists::List> Aspose::Words::Style::get_List ( )

Gets the list that defines formatting of this list style.

This property is only valid for list styles. For other style types this property returns null.

◆ get_ListFormat()

System::SharedPtr<Aspose::Words::ListFormat> Aspose::Words::Style::get_ListFormat ( )

Provides access to the list formatting properties of a paragraph style.

This property is only valid for paragraph styles. For other style types this property returns null.

◆ get_Name()

System::String Aspose::Words::Style::get_Name ( ) const

Gets or sets the name of the style.

Can not be empty string.

If there already is a style with such name in the collection, then this style will override it. All affected nodes will reference new style.

◆ get_NextParagraphStyleName()

System::String Aspose::Words::Style::get_NextParagraphStyleName ( )

Gets/sets the name of the style to be applied automatically to a new paragraph inserted after a paragraph formatted with the specified style.

This property is not used by Aspose.Words. The next paragraph style will only be applied automatically when you edit the document in MS Word.

◆ get_ParagraphFormat()

System::SharedPtr<Aspose::Words::ParagraphFormat> Aspose::Words::Style::get_ParagraphFormat ( )

Gets the paragraph formatting of the style.

For character and list styles this property returns null.

◆ get_StyleIdentifier()

Aspose::Words::StyleIdentifier Aspose::Words::Style::get_StyleIdentifier ( ) const

Gets the locale independent style identifier for a built-in style.

For user defined (custom) styles, this property returns Aspose::Words::StyleIdentifier::User.

See also
Aspose::Words::Style::get_Name

◆ get_Styles()

System::SharedPtr<Aspose::Words::StyleCollection> Aspose::Words::Style::get_Styles ( ) const

Gets the collection of styles this style belongs to.

◆ get_Type()

Aspose::Words::StyleType Aspose::Words::Style::get_Type ( ) const

Gets the style type (paragraph or character).

◆ GetDirectParaAttr()

System::SharedPtr<System::Object> Aspose::Words::Style::GetDirectParaAttr ( int32_t  key)

◆ GetDirectRunAttr()

System::SharedPtr<System::Object> Aspose::Words::Style::GetDirectRunAttr ( int32_t  key)

◆ Remove()

void Aspose::Words::Style::Remove ( )

Removes the specified style from the document.

Style removal has following effects on the document model:

  • All references to the style are removed from corresponding paragraphs, runs and tables.
  • If base style is removed its formatting is moved to child styles.
  • If style to be deleted has a linked style, then both of these are deleted.

◆ RemoveParaAttr()

void Aspose::Words::Style::RemoveParaAttr ( int32_t  key)

◆ RemoveRunAttr()

void Aspose::Words::Style::RemoveRunAttr ( int32_t  key)

◆ set_BaseStyleName()

void Aspose::Words::Style::set_BaseStyleName ( System::String  value)

◆ set_IsQuickStyle()

void Aspose::Words::Style::set_IsQuickStyle ( bool  value)

◆ set_Name()

void Aspose::Words::Style::set_Name ( System::String  value)

◆ set_NextParagraphStyleName()

void Aspose::Words::Style::set_NextParagraphStyleName ( System::String  value)

◆ SetParaAttr()

void Aspose::Words::Style::SetParaAttr ( int32_t  key,
System::SharedPtr< System::Object value 
)

◆ SetRunAttr()

void Aspose::Words::Style::SetRunAttr ( int32_t  key,
System::SharedPtr< System::Object value 
)