Merge mozilla-beta to b2g34. a=merge
[gecko.git] / widget / nsIClipboard.idl
blobc63095a54b7140507076b914e43dc60df11ae3da
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "nsISupports.idl"
9 #include "nsITransferable.idl"
10 #include "nsIClipboardOwner.idl"
12 interface nsIArray;
14 [scriptable, uuid(ceaa0047-647f-4b8e-ad1c-aff9fa62aa51)]
15 interface nsIClipboard : nsISupports
17 const long kSelectionClipboard = 0;
18 const long kGlobalClipboard = 1;
19 const long kFindClipboard = 2;
21 /**
22 * Given a transferable, set the data on the native clipboard
24 * @param aTransferable The transferable
25 * @param anOwner The owner of the transferable
26 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
27 * @result NS_Ok if no errors
30 void setData ( in nsITransferable aTransferable, in nsIClipboardOwner anOwner,
31 in long aWhichClipboard ) ;
33 /**
34 * Given a transferable, get the clipboard data.
36 * @param aTransferable The transferable
37 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
38 * @result NS_Ok if no errors
41 void getData ( in nsITransferable aTransferable, in long aWhichClipboard ) ;
43 /**
44 * This empties the clipboard and notifies the clipboard owner.
45 * This empties the "logical" clipboard. It does not clear the native clipboard.
47 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
48 * @result NS_OK if successful.
51 void emptyClipboard ( in long aWhichClipboard ) ;
53 /**
54 * This provides a way to give correct UI feedback about, for instance, a paste
55 * should be allowed. It does _NOT_ actually retreive the data and should be a very
56 * inexpensive call. All it does is check if there is data on the clipboard matching
57 * any of the flavors in the given list.
59 * @param aFlavorList An array of ASCII strings.
60 * @param aLength The length of the aFlavorList.
61 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
62 * @outResult - if data is present matching one of
63 * @result NS_OK if successful.
65 boolean hasDataMatchingFlavors ( [array, size_is(aLength)] in string aFlavorList,
66 in unsigned long aLength,
67 in long aWhichClipboard ) ;
69 /**
70 * Allows clients to determine if the implementation supports the concept of a
71 * separate clipboard for selection.
73 * @outResult - true if
74 * @result NS_OK if successful.
76 boolean supportsSelectionClipboard ( ) ;
78 /**
79 * Allows clients to determine if the implementation supports the concept of a
80 * separate clipboard for find search strings.
82 * @result NS_OK if successful.
84 boolean supportsFindClipboard ( ) ;
88 %{ C++