Class: MDelegatingTextControl

Declaration: TextControl.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TTextControl

Purpose:

MDelegatingTextControl is a base class for text controls. It defines the protocol for adopting a text control state and for delegating to the adopted text control state requests to manipulate the text field in the control.

Instantiation:

Mixin class; do not instantiate.

Deriving Classes:

TTextControl, derived from MDelegatingTextControl, is the concrete class provided by Taligent that implements text controls.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: MDelegatingTextControl::MDelegatingTextControl

  1. MDelegatingTextControl ()
  2. MDelegatingTextControl (MTextControlState * delegate)
  3. MDelegatingTextControl (const MDelegatingTextControl &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructs an MDelegatingTextControl object that adopts the specified control state object.
  3. Copy constructor. If the object being copied had adopted its control state object, then the control state object is cloned. Otherwise, a pointer to the control state object is copied and marked as not adopted. Control state objects that are not adopted are not flattened and resurrected. This function also copies the pointer to the request processor.

Calling Context:

  1. Called by the Text Framework command classes. Typically not called directly by clients.
  2. Called by the Text Framework command classes. Typically not called directly by clients.
  3. Called by the Text Framework command classes. 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: MDelegatingTextControl::~MDelegatingTextControl

virtual ~ MDelegatingTextControl ()

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: MDelegatingTextControl::operator=

MDelegatingTextControl & operator =(const MDelegatingTextControl &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called by the Text Framework classes. 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: MDelegatingTextControl::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called by the Text Framework classes. 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: MDelegatingTextControl::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called by the Text Framework classes. 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: MDelegatingTextControl::AdoptState

virtual void AdoptState (MTextControlState * state)

Interface Category:

API.

Purpose:

Adopts the specified control state object. Any existing control state object for this control is deleted, as the control can only contain one control state object at a time.

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: MDelegatingTextControl::SetState

virtual void SetState (MTextControlState * state)

Interface Category:

API.

Purpose:

Sets a control state object for this control, but does not adopt it. Any existing control state object for this control is deleted, as the control can only contain one control state object at a time. If this control has a control state object that has not been adopted, then the control state object is not automatically deleted, the control state object is not streamed out, and, if this control is copied, the control state object is copied and not cloned.

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: MDelegatingTextControl::GetState

virtual MTextControlState * GetState () const

Interface Category:

API.

Purpose:

Returns a pointer to the current control state object for this control.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

Pointer to the current control state object. This pointer will never be NIL, because the function creates and adopts an object of TSimpleTextControlState if none has been previously specified.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MDelegatingTextControl::OrphanState

virtual MTextControlState * OrphanState ()

Interface Category:

API.

Purpose:

Orphans the current control state object. This function simply removes the control's reference to the control state; it does not delete the control state object.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

Returns a pointer to the orphaned control state object; if the control state was not adopted, returns NIL.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: MDelegatingTextControl::GetTextState

virtual void GetTextState (TText & text) const

Interface Category:

API.

Purpose:

Gets the state, or text data, maintained by the current text control state.

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: MDelegatingTextControl::SetTextState

virtual void SetTextState (const TText & newText)

Interface Category:

API.

Purpose:

Sets the state, or text data, maintained by the current text control state.

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: MDelegatingTextControl::GetTextLength

virtual TTextCount GetTextLength () const

Interface Category:

API.

Purpose:

Returns the length of the text data maintained by the current text control state.

Calling Context:

May be 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: MDelegatingTextControl::IsEnabled

virtual bool IsEnabled () const

Interface Category:

API.

Purpose:

Determine if this object is enabled or not.

Calling Context:

May be called directly.

Parameters:

Return Value:

Returns true if this is enabled, otherwise 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.