michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0: *
michael@0: * This Source Code Form is subject to the terms of the Mozilla Public
michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0:
michael@0: #include "nsISupports.idl"
michael@0:
michael@0: /**
michael@0: * An interface for embedding clients who wish to interact with
michael@0: * the system-wide OS clipboard. Mozilla does not use a private
michael@0: * clipboard, instead it places its data directly onto the system
michael@0: * clipboard. The webshell implements this interface.
michael@0: */
michael@0:
michael@0: [scriptable, uuid(b8100c90-73be-11d2-92a5-00105a1b0d64)]
michael@0: interface nsIClipboardCommands : nsISupports {
michael@0:
michael@0: /**
michael@0: * Returns whether there is a selection and it is not read-only.
michael@0: *
michael@0: * @return true
if the current selection can be cut,
michael@0: * false
otherwise.
michael@0: */
michael@0: boolean canCutSelection();
michael@0:
michael@0: /**
michael@0: * Returns whether there is a selection and it is copyable.
michael@0: *
michael@0: * @return true
if there is a selection,
michael@0: * false
otherwise.
michael@0: */
michael@0: boolean canCopySelection();
michael@0:
michael@0: /**
michael@0: * Returns whether we can copy a link location.
michael@0: *
michael@0: * @return true
if a link is selected,
michael@0: * false
otherwise.
michael@0: */
michael@0: boolean canCopyLinkLocation();
michael@0:
michael@0: /**
michael@0: * Returns whether we can copy an image location.
michael@0: *
michael@0: * @return true
if an image is selected,
michael@0: false
otherwise.
michael@0: */
michael@0: boolean canCopyImageLocation();
michael@0:
michael@0: /**
michael@0: * Returns whether we can copy an image's contents.
michael@0: *
michael@0: * @return true
if an image is selected,
michael@0: * false
otherwise
michael@0: */
michael@0: boolean canCopyImageContents();
michael@0:
michael@0: /**
michael@0: * Returns whether the current contents of the clipboard can be
michael@0: * pasted and if the current selection is not read-only.
michael@0: *
michael@0: * @return true
there is data to paste on the clipboard
michael@0: * and the current selection is not read-only,
michael@0: * false
otherwise
michael@0: */
michael@0: boolean canPaste();
michael@0:
michael@0: /**
michael@0: * Cut the current selection onto the clipboard.
michael@0: */
michael@0: void cutSelection();
michael@0:
michael@0: /**
michael@0: * Copy the current selection onto the clipboard.
michael@0: */
michael@0: void copySelection();
michael@0:
michael@0: /**
michael@0: * Copy the link location of the current selection (e.g.,
michael@0: * the |href| attribute of a selected |a| tag).
michael@0: */
michael@0: void copyLinkLocation();
michael@0:
michael@0: /**
michael@0: * Copy the location of the selected image.
michael@0: */
michael@0: void copyImageLocation();
michael@0:
michael@0: /**
michael@0: * Copy the contents of the selected image.
michael@0: */
michael@0: void copyImageContents();
michael@0:
michael@0: /**
michael@0: * Paste the contents of the clipboard into the current selection.
michael@0: */
michael@0: void paste();
michael@0:
michael@0: /**
michael@0: * Select the entire contents.
michael@0: */
michael@0: void selectAll();
michael@0:
michael@0: /**
michael@0: * Clear the current selection (if any). Insertion point ends up
michael@0: * at beginning of current selection.
michael@0: */
michael@0: void selectNone();
michael@0:
michael@0: };