Aspose::Words::TabStopCollection Class Reference

Detailed Description

A collection of TabStop objects that represent custom tabs for a paragraph or a style.

In Microsoft Word documents, a tab stop can be defined in the properties of a paragraph style or directly in the properties of a paragraph. A style can be based on another style. Therefore, the complete set of tab stops for a given object is a combination of tab stops defined directly on this object and tab stops inherited from the parent styles.

In Aspose.Words, when you obtain a TabStops collection for a paragraph or a style, it contains only the custom tab stops defined directly for this paragraph or style. The collection does not include tab stops defined in the parent styles or default tab stops.

See also
Aspose::Words::ParagraphFormat, Aspose::Words::TabStop, Aspose::Words::Document::get_DefaultTabStop

#include <Aspose.Words.Cpp/Model/Text/TabStopCollection.h>

+ Inheritance diagram for Aspose::Words::TabStopCollection:

Public Member Functions

void Add (double position, TabAlignment alignment, TabLeader leader)
 Adds or replaces a tab stop in the collection. More...
 
void Add (SharedPtr< TabStop > tabStop)
 Adds or replaces a tab stop in the collection. More...
 
SharedPtr< TabStopAfter (double position)
 Gets a first tab stop to the right of the specified position. More...
 
SharedPtr< TabStopBefore (double position)
 Gets a first tab stop to the left of the specified position. More...
 
void Clear ()
 Deletes all tab stop positions. More...
 
void Collapse (SharedPtr< Aspose::Words::IExpandableAttr > parentAttr)
 
bool Equals (SharedPtr< TabStopCollection > rhs)
 Determines whether the specified TabStopCollection is equal in value to the current TabStopCollection. More...
 
virtual bool Equals (SharedPtr< Object > obj)
 Determines whether the specified object is equal in value to the current object. More...
 
SharedPtr< Aspose::Words::IExpandableAttr > Expand (SharedPtr< Aspose::Words::IExpandableAttr > parentAttr)
 
int32_t get_Count ()
 Gets the number of tab stops in the collection. More...
 
virtual int32_t GetHashCode () const
 Serves as a hash function for this type. More...
 
int32_t GetIndexByPosition (double position)
 Gets the index of a tab stop with the specified position in points. More...
 
double GetPositionByIndex (int32_t index)
 Gets the position (in points) of the tab stop at the specified index. More...
 
SharedPtr< TabStopidx_get (double position)
 Gets a tab stop at the specified position. More...
 
SharedPtr< TabStopidx_get (int32_t index)
 Gets a tab stop at the given index. More...
 
void RemoveByIndex (int32_t index)
 Removes a tab stop at the specified index from the collection. More...
 
void RemoveByPosition (double position)
 Removes a tab stop at the specified position from the collection. 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 const TypeInfoGetType () const
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) 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 ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 
- 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 ()
 

Member Function Documentation

◆ Add() [1/2]

void Aspose::Words::TabStopCollection::Add ( double  position,
Aspose::Words::TabAlignment  alignment,
Aspose::Words::TabLeader  leader 
)

Adds or replaces a tab stop in the collection.

If a tab stop already exists at the specified position, it is replaced.

Parameters
positionA position (in points) where to add the tab stop.
alignmentA TabAlignment value that specifies the alignment of text at the tab stop.
leaderA TabLeader value that specifies the type of the leader line displayed under the tab character.

◆ Add() [2/2]

void Aspose::Words::TabStopCollection::Add ( System::SharedPtr< Aspose::Words::TabStop tabStop)

Adds or replaces a tab stop in the collection.

If a tab stop already exists at the specified position, it is replaced.

Parameters
tabStopA tab stop object to add.

◆ After()

System::SharedPtr<Aspose::Words::TabStop> Aspose::Words::TabStopCollection::After ( double  position)

Gets a first tab stop to the right of the specified position.

Skips tab stops with Alignment set to TabAlignment.Bar.

Parameters
positionThe reference position (in points).
Returns
A tab stop object or null if a suitable tab stop was not found.

◆ Before()

System::SharedPtr<Aspose::Words::TabStop> Aspose::Words::TabStopCollection::Before ( double  position)

Gets a first tab stop to the left of the specified position.

Skips tab stops with Alignment set to TabAlignment.Bar.

Parameters
positionThe reference position (in points).
Returns
A tab stop object or null if a suitable tab stop was not found.

◆ Clear()

void Aspose::Words::TabStopCollection::Clear ( )

Deletes all tab stop positions.

◆ Collapse()

void Aspose::Words::TabStopCollection::Collapse ( System::SharedPtr< Aspose::Words::IExpandableAttr >  parentAttr)

◆ Equals() [1/2]

bool Aspose::Words::TabStopCollection::Equals ( System::SharedPtr< Aspose::Words::TabStopCollection rhs)

Determines whether the specified TabStopCollection is equal in value to the current TabStopCollection.

◆ Equals() [2/2]

virtual bool Aspose::Words::TabStopCollection::Equals ( System::SharedPtr< System::Object obj)
virtual

Determines whether the specified object is equal in value to the current object.

◆ Expand()

System::SharedPtr<Aspose::Words::IExpandableAttr> Aspose::Words::TabStopCollection::Expand ( System::SharedPtr< Aspose::Words::IExpandableAttr >  parentAttr)

◆ get_Count()

int32_t Aspose::Words::TabStopCollection::get_Count ( )

Gets the number of tab stops in the collection.

◆ GetHashCode()

virtual int32_t Aspose::Words::TabStopCollection::GetHashCode ( ) const
virtual

Serves as a hash function for this type.

Reimplemented from System::Object.

◆ GetIndexByPosition()

int32_t Aspose::Words::TabStopCollection::GetIndexByPosition ( double  position)

Gets the index of a tab stop with the specified position in points.

◆ GetPositionByIndex()

double Aspose::Words::TabStopCollection::GetPositionByIndex ( int32_t  index)

Gets the position (in points) of the tab stop at the specified index.

Parameters
indexAn index into the collection of tab stops.
Returns
The position of the tab stop.

◆ idx_get() [1/2]

System::SharedPtr<Aspose::Words::TabStop> Aspose::Words::TabStopCollection::idx_get ( double  position)

Gets a tab stop at the specified position.

Returns null if no tab stop is found at the specified position.

Parameters
positionThe position (in points) of the tab stop.

◆ idx_get() [2/2]

System::SharedPtr<Aspose::Words::TabStop> Aspose::Words::TabStopCollection::idx_get ( int32_t  index)

Gets a tab stop at the given index.

Parameters
indexAn index into the collection of tab stops.

◆ RemoveByIndex()

void Aspose::Words::TabStopCollection::RemoveByIndex ( int32_t  index)

Removes a tab stop at the specified index from the collection.

Parameters
indexAn index into the collection of tab stops.

◆ RemoveByPosition()

void Aspose::Words::TabStopCollection::RemoveByPosition ( double  position)

Removes a tab stop at the specified position from the collection.

Parameters
positionThe position (in points) of the tab stop to remove.