Class: TTextNotification

Declaration: TextNotificationCore.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TNotification

Inherited By:

TInsertTextNotification

Purpose:

TTextNotification, derived from TNotification, is used by the text representation to inform any interested objects (normally the view) that text data has been modified. The TTextNotification contains the change type, the selection that is affected by the change, the style category, and a time stamp specifying when the data was changed. A TTextNotification is generated by a text representation whenever the text is edited or the styling information is changed.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is designed to be used directly. Derive a class (like TInsertTextNotification) from this class if additional information about a change is needed. The stream in, stream out, and assignment member functions must be overridden. All other member functions should not be overridden.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TTextNotification::TTextNotification

  1. TTextNotification (const TInterest &, const TTextArea &, EActionType, TPseudoTimeStamp, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())
  2. TTextNotification (const TTextNotification &)
  3. TTextNotification ()

Interface Category:

API.

Purpose:

  1. Constructs a notification object, specifying the interest, the modified selection, the type of change, the time stamp indicating when the change occurred, and the style category, which defaults to character.
  2. Copy constructor.
  3. Default constructor. This constructor is protected.

Calling Context:

  1. May be called directly by clients.
  2. May be called directly by clients.
  3. 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: TTextNotification::~TTextNotification

virtual ~ TTextNotification ()

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

TTextNotification & operator =(const TTextNotification &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

May be 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: TTextNotification::GetActionType

virtual EActionType GetActionType () const

Interface Category:

API.

Purpose:

Returns an EActionType value indicating what type of modification caused this notification to be generated. Called to determine what type of change occurred on the text. Called by the view when it receives the notification. The view then knows what part of the text was changed and redraws only that part.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

An EActionType value indicating how the text was changed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextNotification::GetTextSelection

virtual void GetTextSelection (TTextArea & area) const

Interface Category:

API.

Purpose:

Sets the TTextArea parameter object to refer to the selection on which the modification was performed. Note that this is the selection before the modification was made, as some modifications cause the current selection to change. Called to determine what text range was changed in the text object. Called by the view when determining how to redraw the changed text after receiving the notification.

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: TTextNotification::GetNotificationTimeStamp

virtual TPseudoTimeStamp GetNotificationTimeStamp () const

Interface Category:

API.

Purpose:

Returns the time stamp indicating when the modification that generated this notification occurred. Called to determine when the modification that generated this notification occurred. Called by the view to make sure that it is drawing the most recent data from the text representation.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A new TPseudoTimeStamp object indicating when the modification that generated this notification occurred.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextNotification::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

May be 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: TTextNotification::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextNotification::GetStyleKind

virtual const TStyleKind & GetStyleKind () const

Interface Category:

API.

Purpose:

Returns the kind of style information that was modified. Called by receivers of the notification (e.g., the view) to determine the kind of style that was changed.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A new TStyleKind indicating the kind of style information that was modified. If the type of change is not kStyleChange, then the default character style kind is returned.

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.