docshell/base/nsIClipboardCommands.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/base/nsIClipboardCommands.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,111 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +/**
    1.13 + * An interface for embedding clients who wish to interact with
    1.14 + * the system-wide OS clipboard. Mozilla does not use a private
    1.15 + * clipboard, instead it places its data directly onto the system 
    1.16 + * clipboard. The webshell implements this interface.
    1.17 + */
    1.18 +
    1.19 +[scriptable, uuid(b8100c90-73be-11d2-92a5-00105a1b0d64)]
    1.20 +interface nsIClipboardCommands : nsISupports {
    1.21 +
    1.22 +  /**
    1.23 +   * Returns whether there is a selection and it is not read-only.
    1.24 +   *
    1.25 +   * @return <code>true</code> if the current selection can be cut,
    1.26 +   *          <code>false</code> otherwise.
    1.27 +   */
    1.28 +  boolean canCutSelection();
    1.29 +
    1.30 +  /**
    1.31 +   * Returns whether there is a selection and it is copyable.
    1.32 +   *
    1.33 +   * @return <code>true</code> if there is a selection,
    1.34 +   *          <code>false</code> otherwise.
    1.35 +   */
    1.36 +  boolean canCopySelection();
    1.37 +
    1.38 +  /**
    1.39 +   * Returns whether we can copy a link location.
    1.40 +   *
    1.41 +   * @return <code>true</code> if a link is selected,
    1.42 +   *           <code>false</code> otherwise.
    1.43 +   */
    1.44 +  boolean canCopyLinkLocation();
    1.45 +
    1.46 +  /**
    1.47 +   * Returns whether we can copy an image location.
    1.48 +   *
    1.49 +   * @return <code>true</code> if an image is selected,
    1.50 +              <code>false</code> otherwise.
    1.51 +   */
    1.52 +  boolean canCopyImageLocation();
    1.53 +
    1.54 +  /**
    1.55 +   * Returns whether we can copy an image's contents.
    1.56 +   *
    1.57 +   * @return <code>true</code> if an image is selected,
    1.58 +   *          <code>false</code> otherwise
    1.59 +   */
    1.60 +  boolean canCopyImageContents();
    1.61 +
    1.62 +  /**
    1.63 +   * Returns whether the current contents of the clipboard can be
    1.64 +   * pasted and if the current selection is not read-only.
    1.65 +   *
    1.66 +   * @return <code>true</code> there is data to paste on the clipboard
    1.67 +   *          and the current selection is not read-only,
    1.68 +   *          <code>false</code> otherwise
    1.69 +   */
    1.70 +  boolean canPaste();
    1.71 +
    1.72 +  /**
    1.73 +   * Cut the current selection onto the clipboard.
    1.74 +   */
    1.75 +  void cutSelection();
    1.76 +
    1.77 +  /**
    1.78 +   * Copy the current selection onto the clipboard.
    1.79 +   */
    1.80 +  void copySelection();
    1.81 +
    1.82 +  /**
    1.83 +   * Copy the link location of the current selection (e.g.,
    1.84 +   * the |href| attribute of a selected |a| tag).
    1.85 +   */
    1.86 +  void copyLinkLocation();
    1.87 +
    1.88 +  /**
    1.89 +   * Copy the location of the selected image.
    1.90 +   */
    1.91 +  void copyImageLocation();
    1.92 +
    1.93 +  /**
    1.94 +   * Copy the contents of the selected image.
    1.95 +   */
    1.96 +  void copyImageContents();
    1.97 +
    1.98 +  /**
    1.99 +   * Paste the contents of the clipboard into the current selection.
   1.100 +   */
   1.101 +  void paste();
   1.102 +
   1.103 +  /**
   1.104 +   * Select the entire contents.
   1.105 +   */
   1.106 +  void selectAll();
   1.107 +
   1.108 +  /**
   1.109 +   * Clear the current selection (if any). Insertion point ends up
   1.110 +   * at beginning of current selection.
   1.111 +   */
   1.112 +  void selectNone();
   1.113 +
   1.114 +};

mercurial