Class Clipboard
Definition
- Namespace:
- Tizen.NUI
- Assembly:
- Tizen.NUI.dll
Clipboard.
C#Copypublic class Clipboard : BaseHandle, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable
- Inheritance
- Implements
Properties
Declaration
C#Copypublic static Clipboard Instance { get; }
Property Value
Type | Description |
---|---|
Clipboard |
Methods
Declaration
C#Copyprotected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
GetData(String, Clipboard.ClipboardCallback)
Request get data of the specified mime type from clipboard
and invokes the given callback with the received clipboard data.
Declaration
C#Copypublic void GetData(string mimeType, Clipboard.ClipboardCallback dataReceivedCallback)
Parameters
Type | Name | Description |
---|---|---|
String | mimeType | The mime type of data to request. |
Clipboard.ClipboardCallback | dataReceivedCallback | The callback method to handle the received clipboard data. |
Remarks
GetData() method is introduced to fetch data of the specified mime type,
and it expects a callback function as a parameter.
The given callback is invoked with received clipboard data.
The callback is designed to be used only once for handling the data.
Examples
The following example demonstrates how to use the GetData and ClipboardCallback.
Copystring MIME_TYPE_PLAIN_TEXT = "text/plain;charset=utf-8"; Clipboard.Instance.GetData(MIME_TYPE_PLAIN_TEXT, OnClipboardDataReceived); ... public void OnClipboardDataReceived(bool success, ClipEvent clipEvent) { if (!success) return; string mimeType = clipEvent.MimeType; string data = clipEvent.Data; }
Declaration
C#Copypublic bool SetData(string mimeType, string data)
Parameters
Type | Name | Description |
---|---|---|
String | mimeType | The mime type of the data. |
String | data | The data to be set on the clipboard. |
Returns
Type | Description |
---|---|
Boolean | True if the internal clipboard sending request is successful. |
Examples
The following example demonstrates how to use the SetData.
Copystring MIME_TYPE_PLAIN_TEXT = "text/plain;charset=utf-8"; Clipboard.Instance.SetData(MIME_TYPE_PLAIN_TEXT, "Hello Clipboard");
Events
DataSelected
The DataSelected event is emitted when a copy event occurs somewhere.
In order for this event to operate normally,
the process using this event must be Secondary Selection.
Declaration
C#Copypublic event EventHandler<ClipboardDataSelectedEventArgs> DataSelected
Event Type
Type | Description |
---|---|
EventHandler<ClipboardDataSelectedEventArgs> |
Examples
The following example demonstrates how to use the DataSelected.
CopykvmService.SetSecondarySelection(); // precondition Clipboard.Instance.DataSelected += (s, e) => { string selectedType = e.MimeType; };