MFC Grid manual

CLocalDataFormat Class Reference

Local data format to process drag and drop and copy/paste operations inside of an application. More...

#include <Dapfor/GUI/LocalDataFormat.h>

Inheritance diagram for CLocalDataFormat:

IClipboardFormat

List of all members.


Public Member Functions

 CLocalDataFormat ()
 Constructor.
 ~CLocalDataFormat ()
 Virtual destructor.
virtual void Prepare (const Handles &handles, const CHeader &header)
 Prepares data for serialization to the clipboard.
virtual long GetSerializationSize () const
 Gets the size in bytes needed to store data to a binary buffer.
virtual void Serialize (void *buffer, const CGrid &grid, ContextType contextType, long userData) const
 Serializes data to a binary buffer.
virtual void Clear ()
 Clears temporary data created during a serialization process.
virtual int GetFormatId () const
 Gets a clipboard format identifier (Registered with 'Dapfor.LocalDataFormat' name).
virtual bool Deserialize (const void *buffer, long bufSize, const IObjectImporter *importer, IClipboardFormat::RestoredInfo &restoredInfo)
 Deserializes data from the clipboard and tries to restore grid handles with their hierarchy.

Static Public Member Functions

static int LocalDataFormatFormatId ()
 Gets clipboard format identifier (Registered with 'Dapfor.LocalDataFormat' name).

Detailed Description

Local data format to process drag and drop and copy/paste operations inside of an application.

Version:
1.0.0.0 Initial version

Constructor & Destructor Documentation

CLocalDataFormat (  ) 

Constructor.

class CLocalDataFormat


Member Function Documentation

void Prepare ( const Handles &  handles,
const CHeader header 
) [virtual]

Prepares data for serialization to the clipboard.

Parameters:
[in] handles Handles to be serialized.
[in] header CGrid header. Usually a current header is used.

Implements IClipboardFormat.

long GetSerializationSize (  )  const [virtual]

Gets the size in bytes needed to store data to a binary buffer.

Returns:
Size, needed to store data in bytes.

Implements IClipboardFormat.

void Serialize ( void *  buffer,
const CGrid grid,
ContextType  contextType,
long  userData 
) const [virtual]

Serializes data to a binary buffer.

Parameters:
[in] buffer Storage to which data is serialized. The buffer must be preliminary allocated with the size, returned by GetSerializationSize() function
[in] grid Reference to the grid
[in] contextType Context from which data is taken.
[in] userData 32-bit user-defined value

Implements IClipboardFormat.

int GetFormatId (  )  const [virtual]

Gets a clipboard format identifier (Registered with 'Dapfor.LocalDataFormat' name).

Returns:
Identifier registered with 'Dapfor.LocalDataFormat' name.

Implements IClipboardFormat.

bool Deserialize ( const void *  buffer,
long  bufSize,
const IObjectImporter importer,
IClipboardFormat::RestoredInfo restoredInfo 
) [virtual]

Deserializes data from the clipboard and tries to restore grid handles with their hierarchy.

Parameters:
[in] buffer The binary buffer, got from the clipboard.
[in] bufSize Buffer size.
[in] importer Pointer to the object that can instantiate objects of specified classes from a binary form. Usually Common::CTypeFactory is used which permits to import data from other applications.
[in,out] restoredInfo Storage, that keeps all restored data with their hierarchy.
Returns:
True if success. Otherwise false.

Implements IClipboardFormat.

int LocalDataFormatFormatId (  )  [static]

Gets clipboard format identifier (Registered with 'Dapfor.LocalDataFormat' name).

Returns:
Identifier registered with 'Dapfor.LocalDataFormat' name.