Class: MTextControlState

Declaration: TextControl.h

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.

Member Function: MTextControlState::MTextControlState

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.

Member Function: MTextControlState::~MTextControlState

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.

Member Function: MTextControlState::operator=

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.

Member Function: MTextControlState::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Typically not called directly by clients.

Parameters:

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.

Member Function: MTextControlState::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Typically not called directly by clients.

Parameters:

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.

Member Function: MTextControlState::GetTextState

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MTextControlState::SetTextState

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MTextControlState::SetTextStyles

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:

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.

Member Function: MTextControlState::GetTextLength

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.

Member Function: MTextControlState::IsEnabled

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.