nsIClipboardCommands.idl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. /**
  8. * An interface for embedding clients who wish to interact with
  9. * the system-wide OS clipboard. Mozilla does not use a private
  10. * clipboard, instead it places its data directly onto the system
  11. * clipboard. The webshell implements this interface.
  12. */
  13. [scriptable, uuid(b8100c90-73be-11d2-92a5-00105a1b0d64)]
  14. interface nsIClipboardCommands : nsISupports {
  15. /**
  16. * Returns whether there is a selection and it is not read-only.
  17. *
  18. * @return <code>true</code> if the current selection can be cut,
  19. * <code>false</code> otherwise.
  20. */
  21. boolean canCutSelection();
  22. /**
  23. * Returns whether there is a selection and it is copyable.
  24. *
  25. * @return <code>true</code> if there is a selection,
  26. * <code>false</code> otherwise.
  27. */
  28. boolean canCopySelection();
  29. /**
  30. * Returns whether we can copy a link location.
  31. *
  32. * @return <code>true</code> if a link is selected,
  33. * <code>false</code> otherwise.
  34. */
  35. boolean canCopyLinkLocation();
  36. /**
  37. * Returns whether we can copy an image location.
  38. *
  39. * @return <code>true</code> if an image is selected,
  40. <code>false</code> otherwise.
  41. */
  42. boolean canCopyImageLocation();
  43. /**
  44. * Returns whether we can copy an image's contents.
  45. *
  46. * @return <code>true</code> if an image is selected,
  47. * <code>false</code> otherwise
  48. */
  49. boolean canCopyImageContents();
  50. /**
  51. * Returns whether the current contents of the clipboard can be
  52. * pasted and if the current selection is not read-only.
  53. *
  54. * @return <code>true</code> there is data to paste on the clipboard
  55. * and the current selection is not read-only,
  56. * <code>false</code> otherwise
  57. */
  58. boolean canPaste();
  59. /**
  60. * Cut the current selection onto the clipboard.
  61. */
  62. void cutSelection();
  63. /**
  64. * Copy the current selection onto the clipboard.
  65. */
  66. void copySelection();
  67. /**
  68. * Copy the link location of the current selection (e.g.,
  69. * the |href| attribute of a selected |a| tag).
  70. */
  71. void copyLinkLocation();
  72. /**
  73. * Copy the location of the selected image.
  74. */
  75. void copyImageLocation();
  76. /**
  77. * Copy the contents of the selected image.
  78. */
  79. void copyImageContents();
  80. /**
  81. * Paste the contents of the clipboard into the current selection.
  82. */
  83. void paste();
  84. /**
  85. * Select the entire contents.
  86. */
  87. void selectAll();
  88. /**
  89. * Clear the current selection (if any). Insertion point ends up
  90. * at beginning of current selection.
  91. */
  92. void selectNone();
  93. };