Class: TSimpleTextView

Declaration: SimpleTextView.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TTextView

Inherited By:

None.

Purpose:

TSimpleTextView is derived from TTextView. It is used in the non-document case, and does not have a presenter or presenter state. Instead, it manages the current selection by itself.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is designed to be used directly.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSimpleTextView::TSimpleTextView

  1. TSimpleTextView (MTextRepresentation * textToAlias)
  2. TSimpleTextView ()
  3. TSimpleTextView (const TSimpleTextView &)

Interface Category:

API.

Purpose:

  1. Constructor for creating a text view containing the specified text to alias.
  2. Default constructor. This constructor is protected.
  3. Copy constructor. This constructor is protected.

Calling Context:

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

virtual ~ TSimpleTextView ()

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: TSimpleTextView::GetTextSelection

virtual const MTextSelection * GetTextSelection () const

Interface Category:

API.

Purpose:

Accessor that returns the current selection. Called by functions such as TTextView::DrawContents that need to know what the current selection is.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A pointer to the MTextSelection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::CopyCurrentSelection

virtual MTextSelection * CopyCurrentSelection () const

Interface Category:

API.

Purpose:

Creates a copy of the current selection.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A pointer to the new selection copy.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::AdoptCurrentSelection

virtual void AdoptCurrentSelection (MTextSelection *)

Interface Category:

API.

Purpose:

Adopts the specified selection.

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:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::GetTextRepresentation

virtual MTextRepresentation * GetTextRepresentation () const

Interface Category:

API.

Purpose:

Accessor that retrieves the text representation for the simple Called by functions such as TTextView::SetCurrentSelection that need the representation object in order to call its relevant member functions.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A pointer to the simple text representation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::GetFilteredRepresentation

virtual TFilteredTextRepresentation * GetFilteredRepresentation ()

Interface Category:

API.

Purpose:

Accessor that retrieves the filtered text representation for the simple text view.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the filtered text representation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::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:

Overrides inherited MCollectible function.

Member Function: TSimpleTextView::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 no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MCollectible function.

Member Function: TSimpleTextView::CreateToolTarget

virtual MToolTarget * CreateToolTarget (const TTypeDescription &, const TGPoint &) const

Interface Category:

API.

Purpose:

Creates a simple text tool interaction target for a tool interactor based on this view.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the new TSimpleTextToolInteractionTarget.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

Member Function: TSimpleTextView::AdoptAndDo

virtual void AdoptAndDo (TToolCommandBinding *)

Interface Category:

API.

Purpose:

Adopts the specified tool command binding, does the command, then deletes the binding.

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:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::DoBegin

virtual void DoBegin (TToolCommandBinding &)

Interface Category:

API.

Purpose:

Calls the specified tool command binding's function to begin command processing.

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:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::DoIncrement

virtual void DoIncrement (TToolCommandBinding &)

Interface Category:

API.

Purpose:

Calls the specified tool command binding's function to do incremental command processing.

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:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::AdoptAndDoEnd

virtual void AdoptAndDoEnd (TToolCommandBinding *)

Interface Category:

API.

Purpose:

Adopts the specified tool command binding and calls its function to complete command processing.

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:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::GetSelectionColor

virtual void GetSelectionColor (TRGBColor & color) const

Interface Category:

API.

Purpose:

Retrieves the current selection color.

Calling Context:

Called by clients that need to know the selection color.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

Member Function: TSimpleTextView::SetSelectionColor

virtual void SetSelectionColor (const TRGBColor & color)

Interface Category:

API.

Purpose:

Sets the selection color to the specified color.

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:

Overrides inherited MToolHandler function.

Member Function: TSimpleTextView::HandleDroppedText

virtual void HandleDroppedText (const TGPoint & whereDropped, const TText & item)

Interface Category:

API.

Purpose:

Handles the situation where text has been dropped into the view. Inserts the specified text item at the offset corresponding to whereDropped, and leaves it selected.

Calling Context:

Called by the Text Framework 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:

Overrides inherited TTextView function.

Member Function: TSimpleTextView::operator=

TSimpleTextView & operator =(const TSimpleTextView &)

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:

This function is protected.

Member Function: TSimpleTextView::HandleCreateBackgroundBundle

virtual TAttributeState * HandleCreateBackgroundBundle () const

Interface Category:

API.

Purpose:

Creates and returns a background bundle with the background color defined for this view.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the new background bundle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TSimpleTextView::HandleCreateSelectionBundle

virtual TAttributeState * HandleCreateSelectionBundle () const

Interface Category:

API.

Purpose:

Creates and returns a selection bundle with the background color and selection color defined for this view.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the new selection bundle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TSimpleTextView::HandleCreateCaretBundle

virtual TAttributeState * HandleCreateCaretBundle () const

Interface Category:

API.

Purpose:

Creates and returns a caret bundle with the background color, selection color, and caret color defined for this view.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the new caret bundle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TSimpleTextView::HandleCreateTypingInteractor

virtual TTypingInteractor * HandleCreateTypingInteractor ()

Interface Category:

API.

Purpose:

Creates the typing interactor for this view.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

A pointer to the new TSimpleTypingInteractor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TSimpleTextView::SetTextRepresentation

virtual void SetTextRepresentation (MTextRepresentation * textToAlias)

Interface Category:

API.

Purpose:

Called to associate a text representation class with this view.

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:

This member function does nothing if it is passed a nil parameter.

Member Function: TSimpleTextView::HandleAfterConnectionToViewRoot

virtual void HandleAfterConnectionToViewRoot ()

Interface Category:

API.

Purpose:

After this view is added to the view hierarchy, ensure that there is a text representation, for cases where one was not passed in at construction time.

Calling Context:

Not called directly.

Parameters:

Return Value:

None.

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.