The nsIClipboard interface supports basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data.
nsIClipboard is defined in widget/public/nsIClipboard.idl
. It is scriptable
and
unfrozen (hasn't changed since Mozilla 1.8)
.
Inherits from: nsISupports
void setData(in nsITransferable aTransferable, in nsIClipboardOwner anOwner, in long aWhichClipboard);
|
void getData(in nsITransferable aTransferable, in long aWhichClipboard);
|
void emptyClipboard(in long aWhichClipboard);
|
boolean hasDataMatchingFlavors([array, size_is(aLength)] in string aFlavorList, in unsigned long aLength, in long aWhichClipboard);
|
boolean supportsSelectionClipboard();
|
| Constant | Value | Description |
kSelectionClipboard
| 0 | Clipboard for selection. |
kGlobalClipboard
| 1 | Clipboard for global use. |
This method is given a transferable, and it sets the data on the native clipboard. It results into a NS_Ok if there are no errors.
void setData( in nsITransferable aTransferable, in nsIClipboardOwner anOwner, in long aWhichClipboard );
This method is given a transferable, and it retrieves the clipboard data. It results into a NS_Ok, if there are no errors.
void getData( in nsITransferable aTransferable, in long aWhichClipboard );
This method empties the clipboard and notifies the clipboard owner. It empties the "logical" clipboard. It does not clear the native clipboard. It results into a NS_OK, if it is successful.
void emptyClipboard( in long aWhichClipboard );
This method provides a way to give correct UI feedback about, for instance, a paste should be allowed. It does not actually retreive the data and should be a very inexpensive call. All it does is check if there is data on the clipboard matching any of the flavors in the given list. It results into a NS_OK, if it is successful.
boolean hasDataMatchingFlavors( [array, size_is(aLength)] in string aFlavorList, in unsigned long aLength, in long aWhichClipboard );
Page last modified 00:31, 3 Jan 2008 by Arehman4