nsIClipboard.idl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #include "nsITransferable.idl"
  8. #include "nsIClipboardOwner.idl"
  9. interface nsIArray;
  10. [scriptable, uuid(ceaa0047-647f-4b8e-ad1c-aff9fa62aa51)]
  11. interface nsIClipboard : nsISupports
  12. {
  13. const long kSelectionClipboard = 0;
  14. const long kGlobalClipboard = 1;
  15. const long kFindClipboard = 2;
  16. // Used to cache current selection on (nsClipboard) for macOS service menu.
  17. const long kSelectionCache = 3;
  18. /**
  19. * Given a transferable, set the data on the native clipboard
  20. *
  21. * @param aTransferable The transferable
  22. * @param anOwner The owner of the transferable
  23. * @param aWhichClipboard Specifies the clipboard to which this operation applies.
  24. * @result NS_Ok if no errors
  25. */
  26. void setData ( in nsITransferable aTransferable, in nsIClipboardOwner anOwner,
  27. in long aWhichClipboard ) ;
  28. /**
  29. * Given a transferable, get the clipboard data.
  30. *
  31. * @param aTransferable The transferable
  32. * @param aWhichClipboard Specifies the clipboard to which this operation applies.
  33. * @result NS_Ok if no errors
  34. */
  35. void getData ( in nsITransferable aTransferable, in long aWhichClipboard ) ;
  36. /**
  37. * This empties the clipboard and notifies the clipboard owner.
  38. * This empties the "logical" clipboard. It does not clear the native clipboard.
  39. *
  40. * @param aWhichClipboard Specifies the clipboard to which this operation applies.
  41. * @result NS_OK if successful.
  42. */
  43. void emptyClipboard ( in long aWhichClipboard ) ;
  44. /**
  45. * This provides a way to give correct UI feedback about, for instance, a paste
  46. * should be allowed. It does _NOT_ actually retreive the data and should be a very
  47. * inexpensive call. All it does is check if there is data on the clipboard matching
  48. * any of the flavors in the given list.
  49. *
  50. * @param aFlavorList An array of ASCII strings.
  51. * @param aLength The length of the aFlavorList.
  52. * @param aWhichClipboard Specifies the clipboard to which this operation applies.
  53. * @outResult - if data is present matching one of
  54. * @result NS_OK if successful.
  55. */
  56. boolean hasDataMatchingFlavors ( [array, size_is(aLength)] in string aFlavorList,
  57. in unsigned long aLength,
  58. in long aWhichClipboard ) ;
  59. /**
  60. * Allows clients to determine if the implementation supports the concept of a
  61. * separate clipboard for selection.
  62. *
  63. * @outResult - true if
  64. * @result NS_OK if successful.
  65. */
  66. boolean supportsSelectionClipboard ( ) ;
  67. /**
  68. * Allows clients to determine if the implementation supports the concept of a
  69. * separate clipboard for find search strings.
  70. *
  71. * @result NS_OK if successful.
  72. */
  73. boolean supportsFindClipboard ( ) ;
  74. };
  75. %{ C++
  76. %}