Bug 1756130 [wpt PR 32898] - [CSP] Enhance unsafe-eval test to check both realms...
[gecko.git] / widget / nsIClipboard.idl
blob1b89a073c41d7ae9017931b93459b1aefb7746a1
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;
20 // Used to cache current selection on (nsClipboard) for macOS service menu.
21 const long kSelectionCache = 3;
23 /**
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 ) ;
35 /**
36 * Filters the flavors aTransferable can import (see
37 * `nsITransferable::flavorsTransferableCanImport`) and gets the data for the
38 * first flavor. That data is set for aTransferable.
40 * @param aTransferable The transferable
41 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
42 * @result NS_OK if no errors
45 void getData ( in nsITransferable aTransferable, in long aWhichClipboard ) ;
47 /**
48 * This empties the clipboard and notifies the clipboard owner.
49 * This empties the "logical" clipboard. It does not clear the native clipboard.
51 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
52 * @result NS_OK if successful.
55 void emptyClipboard ( in long aWhichClipboard ) ;
57 /**
58 * This provides a way to give correct UI feedback about, for instance, a paste
59 * should be allowed. It does _NOT_ actually retreive the data and should be a very
60 * inexpensive call. All it does is check if there is data on the clipboard matching
61 * any of the flavors in the given list.
63 * @param aFlavorList An array of ASCII strings.
64 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
65 * @outResult - if data is present matching one of
66 * @result NS_OK if successful.
68 boolean hasDataMatchingFlavors ( in Array<ACString> aFlavorList,
69 in long aWhichClipboard ) ;
71 /**
72 * Allows clients to determine if the implementation supports the concept of a
73 * separate clipboard for selection.
75 * @outResult - true if
76 * @result NS_OK if successful.
78 boolean supportsSelectionClipboard ( ) ;
80 /**
81 * Allows clients to determine if the implementation supports the concept of a
82 * separate clipboard for find search strings.
84 * @result NS_OK if successful.
86 boolean supportsFindClipboard ( ) ;
90 %{ C++