WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIClipboard

IID:38984945-8674-4d04-b786-5c0ca9434457
Inherits From:nsISupports

This interface is intended to be used as a service. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/widget/clipboard;1"].
            getService(Components.interfaces.nsIClipboard);

This interface is implemented by the following components:


Constants

PRInt32 kSelectionClipboard = 0
PRInt32 kGlobalClipboard = 1

Methods

void emptyClipboard ( PRInt32 whichClipboard ) void getData ( nsITransferable transferable , PRInt32 whichClipboard ) PRBool hasDataMatchingFlavors ( arrayof char* flavorList , PRUint32 length , PRInt32 whichClipboard ) void setData ( nsITransferable transferable , nsIClipboardOwner anOwner , PRInt32 whichClipboard ) PRBool supportsSelectionClipboard ( )

void emptyClipboard ( PRInt32 whichClipboard )

This empties the clipboard and notifies the clipboard owner. This empties the "logical" clipboard. It does not clear the native clipboard.

Arguments:
whichClipboard: Specifies the clipboard to which this operation applies.

void getData ( nsITransferable transferable , PRInt32 whichClipboard )

Given a transferable, get the clipboard data.

Arguments:
transferable: The transferable
whichClipboard: Specifies the clipboard to which this operation applies.

PRBool hasDataMatchingFlavors ( arrayof char* flavorList , PRUint32 length , PRInt32 whichClipboard )

This 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.

Arguments:
flavorList: An array of ASCII strings.
length: The length of the flavorList.
whichClipboard: Specifies the clipboard to which this operation applies.

void setData ( nsITransferable transferable , nsIClipboardOwner anOwner , PRInt32 whichClipboard )

Given a transferable, set the data on the native clipboard

Arguments:
transferable: The transferable
anOwner: The owner of the transferable
whichClipboard: Specifies the clipboard to which this operation applies.

PRBool supportsSelectionClipboard ( )

Allows clients to determine if the implementation supports the concept of a separate clipboard for selection.

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com