Class: TDocumentTextView

Declaration: DocumentTextView.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TTextView, MGUIBundle

Inherited By:

TEmbedderTextView

Purpose:

TDocumentTextView is derived from TTextView and MGUIBundle. It is responsible for the Editable Text document component. It overrides the API for managing the current selection by delegating it to the MGUIBundle. It also gets the presenter state information from TTextPresenterState.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is designed to be used directly.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TDocumentTextView::TDocumentTextView

  1. TDocumentTextView (TGUIBundle * theBundle)
  2. TDocumentTextView ()
  3. TDocumentTextView (const TDocumentTextView & other)

Interface Category:

API.

Purpose:

  1. Constructor for creating a document text view with the specified bundle attributes.
  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:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::~TDocumentTextView

virtual ~ TDocumentTextView ()

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:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::LookupPresenterStateForWriting

virtual TTextPresenterState * LookupPresenterStateForWriting () const

Interface Category:

API.

Purpose:

Facilitates access to the presenter state for writing.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A pointer to the text presenter state object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::LookupPresenterStateForReading

virtual const TTextPresenterState * LookupPresenterStateForReading () const

Interface Category:

API.

Purpose:

Facilitates access to the presenter state for reading.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A const pointer to the text presenter state.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::GetTextSelection

virtual const MTextSelection * GetTextSelection () const

Interface Category:

API.

Purpose:

Accessor that returns the current selection.

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:

Multithread safe.

Other Considerations:

Overrides inherited TTextView function.

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

Multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TDocumentTextView::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 TTextEditException::kInvalidSelectionType if the selection is NIL.

Concurrency:

Multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TDocumentTextView::GetTextRepresentation

virtual MTextRepresentation * GetTextRepresentation () const

Interface Category:

API.

Purpose:

Accessor that retrieves the text representation for the document text view.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

A pointer to the TDocumentFilteredTextRepresentation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Overrides inherited TTextView function.

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

Multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

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

Multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

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

Multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

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

Multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

Member Function: TDocumentTextView::HandleCreateBackgroundBundle

virtual TAttributeState * HandleCreateBackgroundBundle () const

Interface Category:

API.

Purpose:

Creates and returns a background bundle with the background color defined for the text presenter state associated with 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:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::HandleCreateSelectionBundle

virtual TAttributeState * HandleCreateSelectionBundle () const

Interface Category:

API.

Purpose:

Creates and returns a selection bundle with the background color and selection color defined for the text presenter state associated with 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:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::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 the text presenter state associated with 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:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::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 TDocumentTypingInteractor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::HandleConnectForNotification

virtual void HandleConnectForNotification ()

Interface Category:

API.

Purpose:

Sets this view up to receive text change, selection change, and presenter state change notifications.

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:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::HandleDisconnectNotification

virtual void HandleDisconnectNotification ()

Interface Category:

API.

Purpose:

Disconnects the notification connections; the view will no longer receive change notifications.

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:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::HandleCurrentSelectionChanged

virtual void HandleCurrentSelectionChanged (const TNotification &)

Interface Category:

API.

Purpose:

Handles receipt of notification that the selection changed. If the new selection is a selection in the text component, calls HandleTextSelectionChanged. Otherwise, calls HandleDrawSelection with a null area, and isCaret equal to true, to eliminate the highlighting of the previous selection.

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:

Multithread safe.

Other Considerations:

This function is protected.

Member Function: TDocumentTextView::HandlePresenterStateChanged

virtual void HandlePresenterStateChanged (const TNotification &)

Interface Category:

API.

Purpose:

Handles receipt of notification that the presenter state changed. From the notification, determines what aspect of the presenter state has changed, and resets aspects of the view accordingly. For example, if the text presenter state background color has changed, HandlePresenterStateChanged creates a new background bundle with the new color, and calls AdoptBackgroundBundle.

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:

Multithread safe.

Other Considerations:

This function is protected.

Member Function: TDocumentTextView::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 TTextEditException::kInvalidSelectionType if the dropped text is not a valid selection.

Concurrency:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::HandleCreateScrapItem

virtual TScrapItem * HandleCreateScrapItem () const

Interface Category:

API.

Purpose:

Creates a model scrap item for use with drag and drop.

Calling Context:

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

Parameters:

Return Value:

A pointer to the TModelScrapItem.

Exceptions:

Throws TTextEditException::kInvalidSelectionType if the selection is not a valid selection.

Concurrency:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::operator=

TDocumentTextView & operator =(const TDocumentTextView &)

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:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::GetMarginAdjustedArea

virtual TGRect GetMarginAdjustedArea () const

Interface Category:

API.

Purpose:

Returns the view's allocated area, adjusted by any margin.

Calling Context:

May be called directly by clients.

Parameters:

Return Value:

The TGRect for the allocated area, adjusted by any margin

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

This protected function overrides the inherited TTextView function.

Member Function: TDocumentTextView::CreateToolTarget

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

Interface Category:

API.

Purpose:

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

Calling Context:

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

Parameters:

Return Value:

A pointer to the new TDocumentTextToolInteractionTarget.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Overrides inherited MToolHandler function.

Member Function: TDocumentTextView::GetFilteredRepresentation

virtual TFilteredTextRepresentation * GetFilteredRepresentation ()

Interface Category:

API.

Purpose:

Accessor that retrieves the filtered text representation for the view.

Calling Context:

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

Parameters:

Return Value:

A pointer to the TDocumentFilteredTextRepresentation.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Overrides inherited TTextView function.

Member Function: TDocumentTextView::HandleCreateFormatter

virtual TAbstractPanelFormatter * HandleCreateFormatter ()

Interface Category:

API.

Purpose:

Creates a new panel formatter.

Calling Context:

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

Parameters:

Return Value:

A pointer to the new panel formatter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This class uses the document component entry to support access.

Other Considerations:

This function is protected.

Member Function: TDocumentTextView::operator<<=

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

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::HandleDroppedTextModel

virtual void HandleDroppedTextModel (const TGPoint & whereDropped, TTextModel * modelToAdopt)

Interface Category:

API.

Purpose:

Handle drop operation of a text model.

Calling Context:

Called by Text Editing Framework.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::AcceptDrop

virtual bool AcceptDrop (const TGPoint & whereDropped, const TTypeDescription & theType, const TScrapItem & theItem)

Interface Category:

API.

Purpose:

Accept drop of a drag-and-drop operation.

Calling Context:

Called by Text Editing Framework classes.

Parameters:

Return Value:

Returns true if drop is processed.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentTextView::ChoosePreferredType

virtual bool ChoosePreferredType (const TGPoint & whereDropped, const TSequenceOf < TTypeDescription > & availableTypes, TTypeDescription & chosenType) const

Interface Category:

API.

Purpose:

Select most desired type, from the collection of available types.

Calling Context:

Called by the Document Frameworks classes.

Parameters:

Return Value:

Returns true if a type was selected.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.