nsIFormatConverter.idl 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. #include "nsIArray.idl"
  7. [scriptable, uuid(948A0023-E3A7-11d2-96CF-0060B0FB9956)]
  8. interface nsIFormatConverter : nsISupports
  9. {
  10. /**
  11. * Get the list of the "input" data flavors (mime types as nsISupportsCString),
  12. * in otherwords, the flavors that this converter can convert "from" (the
  13. * incoming data to the converter).
  14. */
  15. nsIArray getInputDataFlavors ( ) ;
  16. /**
  17. * Get the list of the "output" data flavors (mime types as nsISupportsCString),
  18. * in otherwords, the flavors that this converter can convert "to" (the
  19. * outgoing data to the converter).
  20. *
  21. * @param aDataFlavorList fills list with supported flavors
  22. */
  23. nsIArray getOutputDataFlavors ( ) ;
  24. /**
  25. * Determines whether a conversion from one flavor to another is supported
  26. *
  27. * @param aFromFormatConverter flavor to convert from
  28. * @param aFromFormatConverter flavor to convert to
  29. */
  30. boolean canConvert ( in string aFromDataFlavor, in string aToDataFlavor ) ;
  31. /**
  32. * Converts from one flavor to another.
  33. *
  34. * @param aFromFormatConverter flavor to convert from
  35. * @param aFromFormatConverter flavor to convert to (destination own the memory)
  36. * @returns returns NS_OK if it was converted
  37. */
  38. void convert ( in string aFromDataFlavor, in nsISupports aFromData, in unsigned long aDataLen,
  39. in string aToDataFlavor, out nsISupports aToData, out unsigned long aDataToLen ) ;
  40. };
  41. %{ C++
  42. %}