MFC Grid manual

IObjectImporter Class Reference

Interface to import data objects from other applications. More...

#include <Dapfor/GUI/IObjectImporter.h>

Inheritance diagram for IObjectImporter:

CCopyPaste CDragDrop

List of all members.


Public Types

typedef std::vector
< Common::CDataObject * > 
ImportedObjects
 Container to store imported (created by Common::CTypeFactory) data objects.

Public Member Functions

virtual Common::CDataObjectImportObject (const TString &className) const =0
 Tries to create a new data object of the class specified in the className parameter.
virtual void GetImportedObjects (ImportedObjects &container) const =0
 Copies all imported data objects to the container.
virtual void RemoveImportedObjects (bool bDestroy)=0
 Removes all imported objects from the local cache.

Detailed Description

Interface to import data objects from other applications.

These objects are deserialized from a binary presentation by Common::CTypeFactory. Restored objects can be obtained by GetImportedObjects() call. When an application is stopped, all non-retrieved data objects are destroyed. If you want to prevent them from destruction, after each drop operation it should call RemoveImportedObjects(false).

Version:
1.0.0.0 Initial version

Member Function Documentation

Common::CDataObject * ImportObject ( const TString &  className  )  const [pure virtual]

Tries to create a new data object of the class specified in the className parameter.

Parameters:
[in] className Name of the class, an instance of which should be created. Usually the class can be registered with the macro DF_DECLARE_SERIALIZABLE_TYPE().
Returns:
An instance of the class that has been registered in Common::CTypeFactory. If the appropriate class can't be found, the function returns a new instance Common::CDynamicObject.

Implemented in CCopyPaste, and CDragDrop.

void GetImportedObjects ( ImportedObjects container  )  const [pure virtual]

Copies all imported data objects to the container.

Parameters:
[in,out] container Container where all imported objects are copied to.

void RemoveImportedObjects ( bool  bDestroy  )  [pure virtual]

Removes all imported objects from the local cache.

Parameters:
[in] bDestroy Indicates whether it should destroy data objects. If the flag is set, the data objects will be physically destroyed and all the handles associated with will be automatically removed from all grids.

Implemented in CCopyPaste, and CDragDrop.