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.
- TDocumentTextView (TGUIBundle * theBundle)
- TDocumentTextView ()
- TDocumentTextView (const TDocumentTextView & other)
Interface Category:
API.
Purpose:
- Constructor for creating a document text view with the specified bundle attributes.
- Default constructor. This constructor is protected.
- Copy constructor. This constructor is protected.
Calling Context:
- May be called directly by clients.
- Typically not called directly by clients.
- Typically not called directly by clients.
Parameters:
- TGUIBundle * theBundle -The bundle to be associated with the view.
- Takes no parameters.
- const TDocumentTextView & other -The object to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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.
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.
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.
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.
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:
- const TGPoint & whereDropped -The point at which the text was dropped.
- const TText & item -The text.
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.
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:
- const TTypeDescription & -Type of the target which the tool will work on.
- const TGPoint & -The coordinate at which to activate the cursor tool.
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.
virtual TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -Reference to stream to read from.
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.
virtual TStream & operator >>=(TStream & towhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & towhere -Reference to stream to write to.
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:
- const TGPoint & whereDropped -Point of the drop site.
- TTextModel * modelToAdopt -Pointer to the model that was dropped on this view.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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:
- const TGPoint & whereDropped -Point of the drop site.
- const TTypeDescription & theType -Type description of the item being dropped.
- const TScrapItem & theItem -The item being dropped.
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:
- const TGPoint & whereDropped -Local point in this view where item was dropped.
- const TSequenceOf < TTypeDescription > & availableTypes -Collection of available types to choose from.
- TTypeDescription & chosenType -The most desired type from the collection of types available.
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.