[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'Clipbrd' (#lcl)

# TClipboard

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Represents the clipboard on platforms supported for the LCL.

## Declaration

Source position: clipbrd.pp line 152

`type TClipboard = class(TPersistent)`
`public`
`function AddFormat();` |  | Acquires ownership of the Clipboard and adds a format.
`procedure Assign(); override;` |  | Copies properties from the specified persistent object to the clipboard.
`procedure AssignTo(); override;` |  | Copies property values into the specified persistent object.
`procedure Clear;` |  | Clears the content in the clipboard.
`procedure Close;` |  | Closes down the clipboard.
`constructor Create();` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`function FindPictureFormatID;` |  | Gets the first format ID that is a graphic format supported in TPicture.
`function FindFormatID();` |  | Gets the clipboard format which used the specified name (MIME type).
`function GetAsHtml();` |  | Retrieves the HTML content of the clipboard (if available).
`function GetComponent();` |  | Gets a TComponent instance with the specified owner and parent from the clipboard.
`procedure GetComponentAsText();` |  | Loads a component instance from a textual representation stored in the clipboard.
`function GetFormat();` |  | Gets the data for the specified clipboard format from the LCL interface or cached clipboard data.
`procedure SupportedFormats();` |  | Gets the list of supported formats for the clipboard.
`function GetTextBuf();` |  | Reads text from the clipboard and returns the content and number of characters.
`function HasFormat();` |  | Determines whether the specified clipboard format is supported for the clipboard.
`function HasFormatName();` |  | Indicates whether a clipboard format exists with the specified name (MIME type).
`function HasPictureFormat;` |  | Indicates whether a clipboard format for graphical data is present in the supported formats.
`procedure Open;` |  | Open the clipboard to receive and transmit data.
`procedure SetAsHtml();` |  | Puts a HTML string on the clipboard.
`function SetComponent();` |  | Writes the specified component to the storage for the Clipboard format.
`function SetComponentAsText();` |  | Stores the specified Component in the clipboard.
`function SetFormat();` |  | Sets the clipboard format to the specified identifier and copies the value in Stream.
`function SetSupportedFormats();` |  | Sets all supported clipboard formats at once.
`procedure SetTextBuf();` |  | Loads the clipboard buffer using the text in the specified PChar value.
`property AsText: string; [rw]` |  | Text stored in the clipboard.
`property ClipboardType: TClipboardType; [r]` |  | Contains the clipboard type for the platform.
`property FormatCount: Integer; [r]` |  | Contains the number of clipboard formats supported for the class instance.
`property Formats []: TClipboardFormat; [r]` |  | Contains the clipboard formats currently in use for the class instance.
`property OnRequest: TClipboardRequestEvent; [rw]` |  | OnRequest - event handler for a request for clipboard data.
`end;`

## Inheritance

`TClipboard` |  | Represents the clipboard on platforms supported for the LCL.
`TPersistent`
?
`TObject`

## Description

TClipboard is an area used to hold information that has been cut or copied, and is available for pasting.

The clipboard object encapsulates the Windows clipboard as well as the three standard Gtk selections. For each of the three clipboards/selections there is an object: PrimarySelection, SecondarySelection and Clipboard. There is no difference between the three objects except their type.

A lot of information about Clipboard Formats, including predefined formats for Delphi/Kylix compatibility, is found in the LCLType unit, at TClipboardFormat, TClipboardType, ClipboardTypeName, TPredefinedClipboardFormat, PredefinedClipboardMimeTypes

## See also

TClipboardFormat |  | Alias for the PtrUInt type.
TClipboardType |  | Represents the sources or dispositions for clipboard data.
ClipboardTypeName |  | Contains the names associated with the clipboard types accessed using the enumeration values.
TPredefinedClipboardFormat |  | Represents predefined clipboard formats used in the LCL.
PredefinedClipboardMimeTypes |  | Contains MIME types for the values in the TPredefinedClipboardFormat enumeration.