![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
TSimpleTextControlState
TTextActionControlState
Purpose:
Derived from MCollectible, MTextControlState provides the abstract protocol for manipulating some representation of text --for example, a text model --associated with a TTextControl. MTextControlState is acted upon by a text control when that control is manipulated by the user. TTextControl must have an MTextControlState object to adopt at construction time. This object maintains the underlying text representation for the text control.
Instantiation:
Abstract class; do not instantiate directly.
Deriving Classes:
A concrete derived class, TSimpleTextControlState, provides protocol for a control based on an instance of TSimpleTextStore. If you want to use your own TTextModel implementation, derive a class directly from MTextControlState.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
MTextControlState ()
Interface Category:
API.
Purpose:
Default constructor. This function is protected.
Calling Context:
Typically not called directly by clients.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ MTextControlState ()
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:
Not multithread safe.
Other Considerations:
None.
MTextControlState & operator =(const MTextControlState &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Typically not called directly by clients.
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 TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Typically not called directly by clients.
Parameters:
- TStream & -Stream this object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Typically not called directly by clients.
Parameters:
- TStream & -Stream this object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws TInvalidVersionError if the object has detected an unsupportable version during the stream-in process.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void GetTextState (TText & text) const
Interface Category:
API.
Purpose:
Gets the current text data of this text control state. Called by the text control that adopted this control state to get the current text data, for example, to display it.
Calling Context:
May be called directly by clients.
Parameters:
- TText & text -Receives a copy of the text data associated with this text control state.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetTextState (const TText & newText)
Interface Category:
API.
Purpose:
Sets the text data for this text control state. Replaces any existing text. Called by the text control that adopted this control state when the user manipulates that control and the text state data needs to be updated.
Calling Context:
May be called directly by clients.
Parameters:
- const TText & newText -The new text for the associated control.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetTextStyles (const TStyleSet & styles)
Interface Category:
API.
Purpose:
Sets the styles on the text data owned by this control state.
Note that this is not to be used by clients to set persistent styles for text in a control. Use TTextControl::SetInitialTextStyles to do that.
Calling Context:
May be called directly by clients.
Parameters:
- const TStyleSet & styles -The styles to set on the text data owned by this control state.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MTextControlState::InternalGetTextRepresentation
virtual MTextRepresentation * InternalGetTextRepresentation () const
Interface Category:
API.
Purpose:
Gets the text representation containing the text data for this control state. This function is for internal use only.
Calling Context:
Called by the Text Framework command classes. Typically not called directly by clients.
Parameters:
Return Value:
Pointer to the text representation containing the text data for this control state.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This is a pure virtual function and needs to be overridden.
virtual TTextCount GetTextLength () const
Interface Category:
API.
Purpose:
Returns the length of the text data for this control state. This is provided for the convenience of clients that want to query the text control state for just the length of the text.
Calling Context:
Typically not called directly by clients.
Parameters:
Return Value:
The text length.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool IsEnabled () const
Interface Category:
API.
Purpose:
Determine if the Text Control is in an enabled state or not.
Calling Context:
May be called directly.
Parameters:
Return Value:
Returns true if this is enabled, otherwise return false.
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.