MDataExchanger mixin

The Compound Document framework provides a selection mixin (MDataExchanger) together with a suite of commands. For data exchange, selections that need to use this protocol inherit from this mixin and implement the mixin's member functions. These member functions are immediately usable by the data exchange commands.

The MDataExchanger mixin class provides the interface for negotiating data types for exchange between selections. A source data exchanger selection produces a list of model types in which it can provide the selected data. The destination data exchanger selection chooses the type of model in which it prefers to receive the data. If the destination model supports embedding, the destination (receiving) data exchanger selection must accept an embedder model.

After a type has been selected in the type negotiation process, the source selection makes a CopyData call that obtains a copy of the chosen type. The model returned by the CopyData call is then passed back to the destination selection by AbsorbData.

This negotiation can occur across document tasks when exchanging data between anchor markers. In this event, TDocumentSurrogate is used to access remote information.

If the data is to be embedded in the destination, the source model and associated presenter state must be wrapped in a document component and the component placed in an embedded document component model. The destination then absorbs the contents of this embedder model, resulting in the document component being embedded in the destination.

This entire exchange process is usually carried out by a command object such as TPasteCommand or TPushDataCommand.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker