Public Types | |
typedef std::vector < IClipboardFormat * > | Formats |
List of the clipboard formats. | |
Public Member Functions | |
CCopyPaste (bool bAutoDelete=false) | |
Constructor. | |
virtual | ~CCopyPaste () |
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 bool | Copy (const CGrid &grid) |
Copies content of CGrid to the clipboard. | |
virtual bool | Cut (const CGrid &grid) |
Cuts content of CGrid to the clipboard. | |
virtual bool | Paste (CPasteTarget &pasteTarget) |
Pastes the data, placed in the clipboard to CGrid. | |
virtual bool | CustomCutCopy (CCutCopySource &source) |
Performs a copy/cut operation. The source has serializable content that can be modified. | |
virtual bool | CustomPaste (CPasteTarget &pasteTarget, IClipboardFormat::RestoredInfo &restoredInfo, OperationType type) |
Performs a paste operation. The restoredInfo contains deserialized content which can be modified before being put to the grid. | |
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. |
Provides basic functionality to copy/cut/paste objects from one grid to another via the clipboard mechanism. An object of this class can import data objects from other applications. These objects are deserialized from a binary presentation with the help of Common::CTypeFactory and are stocked in the internal container. Restored objects can be obtained by GetImportedObjects() call. When the application is stopped, all non retrieved data objects will be destroyed in the destructor of this class. If you want to prevent them from destruction, after each paste operation it should call RemoveImportedObjects(false).
CCopyPaste | ( | 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. |
CCopyPaste::Formats & GetFormats | ( | ) | const [virtual] |
Gets a list of all registered formats.
bool Copy | ( | const CGrid & | grid | ) | [virtual] |
Copies content of CGrid to the clipboard.
[in] | grid | Reference to the grid |
Implements ICopyPaste.
bool Cut | ( | const CGrid & | grid | ) | [virtual] |
Cuts content of CGrid to the clipboard.
[in] | grid | Reference to the grid |
Implements ICopyPaste.
bool Paste | ( | CPasteTarget & | pasteTarget | ) | [virtual] |
Pastes the data, placed in the clipboard to CGrid.
[in] | pasteTarget | Indicates the position in CGrid where the clipboard content should be inserted. |
Implements ICopyPaste.
bool CustomCutCopy | ( | CCutCopySource & | source | ) | [virtual] |
Performs a copy/cut operation. The source has serializable content that can be modified.
Copies or cuts content of the grid into the clipboard with the specified formats
[in] | source | Source related information to copy into the clipboard. |
bool CustomPaste | ( | CPasteTarget & | pasteTarget, | |
IClipboardFormat::RestoredInfo & | restoredInfo, | |||
OperationType | type | |||
) | [virtual] |
Performs a paste operation. The restoredInfo contains deserialized content which can be modified before being put to the grid.
Pastes data from the clipboard to the grid.
[in] | pasteTarget | target - related information (grid, position, etc...). |
[in] | restoredInfo | Clipboard content to be pasted. |
[in] | type | Indicates the way, how the items were inserted into the clipboard. |
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, 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 |