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"
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;
20 // Used to cache current selection on (nsClipboard) for macOS service menu.
21 const long kSelectionCache
= 3;
24 * Given a transferable, set the data on the native clipboard
26 * @param aTransferable The transferable
27 * @param anOwner The owner of the transferable
28 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
29 * @result NS_Ok if no errors
32 void setData
( in nsITransferable aTransferable
, in nsIClipboardOwner anOwner
,
33 in long aWhichClipboard
) ;
36 * Given a transferable, get the clipboard data.
38 * @param aTransferable The transferable
39 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
40 * @result NS_Ok if no errors
43 void getData
( in nsITransferable aTransferable
, in long aWhichClipboard
) ;
46 * This empties the clipboard and notifies the clipboard owner.
47 * This empties the "logical" clipboard. It does not clear the native clipboard.
49 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
50 * @result NS_OK if successful.
53 void emptyClipboard
( in long aWhichClipboard
) ;
56 * This provides a way to give correct UI feedback about, for instance, a paste
57 * should be allowed. It does _NOT_ actually retreive the data and should be a very
58 * inexpensive call. All it does is check if there is data on the clipboard matching
59 * any of the flavors in the given list.
61 * @param aFlavorList An array of ASCII strings.
62 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
63 * @outResult - if data is present matching one of
64 * @result NS_OK if successful.
66 boolean hasDataMatchingFlavors
( in Array
<ACString
> aFlavorList
,
67 in long aWhichClipboard
) ;
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
( ) ;
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
( ) ;