Class: TStyleRunIterator

Declaration: StyleRunIterator.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TStyleRunIterator allows you to iterate through a text instance for specific style runs, defined by type of style only or a type of style with a specific value. The type of style run to return is defined by a style filter. Currently TStyleRunIterator only supports character-based styles (see description of TCharacterStyleKind). Use TText::StylesAt to iterate through any other kinds of styles that may be applied to the text.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is not designed for deriving.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TStyleRunIterator::TStyleRunIterator

  1. TStyleRunIterator (const TStyleRunIterator & toCopy)
  2. TStyleRunIterator (const TText * text, const TStyleFilter & filter =TStyleFilter :: kNullFilter, const TTextRange & limitRange =TTextRange :: GetMaximumRange ())

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Constructs an iterator to iterator over the specified text instance.

Calling Context:

  1. Called to copy an object.
  2. Called to instantiate this class.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::~TStyleRunIterator

virtual ~ TStyleRunIterator ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::operator=

TStyleRunIterator & operator =(const TStyleRunIterator & toCopy)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::SetText

virtual void SetText (const TText * text, const TTextRange & limitRange =TTextRange :: GetMaximumRange ())

Interface Category:

API.

Purpose:

Specifies the text instance to iterate over.

Calling Context:

Called to reset the iterator to a new text instance after construction.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

You must reset the iterator after you call SetText.

Member Function: TStyleRunIterator::GetText

virtual const TText * GetText () const

Interface Category:

API.

Purpose:

Gets a copy of the text instance the iterator is set to iterate over.

Calling Context:

Called to get a copy of the text being iterated over.

Parameters:

Return Value:

A copy of the text being iterated over.

Exceptions

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::SetLimitRange

virtual void SetLimitRange (const TTextRange & limitRange)

Interface Category:

API.

Purpose:

Sets the current text limit range to the specified range.

Calling Context:

Called to reset the text limit range after construction.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::GetLimitRange

virtual void GetLimitRange (TTextRange & limitRange) const

Interface Category:

API.

Purpose:

Returns the current text limit range.

Calling Context:

Called to get the current text limit range.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::SetFilter

virtual void SetFilter (const TStyleFilter & filter)

Interface Category:

API.

Purpose:

Changes the current active filter to the specified filter.

Calling Context:

Called to reset the filter after construction.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::CreateFilter

virtual TStyleFilter * CreateFilter ()

Interface Category:

API.

Purpose:

Clones the current active filter and gives you the copy.

Calling Context:

Called to get a copy of the current active filter.

Parameters:

Return Value:

A copy of the current active filter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::First

virtual bool First (TTextRange & outputRange)

Interface Category:

API.

Purpose:

Locates the first style run matching the filter.

Calling Context:

Called to locate the first style run matching the filter.

Parameters:

Return Value:

Returns true if a run matching the filter is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::Last

virtual bool Last (TTextRange & outputRange)

Interface Category:

API.

Purpose:

Locates the last style run matching the filter.

Calling Context:

Called to locate the last style run matching the filter.

Parameters:

Return Value:

Returns true if a run matching the filter is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::Next

virtual bool Next (TTextRange & outputRange)

Interface Category:

API.

Purpose:

Locates the next style run matching the filter.

Calling Context:

Called to get the next style run.

Parameters:

Return Value:

Returns true if a run matching the filter is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::Previous

virtual bool Previous (TTextRange & outputRange)

Interface Category:

API.

Purpose:

Locates the previous style run matching the filter.

Calling Context:

Called to get the previous style run.

Parameters:

Return Value:

Returns true if a run matching the filter is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::Current

virtual bool Current (TTextRange & outputRange)

Interface Category:

API.

Purpose:

Returns the current style run.

Calling Context:

Called to get the current style run.

Parameters:

Return Value:

Returns true if a run matching the filter is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStyleRunIterator::Set

virtual bool Set (TTextOffset requestedOffset, TTextRange & outputRange)

Interface Category:

API.

Purpose:

Initializes the iterator at the specified offset and returns true if that position is in a run described by the current filter.

Calling Context:

Called to reinitialize the iterator at a particular position.

Parameters:

Return Value:

Returns true if a run matching this range is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.