Public Types | |
typedef std::vector < IClipboardFormat * > | Formats |
List of the clipboard formats. | |
Public Member Functions | |
CDragDrop (bool bAutoDelete=false) | |
Constructor. | |
virtual | ~CDragDrop () |
Virtual destructor. | |
virtual void | RegisterFormat (IClipboardFormat *format) |
Registers a new clipboard format. The formats are applied in order of their registration. | |
virtual Formats & | GetFormats () const |
Gets a list of all registered formats. | |
virtual DROPEFFECT | DoDrag (CDragSource &dragSource) |
Called to perform a drag operation. | |
virtual DROPEFFECT | OnDragEnter (const CDropTarget &dropTarget) |
Called by CGrid when the cursor is dragged into a window for the first time. | |
virtual DROPEFFECT | OnDragOver (const CDropTarget &dropTarget) |
Called by CGrid when the cursor is dragged over a window. | |
virtual BOOL | OnDrop (const CDropTarget &dropTarget, DROPEFFECT dropEffect) |
Called by CGrid when a drop operation is about to occur. | |
virtual void | OnDragLeave (const CGrid &grid) |
Called by the framework when the cursor leaves a window during a dragging operation. | |
virtual bool | CanDrop (const CDropTarget &dropTarget) const |
The function indicates whether data can be dropped to a specified location. | |
virtual DROPEFFECT | DoCustomDrag (CDragSource &dragSource, Formats formats) |
Customization of a drag operation. | |
virtual BOOL | DoCustomDrop (const CDropTarget &dropTarget, IClipboardFormat::RestoredInfo &restoredInfo, DROPEFFECT dropEffect) |
Customization of a drop operation. | |
virtual Common::CDataObject * | ImportObject (const TString &className) const |
Tries to create a new data object of the class specified in the className parameter. | |
virtual void | GetImportedObjects (ImportedObjects &container) const |
Gets all imported objects. | |
virtual void | RemoveImportedObjects (bool bDestroy) |
Removes all imported objects from the local cache. | |
virtual bool | AutoDelete () const |
IAutoDelete implementation. Returns the value, passed in the constructor. |
An object of this class can import data objects from other applications. These objects are deserialized from binary presentation with help of Common::CTypeFactory and are stocked in the internal container. The restored objects can be obtained by calling GetImportedObjects(). When the application is stopped, all non-retrieved data objects are destroyed in the destructor of this class. If you want to prevent their destruction, after each drop operation it should call RemoveImportedObjects(false).
CDragDrop | ( | bool | bAutoDelete = false |
) |
Constructor.
[in] | bAutoDelete | Indicates that this object can be destroyed in the destructor of CGrid |
void RegisterFormat | ( | IClipboardFormat * | format | ) | [virtual] |
Registers a new clipboard format. The formats are applied in order of their registration.
[in] | format | A new clipboard format. |
CDragDrop::Formats & GetFormats | ( | ) | const [virtual] |
Gets a list of all registered formats.
DROPEFFECT DoDrag | ( | CDragSource & | dragSource | ) | [virtual] |
Called to perform a drag operation.
[in] | dragSource | Contains a header, list of item handles and the grid itself where these handles are taken. |
Implements IDragDrop.
DROPEFFECT OnDragEnter | ( | const CDropTarget & | dropTarget | ) | [virtual] |
Called by CGrid when the cursor is dragged into a window for the first time.
[in] | dropTarget | Contains the drop position where a clipboard content should be placed. |
Implements IDragDrop.
DROPEFFECT OnDragOver | ( | const CDropTarget & | dropTarget | ) | [virtual] |
Called by CGrid when the cursor is dragged over a window.
[in] | dropTarget | Contains a drop position where the clipboard content should be placed. |
Implements IDragDrop.
BOOL OnDrop | ( | const CDropTarget & | dropTarget, | |
DROPEFFECT | dropEffect | |||
) | [virtual] |
Called by CGrid when a drop operation is about to occur.
[in] | dropTarget | Contains the drop position where a clipboard content should be placed. |
TRUE if the clipboard data have been successfully dropped. Otherwise FALSE.
Implements IDragDrop.
void OnDragLeave | ( | const CGrid & | grid | ) | [virtual] |
Called by the framework when the cursor leaves a window during a dragging operation.
[in] | grid | Reference to the grid the cursor is leaving. |
Implements IDragDrop.
bool CanDrop | ( | const CDropTarget & | dropTarget | ) | const [virtual] |
The function indicates whether data can be dropped to a specified location.
Implements IDragDrop.
DROPEFFECT DoCustomDrag | ( | CDragSource & | dragSource, | |
Formats | formats | |||
) | [virtual] |
Customization of a drag operation.
Puts a content of the grid into the clipboard with the specified formats
[in] | dragSource | Contains the header, list of item handles and the grid itself where these handles were taken. |
[in] | formats | List of the clipboard formats, used to serialize data to the clipboard. |
BOOL DoCustomDrop | ( | const CDropTarget & | dropTarget, | |
IClipboardFormat::RestoredInfo & | restoredInfo, | |||
DROPEFFECT | dropEffect | |||
) | [virtual] |
Customization of a drop operation.
Drops data from the clipboard to the grid.
[in] | dropTarget | Contains the drop position where the clipboard content should be placed. |
[in] | restoredInfo | Deserialized clipboard data. |
[in] | dropEffect | The effect that the user chose for the drop operation. It can be one of the following: DROPEFFECT_COPY A copy operation would be performed. DROPEFFECT_MOVE A move operation would be performed. DROPEFFECT_LINK A link to the original data would be established. |
Common::CDataObject * ImportObject | ( | const TString & | className | ) | const [virtual] |
Tries to create a new data object of the class specified in the className parameter.
[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(). |
Implements IObjectImporter.
void GetImportedObjects | ( | ImportedObjects & | container | ) | const [virtual] |
Gets all imported objects.
[in,out] | container | Container where all imported objects are copied to. |
void RemoveImportedObjects | ( | bool | bDestroy | ) | [virtual] |
Removes all imported objects from the local cache.
[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. |
Implements IObjectImporter.
bool AutoDelete | ( | ) | const [virtual] |
IAutoDelete implementation. Returns the value, passed in the constructor.
Implements IAutoDelete.
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |