1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is Mozilla Communicator.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corp.
20 * Portions created by the Initial Developer are Copyright (C) 1999
21 * the Initial Developer. All Rights Reserved.
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
41 #include
"nsISupports.idl"
42 #include
"nsITransferable.idl"
43 #include
"nsIClipboardOwner.idl"
47 [scriptable
, uuid(38984945-8674-4d04
-b786
-5c0ca9434457
)]
48 interface nsIClipboard
: nsISupports
50 const long kSelectionClipboard
= 0;
51 const long kGlobalClipboard
= 1;
54 * Given a transferable, set the data on the native clipboard
56 * @param aTransferable The transferable
57 * @param anOwner The owner of the transferable
58 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
59 * @result NS_Ok if no errors
62 void setData
( in nsITransferable aTransferable
, in nsIClipboardOwner anOwner
,
63 in long aWhichClipboard
) ;
66 * Given a transferable, get the clipboard data.
68 * @param aTransferable The transferable
69 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
70 * @result NS_Ok if no errors
73 void getData
( in nsITransferable aTransferable
, in long aWhichClipboard
) ;
76 * This empties the clipboard and notifies the clipboard owner.
77 * This empties the "logical" clipboard. It does not clear the native clipboard.
79 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
80 * @result NS_OK if successful.
83 void emptyClipboard
( in long aWhichClipboard
) ;
86 * This provides a way to give correct UI feedback about, for instance, a paste
87 * should be allowed. It does _NOT_ actually retreive the data and should be a very
88 * inexpensive call. All it does is check if there is data on the clipboard matching
89 * any of the flavors in the given list.
91 * @param aFlavorList An array of ASCII strings.
92 * @param aLength The length of the aFlavorList.
93 * @param aWhichClipboard Specifies the clipboard to which this operation applies.
94 * @outResult - if data is present matching one of
95 * @result NS_OK if successful.
97 boolean hasDataMatchingFlavors
( [array
, size_is(aLength
)] in string aFlavorList
,
98 in unsigned long aLength
,
99 in long aWhichClipboard
) ;
102 * Allows clients to determine if the implementation supports the concept of a
103 * separate clipboard for selection.
105 * @outResult - true if
106 * @result NS_OK if successful.
108 boolean supportsSelectionClipboard
( ) ;