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 the Mozilla browser.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications, Inc.
20 * Portions created by the Initial Developer are Copyright (C) 1999
21 * the Initial Developer. All Rights Reserved.
24 * Dan Rosen <dr@netscape.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or 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 ***** */
40 #include
"nsISupports.idl"
43 * An interface for embedding clients who wish to interact with
44 * the system-wide OS clipboard. Mozilla does not use a private
45 * clipboard, instead it places its data directly onto the system
46 * clipboard. The webshell implements this interface.
51 [scriptable
, uuid(b8100c90
-73be
-11d2
-92a5
-00105a1b0d64
)]
52 interface nsIClipboardCommands
: nsISupports
{
55 * Returns whether there is a selection and it is not read-only.
57 * @return <code>true</code> if the current selection can be cut,
58 * <code>false</code> otherwise.
60 boolean canCutSelection
();
63 * Returns whether there is a selection and it is copyable.
65 * @return <code>true</code> if there is a selection,
66 * <code>false</code> otherwise.
68 boolean canCopySelection
();
71 * Returns whether we can copy a link location.
73 * @return <code>true</code> if a link is selected,
74 * <code>false</code> otherwise.
76 boolean canCopyLinkLocation
();
79 * Returns whether we can copy an image location.
81 * @return <code>true</code> if an image is selected,
82 <code>false</code> otherwise.
84 boolean canCopyImageLocation
();
87 * Returns whether we can copy an image's contents.
89 * @return <code>true</code> if an image is selected,
90 * <code>false</code> otherwise
92 boolean canCopyImageContents
();
95 * Returns whether the current contents of the clipboard can be
96 * pasted and if the current selection is not read-only.
98 * @return <code>true</code> there is data to paste on the clipboard
99 * and the current selection is not read-only,
100 * <code>false</code> otherwise
105 * Cut the current selection onto the clipboard.
110 * Copy the current selection onto the clipboard.
112 void copySelection
();
115 * Copy the link location of the current selection (e.g.,
116 * the |href| attribute of a selected |a| tag).
118 void copyLinkLocation
();
121 * Copy the location of the selected image.
123 void copyImageLocation
();
126 * Copy the contents of the selected image.
128 void copyImageContents
();
131 * Paste the contents of the clipboard into the current selection.
136 * Select the entire contents.
141 * Clear the current selection (if any). Insertion point ends up
142 * at beginning of current selection.