Class: TStandardCanvasModel

Declaration: StandardGrafEdit.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TModel, MCanvasRepresentation

Inherited By:

None.

Purpose:

A canvas representation that is also a model. Typically derived to develop a compound document centric GrafEdit application.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Intended to be derived but can also be used as is.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TStandardCanvasModel::CreateSelection

virtual TModelSelection * CreateSelection () const

Interface Category:

API.

Purpose:

Creates an empty TStandardCanvasModelSelection.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TModelSelection * -The selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::GetGraphicsAddedInterest

TModelInterest GetGraphicsAddedInterest () const

Interface Category:

API.

Purpose:

Returns an interest object to represent the event of graphics being added to the model.

Calling Context:

Called to register notification.

Parameters:

Return Value:

TModelInterest -The interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::GetGraphicsRemovedInterest

TModelInterest GetGraphicsRemovedInterest () const

Interface Category:

API.

Purpose:

Returns an interest object to represent the event of graphics being removed from the model.

Calling Context:

Called to register notification.

Parameters:

Return Value:

TModelInterest -The interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::GetGraphicsChangedInterest

TModelInterest GetGraphicsChangedInterest () const

Interface Category:

API.

Purpose:

Returns an interest object to represent the event of graphics changing in the model.

Calling Context:

Called to register notification.

Parameters:

Return Value:

TModelInterest -The interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::GetDrasticChangeInterest

TModelInterest GetDrasticChangeInterest () const

Interface Category:

API.

Purpose:

Returns an interest object to represent the event of a change that requires clients to completely resync with the model.

Calling Context:

Called to register notification.

Parameters:

Return Value:

TModelInterest -The interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::GetEmbeddedGraphicAddedInterest

TModelInterest GetEmbeddedGraphicAddedInterest () const

Interface Category:

API.

Purpose:

Returns an interest object to represent the event of a document component embedding in the model.

Calling Context:

Called to register notification.

Parameters:

Return Value:

TModelInterest -The interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

For future use. Currently not used.

Member Function: TStandardCanvasModel::AdoptAtFront

virtual void AdoptAtFront (MCanvasGraphic *)

Interface Category:

API.

Purpose:

Adopts the graphic at the front.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::AdoptAtBack

virtual void AdoptAtBack (MCanvasGraphic *)

Interface Category:

API.

Purpose:

Adopts the graphic at the back.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::AdoptAfter

virtual void AdoptAfter (const TCanvasGraphicID & existing, MCanvasGraphic * toBeAdded)

Interface Category:

API.

Purpose:

Adopts the graphic after an identified graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::AdoptBefore

virtual void AdoptBefore (const TCanvasGraphicID & existing, MCanvasGraphic * toBeAdded)

Interface Category:

API.

Purpose:

Adopts the graphic before an identified graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::MoveToFront

virtual void MoveToFront (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Moves the identified graphic to the front.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::MoveToBack

virtual void MoveToBack (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Moves the identified graphic to the back.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::MoveForward

virtual bool MoveForward (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Moves the identified graphic closer to the front by one position.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the graphic is moved.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::MoveBackward

virtual bool MoveBackward (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Moves the identified graphic closer to the back by one position.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the graphic is moved.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Orphan

virtual MCanvasGraphic * Orphan (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Removes a graphic and returns it, passing the ownership responsibility for it to the caller.

Calling Context:

Call this function directly.

Parameters:

Return Value:

MCanvasGraphic * -The orphaned graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Swap

virtual MCanvasGraphic * Swap (const TCanvasGraphicID &, MCanvasGraphic * adopt)

Interface Category:

API.

Purpose:

Adopts a graphic in place of the identified other graphic. First, it swaps the IDs of the graphics so that the new graphic assumes the identity of the replaced graphic. Then, it returns the replaced graphic, passing the ownership responsibility to the caller.

Calling Context:

Typically called in the context of undoing or redoing a command.

Parameters:

Return Value:

MCanvasGraphic * -The replaced graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Delete

virtual void Delete (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

Removes the identified graphic and destructs it.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::DeleteAll

virtual void DeleteAll ()

Interface Category:

API.

Purpose:

Removes all graphics and destructs them.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Member

virtual bool Member (const TCanvasGraphicID &) const

Interface Category:

API.

Purpose:

Determines if the identified graphic is a member.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the identified graphic is a member.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::FrontMost

virtual TCanvasGraphicID FrontMost () const

Interface Category:

API.

Purpose:

Identifies the frontmost graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCanvasGraphicID -The ID of the frontmost graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::BackMost

virtual TCanvasGraphicID BackMost () const

Interface Category:

API.

Purpose:

Identifies the backmost graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCanvasGraphicID -The ID of the backmost graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::After

virtual TCanvasGraphicID After (const TCanvasGraphicID &) const

Interface Category:

API.

Purpose:

Identifies the graphic that is immediately after another graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCanvasGraphicID -The ID of the graphic after the other one.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Before

virtual TCanvasGraphicID Before (const TCanvasGraphicID &) const

Interface Category:

API.

Purpose:

Identifies the graphic that is immediately before another graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCanvasGraphicID -The ID of the graphic before the other one.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Count

virtual long Count () const

Interface Category:

API.

Purpose:

Returns the number of graphics stored.

Calling Context:

Call this function directly.

Parameters:

Return Value:

long -The number of graphics.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::CreateReadIterator

virtual TCanvasGraphicReadIterator * CreateReadIterator () const

Interface Category:

API.

Purpose:

Creates a read iterator over this representation.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCanvasGraphicReadIterator * -The iterator.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::CreateWriteIterator

virtual TCanvasGraphicWriteIterator * CreateWriteIterator ()

Interface Category:

API.

Purpose:

Creates a write iterator over this representation.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TCanvasGraphicWriteIterator * -The iterator.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::Lookup

  1. virtual const MCanvasGraphic * Lookup (const TCanvasGraphicID &) const
  2. virtual MCanvasGraphic * Lookup (const TCanvasGraphicID &)

Interface Category:

API.

Purpose:

  1. Returns a const pointer to the identified graphic.
  2. Returns a non-const pointer to the identified graphic.

Calling Context:

  1. Called to cross-reference a graphic from its ID.
  2. Called to cross-reference a graphic from its ID.

Parameters:

Return Value:

  1. const MCanvasGraphic * -A const pointer to the graphic.
  2. MCanvasGraphic * -A non-const pointer to the graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::operator<<=

virtual TStream & operator <<= (TStream &)

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::operator>>=

virtual TStream & operator >>=(TStream &) 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:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::operator=

TStandardCanvasModel & operator =(const TStandardCanvasModel &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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: TStandardCanvasModel::~TStandardCanvasModel

virtual ~ TStandardCanvasModel ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::TStandardCanvasModel

  1. TStandardCanvasModel ()
  2. TStandardCanvasModel (const TStandardCanvasModel &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and to create a new object.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStandardCanvasModel::GetUndoRedoOrder

TDequeOf < TCanvasGraphicID > * GetUndoRedoOrder ()

Interface Category:

API.

Purpose:

Provides the canvas model with enough information so that it can restore its original location (with regard to the surrounding MCanvasGraphic) during an "undo" operation.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a list of TCanvasGraphicIDs.

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.