Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Clipboard Class Reference

The Clipboard represents a common place to put shared data between objects and/or between applications. More...

#include <vcf/ApplicationKit/Clipboard.h>

Inheritance diagram for VCF::Clipboard:

VCF::Object List of all members.

Public Member Functions

 Clipboard ()
virtual ~Clipboard ()
ClipboardItemPasted bool hasDataType (const String &dataType)
 does the Clipboard have a DataObject that matches the requested dataType
void copyTo (DataObject *dataObject)
 copies the specified dataObject into the clipboard.
DataObjectpasteFrom (const String &dataType)
 pastes the data, specified in dataType, from the Clipboard and returns it.
void internal_deleteDataObject (DataObject *dataObject)
 internal VCF use only

Public Attributes

VCF::Delegate ClipboardDelegate
ClipboardContentsChanged VCF::Delegate ClipboardDelegate
ClipboardItemCopied VCF::Delegate ClipboardDelegate

Detailed Description

The Clipboard represents a common place to put shared data between objects and/or between applications.

The Clipboard maintains one or more ClipboardDataObjects that actually hold the data, according to their DataType.

The clipboard is never created directly - this is taken care of by the UIToolkit. To access the clipboard you call the UIToolkit::getSystemClipboard() method which will return a reference to the Clipboard singleton.

In Win32 the Clipboard is implemented with full support for COM's IDataObject for actual data transfer, so objects that put data into the Clipboard in the VCF can easily share the data with other Win32 programs.

See also:
DataObject

DataType

ClipboardPeer

UIToolkit::getSystemClipboard()

Event Delegates for this class:
  • Clipboard::ClipboardContentsChanged
  • Clipboard::ClipboardItemCopied
  • Clipboard::ClipboardItemPasted


Constructor & Destructor Documentation

VCF::Clipboard::Clipboard  ) 
 

virtual VCF::Clipboard::~Clipboard  )  [virtual]
 


Member Function Documentation

void VCF::Clipboard::copyTo DataObject dataObject  ) 
 

copies the specified dataObject into the clipboard.

The Clipboard takes ownership of the dataObject object passed in which must be created on the heap.

Parameters:
DataObject the data object to place in the Clipboard
For example:
        Clipboard* clipboard = UIToolkit::getDefaultUIToolkit()->getSystemClipboard();

        String selectedText = "Hello World - here's some clipboard text";
        DataObject* textDataObj = new TextDataObject( selectedText );
        clipboard->copyTo( textDataObj );
See also:
DataObject

ClipboardItemPasted bool VCF::Clipboard::hasDataType const String dataType  ) 
 

does the Clipboard have a DataObject that matches the requested dataType

Parameters:
String the datatype to look for
Returns:
bool return true if the Clipboard has the kind of data specified in dataType, otherwise returns false

void VCF::Clipboard::internal_deleteDataObject DataObject dataObject  ) 
 

internal VCF use only

DataObject* VCF::Clipboard::pasteFrom const String dataType  ) 
 

pastes the data, specified in dataType, from the Clipboard and returns it.

Parameters:
DataType the type of data to paste from the clipboard
See also:
DataType
Returns:
DataObject* the new data from the clipboard or NULL if no data object exists for the specified data type.


Member Data Documentation

ClipboardItemCopied VCF::Delegate VCF::Clipboard::ClipboardDelegate
 

Event Delegate:
ClipboardItemPasted
event class: ClipboardEvent
event type:

ClipboardContentsChanged VCF::Delegate VCF::Clipboard::ClipboardDelegate
 

Event Delegate:
ClipboardItemCopied
event class: ClipboardEvent
event type:

VCF::Delegate VCF::Clipboard::ClipboardDelegate
 

Event Delegate:
ClipboardContentsChanged is fired when the clipboard contents change
event class: ClipboardEvent


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information