OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 2 * |
| 3 * ***** BEGIN LICENSE BLOCK ***** |
| 4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 5 * |
| 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/ |
| 10 * |
| 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 |
| 14 * License. |
| 15 * |
| 16 * The Original Code is the Mozilla browser. |
| 17 * |
| 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. |
| 22 * |
| 23 * Contributor(s): |
| 24 * Dan Rosen <dr@netscape.com> |
| 25 * |
| 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. |
| 37 * |
| 38 * ***** END LICENSE BLOCK ***** */ |
| 39 |
| 40 #include "nsISupports.idl" |
| 41 |
| 42 /** |
| 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. |
| 47 * |
| 48 * @status FROZEN |
| 49 */ |
| 50 |
| 51 [scriptable, uuid(b8100c90-73be-11d2-92a5-00105a1b0d64)] |
| 52 interface nsIClipboardCommands : nsISupports { |
| 53 |
| 54 /** |
| 55 * Returns whether there is a selection and it is not read-only. |
| 56 * |
| 57 * @return <code>true</code> if the current selection can be cut, |
| 58 * <code>false</code> otherwise. |
| 59 */ |
| 60 boolean canCutSelection(); |
| 61 |
| 62 /** |
| 63 * Returns whether there is a selection and it is copyable. |
| 64 * |
| 65 * @return <code>true</code> if there is a selection, |
| 66 * <code>false</code> otherwise. |
| 67 */ |
| 68 boolean canCopySelection(); |
| 69 |
| 70 /** |
| 71 * Returns whether we can copy a link location. |
| 72 * |
| 73 * @return <code>true</code> if a link is selected, |
| 74 * <code>false</code> otherwise. |
| 75 */ |
| 76 boolean canCopyLinkLocation(); |
| 77 |
| 78 /** |
| 79 * Returns whether we can copy an image location. |
| 80 * |
| 81 * @return <code>true</code> if an image is selected, |
| 82 <code>false</code> otherwise. |
| 83 */ |
| 84 boolean canCopyImageLocation(); |
| 85 |
| 86 /** |
| 87 * Returns whether we can copy an image's contents. |
| 88 * |
| 89 * @return <code>true</code> if an image is selected, |
| 90 * <code>false</code> otherwise |
| 91 */ |
| 92 boolean canCopyImageContents(); |
| 93 |
| 94 /** |
| 95 * Returns whether the current contents of the clipboard can be |
| 96 * pasted and if the current selection is not read-only. |
| 97 * |
| 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 |
| 101 */ |
| 102 boolean canPaste(); |
| 103 |
| 104 /** |
| 105 * Cut the current selection onto the clipboard. |
| 106 */ |
| 107 void cutSelection(); |
| 108 |
| 109 /** |
| 110 * Copy the current selection onto the clipboard. |
| 111 */ |
| 112 void copySelection(); |
| 113 |
| 114 /** |
| 115 * Copy the link location of the current selection (e.g., |
| 116 * the |href| attribute of a selected |a| tag). |
| 117 */ |
| 118 void copyLinkLocation(); |
| 119 |
| 120 /** |
| 121 * Copy the location of the selected image. |
| 122 */ |
| 123 void copyImageLocation(); |
| 124 |
| 125 /** |
| 126 * Copy the contents of the selected image. |
| 127 */ |
| 128 void copyImageContents(); |
| 129 |
| 130 /** |
| 131 * Paste the contents of the clipboard into the current selection. |
| 132 */ |
| 133 void paste(); |
| 134 |
| 135 /** |
| 136 * Select the entire contents. |
| 137 */ |
| 138 void selectAll(); |
| 139 |
| 140 /** |
| 141 * Clear the current selection (if any). Insertion point ends up |
| 142 * at beginning of current selection. |
| 143 */ |
| 144 void selectNone(); |
| 145 |
| 146 }; |
OLD | NEW |