A class representing the system clipboard.
![]() | Format Pre-defined formats for data that may be stored or transferred in the clipboard. |
![]() | PClipboard ( const PInteractor * owner ) Create a clipboard object to allow access to the system clipboard. |
![]() | ~PClipboard () End access to the system clipboard deleting the clipboard object. |
![]() | InUse () Determine if the clipboard was already in use. |
![]() | HasFormat ( Format fmt ) Determine if there is data in the clipboard of the specified format. |
![]() | HasFormat ( const PString & fmt ) Determine if there is data in the clipboard of the specified format. |
![]() | GetSize ( const PString & fmt ) Get the size of the data in the clipboard for the specifed format. |
![]() | GetData ( const PString & fmt, void * data, DWORD max ) Get the data from the clipboard to the specified memory block. |
![]() | SetData ( const PString & fmt, const void * data, DWORD len ) Set the data in the clipboard to the data specified by the memory block and length. |
![]() | GetText () Get the data from the clipboard as a string if it is available in the |
![]() | SetText ( const PString & str ) Set the data in the clipboard to the text specified by the string in the |
![]() | GetPixels () Get the data from the clipboard as a pixel image if it is available in the |
![]() | SetPixels ( const PPixelImage & img ) Set the data in the clipboard to the pixel image specified in the |
![]() | GetPict () Get the data from the clipboard as a picture image if it is available in the |
![]() | SetPict ( const PPictImage & pic ) Set the data in the clipboard to the picture image specified in the |
![]() | New functions for class |
![]() | owner The interactor that öwns" the open clipboard. |
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
A class representing the system clipboard. This is a platform dependent entity for temporary storage and/or transfering between applications of user data in a set of possible formats.There are only a few primitive data types supported, with all remaining types supported through a generic mechanism. The types are simple text, pixel images and picture images. All other types are represented by an arbitrary string and the data is placed in a simple memory block. The interpretation of that memory block is application dependent.
The clipboard only ever contains one item of data, though this data may be available in a number of different formats. For example, a string contained in a drawing package may be placed in the clipboard in several ways: as a simple ANSI character sequence, as a pixel image of the rendered font, as a sequence of drawing commands that set the font, colours and a draw text command, or, finally, as an internal format containing the raw data structure used by the package.
When transferring data between applications, only those that recognise the format name string will be able to use that format of data. Typically, an application places data in the clipboard in multiple formats for maximum portability across applications.
This function will fail if the clipboard was already in use when the
object was constructed.
The previous contents of the clipboard is lost on the first call to
SetData for a particular clipboard object. Further calls to data setting
functions will add the new format to the clipboard and not lose the
previously set data. Once the PClipboard object is destroyed the next
construction resets this mechanism so that data is lost once more. This function will fail if the clipboard was already in use when the
object was constructed.
This function will fail, returning an empty string, if the clipboard was
already in use when the object was constructed.
The previous contents of the clipboard is lost on the first call to
SetText for a particular clipboard object. Further calls to data setting
functions will add the new format to the clipboard and not lose the
previously set data. Once the PClipboard object is destroyed the next
construction resets this mechanism so that data is lost once more. This function will fail if the clipboard was already in use when the
object was constructed.
This function will fail, returning an empty image, if the clipboard was
already in use when the object was constructed.
The previous contents of the clipboard is lost on the first call to
SetPixels for a particular clipboard object. Further calls to data
setting functions will add the new format to the clipboard and not lose
the previously set data. Once the PClipboard object is destroyed the
next construction resets this mechanism so that data is lost once more. This function will fail if the clipboard was already in use when the
object was constructed.
This function will fail, returning an empty image, if the clipboard was
already in use when the object was constructed.
The previous contents of the clipboard is lost on the first call to
SetPict for a particular clipboard object. Further calls to data setting
functions will add the new format to the clipboard and not lose the
previously set data. Once the PClipboard object is destroyed the next
construction resets this mechanism so that data is lost once more. This function will fail if the clipboard was already in use when the
object was constructed.
~PClipboard()
New functions for class
BOOL InUse()
enum Format
BOOL HasFormat( Format fmt )
BOOL HasFormat( const PString & fmt )
DWORD GetSize( const PString & fmt )
BOOL GetData( const PString & fmt, void * data, DWORD max )
data - Pointer to memory to receive the data.
max - Size of the block of memory.BOOL SetData( const PString & fmt, const void * data, DWORD len )
data - Pointer to memory block to transfer.
len - Number of bytes to transfer to clipboard.PString GetText()
BOOL SetText( const PString & str )
PPixelImage GetPixels()
BOOL SetPixels( const PPixelImage & img )
PPictImage GetPict()
BOOL SetPict( const PPictImage & pic )
const PInteractor* owner
Alphabetic index HTML hierarchy of classes or Java