Class: TModelScrapItem

Declaration: ModelScrapItem.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TScrapItem

Inherited By:

None.

Purpose:

TModelScrapItem provides a scrap item that is a transport for models. Two possible source for the model are allowed. A selection on an existing model contained in a document may be used, or a new model may be adopted into the scrap item. If the TModelScrapItem is created from a selection, a temporary anchor is created for the selection to facilitate data exchange between the scrap's target and the source. This form is commonly used for drag and drop. If the scrap item is created from an adopted model instance, The model's CreateSelection member function is used to create the selection to be used for as the source for the data exchange. This form is commonly used for clipboard cut/copy/paste. In either form, if a presenter state is provided, either directly, or through a document component selection, TEmbedderModel will be supported as a source type automatically, The embedder model is created by adopting the model and presenter state into a TDocumentComponent, and providing that component in the TEmbedderModel.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Not intended for deriving.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TModelScrapItem::TModelScrapItem

  1. TModelScrapItem (const TDocumentComponentSelection & whichModel)
  2. TModelScrapItem (const TModelSelection & whichModel)
  3. TModelScrapItem (TModel * adoptModel)
  4. TModelScrapItem (TModel * adoptModel, TModelPresenterState * adoptPresenterState)
  5. TModelScrapItem (const TModelScrapItem & copy)
  6. TModelScrapItem ()

Interface Category:

API.

Purpose:

  1. Creates a scrap item given the document component selection. A temporary anchor is created for the model selection, and the presenter state is copied, to allow the selected data to be embedded in a TEmbedderModel.
  2. Creates a scrap item given the model selection. A temporary anchor is create for the selection. Only absorb exchanges are possible, because the presenter state is not available for creation of an embedded component.
  3. Creates a scrap item given a model to adopt. The selection used for data exchange is that selection returned from the model's CreateSelection member function. Embedding is not possible because no presenter state is provided.
  4. Creates a scrap item given a model and presenter state to adopt. The selection used for data exchange is that selection return from the model's CreateSelection member function. A scrap item created this way also supports TEmbedderModel if it is not already supported by the source, by wrapping the model and presenter state in a TDocumentComponent, and providing that component in the TEmbedderModel.
  5. Copy constructor.
  6. Default constructor.

Calling Context:

  1. Called by any client.
  2. Called by any client.
  3. Called by any client.
  4. Called by any client.
  5. Called to copy an object.
  6. Only for internal use by Resurrect. Developers should treat as protected.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelScrapItem::~TModelScrapItem

virtual ~ TModelScrapItem ()

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

TModelScrapItem & operator =(const TModelScrapItem & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelScrapItem::operator>>=

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

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

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 TInvalidVersionError if the version of the object on the stream is not recognized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelScrapItem::CopyModel

TModel * CopyModel (TTypeDescription asType, TMemoryHeap * whichHeap =NIL) const

Interface Category:

API.

Purpose:

Copies the model in the given type. asType must be a type returned from InternalCopyAvailableTypes.

Calling Context:

Called by any client to copy data after a type negotiation.

Parameters:

Return Value:

The copied model. The model will of the type asType.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelScrapItem::InternalCopyAvailableTypes

virtual void InternalCopyAvailableTypes (TSequenceOf < TTypeDescription > & result, TMemoryHeap & whichHeap) const

Interface Category:

API.

Purpose:

Fills in result with the list of possible model types that can be produced by this scrap item. The list is the list returned from a selection on the source model. If a presenter state is available, TEmbedderModel will also exist in the list.

Calling Context:

Called by TScrapItem.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelScrapItem::OrphanModel

TModel * OrphanModel ()

Interface Category:

API.

Purpose:

Orphans the model owned by this scrap item and returns it to the caller. If the scrap item does not own a model, NIL is returned.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

TModel * -The orphaned model.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The caller owns the orphaned model.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.