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.
- TStyleRunIterator (const TStyleRunIterator & toCopy)
- TStyleRunIterator (const TText * text, const TStyleFilter & filter =TStyleFilter :: kNullFilter, const TTextRange & limitRange =TTextRange :: GetMaximumRange ())
Interface Category:
API.
Purpose:
- Copy constructor.
- Constructs an iterator to iterator over the specified text instance.
Calling Context:
- Called to copy an object.
- Called to instantiate this class.
Parameters:
- const TStyleRunIterator & toCopy -The object to copy.
- const TText * text -The text instance to iterator over.
- const TStyleFilter & filter =TStyleFilter :: kNullFilter -The style filter specifying the type of style runs to locate.
- const TTextRange & limitRange =TTextRange :: GetMaximumRange () -The range of the text instance to iterate through.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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.
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:
- const TText * text -The instance to iterate over.
- const TTextRange & limitRange =TTextRange :: GetMaximumRange () -The range of the text instance to iterate over.
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.
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.
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:
- const TTextRange & limitRange -The new limit range.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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.
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.
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:
- TTextRange & outputRange -The range of the located style run.
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.
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:
- TTextRange & outputRange -The range of the located style run.
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.
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:
- TTextRange & outputRange -The range of the located style run.
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.
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:
- TTextRange & outputRange -The range of the located style run.
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.
virtual bool Current (TTextRange & outputRange)
Interface Category:
API.
Purpose:
Returns the current style run.
Calling Context:
Called to get the current style run.
Parameters:
- TTextRange & outputRange -The range of the located style run.
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.
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:
- TTextOffset requestedOffset -The position at which to initialize the iterator.
- TTextRange & outputRange -The range of the valid style run.
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.