Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsIInputStream.idl" |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * The MIME stream separates headers and a datastream. It also allows |
michael@0 | 10 | * automatic creation of the content-length header. |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | [scriptable, uuid(dcbce63c-1dd1-11b2-b94d-91f6d49a3161)] |
michael@0 | 14 | interface nsIMIMEInputStream : nsIInputStream |
michael@0 | 15 | { |
michael@0 | 16 | /** |
michael@0 | 17 | * When true a "Content-Length" header is automatically added to the |
michael@0 | 18 | * stream. The value of the content-length is automatically calculated |
michael@0 | 19 | * using the available() method on the data stream. The value is |
michael@0 | 20 | * recalculated every time the stream is rewinded to the start. |
michael@0 | 21 | * Not allowed to be changed once the stream has been started to be read. |
michael@0 | 22 | */ |
michael@0 | 23 | attribute boolean addContentLength; |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Adds an additional header to the stream on the form "name: value". May |
michael@0 | 27 | * not be called once the stream has been started to be read. |
michael@0 | 28 | * @param name name of the header |
michael@0 | 29 | * @param value value of the header |
michael@0 | 30 | */ |
michael@0 | 31 | void addHeader(in string name, in string value); |
michael@0 | 32 | |
michael@0 | 33 | /** |
michael@0 | 34 | * Sets data-stream. May not be called once the stream has been started |
michael@0 | 35 | * to be read. |
michael@0 | 36 | * The cursor of the new stream should be located at the beginning of the |
michael@0 | 37 | * stream if the implementation of the nsIMIMEInputStream also is used as |
michael@0 | 38 | * an nsISeekableStream. |
michael@0 | 39 | * @param stream stream containing the data for the stream |
michael@0 | 40 | */ |
michael@0 | 41 | void setData(in nsIInputStream stream); |
michael@0 | 42 | }; |