Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TChangeStylesCommand
Inherited By:
None.
Purpose:
TReplaceStylesCommand, derived from TChangeStylesCommand, is used to replace the set of styles on the currently selected text with another set of styles. All styles previously applied to the text are removed before the replacement set is applied. This command does not change the current selection.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
The class is designed to be used directly.
Concurrency:
This command's functions assume that any required locks have already been acquired by the client.
Resource Use:
No special requirements.
Other Considerations:
None.
- TReplaceStylesCommand ()
- TReplaceStylesCommand (const TStyleSet & stylesToChange)
- TReplaceStylesCommand (const TReplaceStylesCommand &)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructs a command that will replace the existing styles on the selected text with the specified style set.
- Copy constructor.
Calling Context:
- Called by the stream-in operators. Call this function directly.
- Called to create a command that replaces existing styles with the specified style set. Call this function directly.
- Called to copy an object. Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
This command's functions assume that any required locks have already been acquired by the client.
Other Considerations:
None.
virtual ~ TReplaceStylesCommand ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Typically not called directly by clients.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
This command's functions assume that any required locks have already been acquired by the client.
Other Considerations:
None.
TReplaceStylesCommand & operator =(const TReplaceStylesCommand &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function directly.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
This command's functions assume that any required locks have already been acquired by the client.
Other Considerations:
None.
virtual void HandleChangeStyles (MTextRepresentation * textToChange, const TStyleSet & styleToChange, const TTextArea & whereToChange, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())
Interface Category:
API.
Purpose:
Calls the text representation's ReplaceStyles function to replace the set of styles on the specified text selection in the representation with the new set of styles. Called by HandleDoBegin when the command to replace the styles is executed.
Calling Context:
Called by the Text Framework classes. Typically not called directly by clients.
Parameters:
- MTextRepresentation * textToChange -The text representation for the text whose styles are to be replaced.
- const TStyleSet & styleToChange -The new styles to apply.
- const TTextArea & whereToChange -The selection of text whose styles are to be replaced.
- const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind() -The category of styles to be replaced (default: character).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
This command's functions assume that any required locks have already been acquired by the client.
Other Considerations:
This protected function overrides the inherited TChangeStylesCommand function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.