nsIClipboardCommands.idl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 <[email protected]>
  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. #include "nsISupports.idl"
  40. /**
  41. * An interface for embedding clients who wish to interact with
  42. * the system-wide OS clipboard. Mozilla does not use a private
  43. * clipboard, instead it places its data directly onto the system
  44. * clipboard. The webshell implements this interface.
  45. *
  46. * @status FROZEN
  47. */
  48. [scriptable, uuid(b8100c90-73be-11d2-92a5-00105a1b0d64)]
  49. interface nsIClipboardCommands : nsISupports {
  50. /**
  51. * Returns whether there is a selection and it is not read-only.
  52. *
  53. * @return <code>true</code> if the current selection can be cut,
  54. * <code>false</code> otherwise.
  55. */
  56. boolean canCutSelection();
  57. /**
  58. * Returns whether there is a selection and it is copyable.
  59. *
  60. * @return <code>true</code> if there is a selection,
  61. * <code>false</code> otherwise.
  62. */
  63. boolean canCopySelection();
  64. /**
  65. * Returns whether we can copy a link location.
  66. *
  67. * @return <code>true</code> if a link is selected,
  68. * <code>false</code> otherwise.
  69. */
  70. boolean canCopyLinkLocation();
  71. /**
  72. * Returns whether we can copy an image location.
  73. *
  74. * @return <code>true</code> if an image is selected,
  75. <code>false</code> otherwise.
  76. */
  77. boolean canCopyImageLocation();
  78. /**
  79. * Returns whether we can copy an image's contents.
  80. *
  81. * @return <code>true</code> if an image is selected,
  82. * <code>false</code> otherwise
  83. */
  84. boolean canCopyImageContents();
  85. /**
  86. * Returns whether the current contents of the clipboard can be
  87. * pasted and if the current selection is not read-only.
  88. *
  89. * @return <code>true</code> there is data to paste on the clipboard
  90. * and the current selection is not read-only,
  91. * <code>false</code> otherwise
  92. */
  93. boolean canPaste();
  94. /**
  95. * Cut the current selection onto the clipboard.
  96. */
  97. void cutSelection();
  98. /**
  99. * Copy the current selection onto the clipboard.
  100. */
  101. void copySelection();
  102. /**
  103. * Copy the link location of the current selection (e.g.,
  104. * the |href| attribute of a selected |a| tag).
  105. */
  106. void copyLinkLocation();
  107. /**
  108. * Copy the location of the selected image.
  109. */
  110. void copyImageLocation();
  111. /**
  112. * Copy the contents of the selected image.
  113. */
  114. void copyImageContents();
  115. /**
  116. * Paste the contents of the clipboard into the current selection.
  117. */
  118. void paste();
  119. /**
  120. * Select the entire contents.
  121. */
  122. void selectAll();
  123. /**
  124. * Clear the current selection (if any). Insertion point ends up
  125. * at beginning of current selection.
  126. */
  127. void selectNone();
  128. };