nsIMIMEInputStream.idl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  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 "nsIInputStream.idl"
  6. /**
  7. * The MIME stream separates headers and a datastream. It also allows
  8. * automatic creation of the content-length header.
  9. */
  10. [scriptable, uuid(dcbce63c-1dd1-11b2-b94d-91f6d49a3161)]
  11. interface nsIMIMEInputStream : nsIInputStream
  12. {
  13. /**
  14. * When true a "Content-Length" header is automatically added to the
  15. * stream. The value of the content-length is automatically calculated
  16. * using the available() method on the data stream. The value is
  17. * recalculated every time the stream is rewinded to the start.
  18. * Not allowed to be changed once the stream has been started to be read.
  19. */
  20. attribute boolean addContentLength;
  21. /**
  22. * Adds an additional header to the stream on the form "name: value". May
  23. * not be called once the stream has been started to be read.
  24. * @param name name of the header
  25. * @param value value of the header
  26. */
  27. void addHeader(in string name, in string value);
  28. /**
  29. * Sets data-stream. May not be called once the stream has been started
  30. * to be read.
  31. * The cursor of the new stream should be located at the beginning of the
  32. * stream if the implementation of the nsIMIMEInputStream also is used as
  33. * an nsISeekableStream.
  34. * @param stream stream containing the data for the stream
  35. */
  36. void setData(in nsIInputStream stream);
  37. /**
  38. * Get the wrapped data stream
  39. */
  40. readonly attribute nsIInputStream data;
  41. };