Source code

Revision control

Other Tools

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
6
#include "nsIHttpHeaderVisitor.idl"
7
#include "nsIInputStream.idl"
8
9
/**
10
* The MIME stream separates headers and a datastream. It also allows
11
* automatic creation of the content-length header.
12
*/
13
14
[scriptable, uuid(dcbce63c-1dd1-11b2-b94d-91f6d49a3161)]
15
interface nsIMIMEInputStream : nsIInputStream
16
{
17
/**
18
* Adds an additional header to the stream on the form "name: value". May
19
* not be called once the stream has been started to be read.
20
* @param name name of the header
21
* @param value value of the header
22
*/
23
void addHeader(in string name, in string value);
24
25
/**
26
* Visits all headers which have been added via addHeader. Calling
27
* addHeader while visiting request headers has undefined behavior.
28
*
29
* @param aVisitor
30
* The header visitor instance.
31
*/
32
void visitHeaders(in nsIHttpHeaderVisitor visitor);
33
34
/**
35
* Sets data-stream. May not be called once the stream has been started
36
* to be read.
37
* The cursor of the new stream should be located at the beginning of the
38
* stream if the implementation of the nsIMIMEInputStream also is used as
39
* an nsISeekableStream.
40
* @param stream stream containing the data for the stream
41
*/
42
void setData(in nsIInputStream stream);
43
44
/**
45
* Get the wrapped data stream
46
*/
47
readonly attribute nsIInputStream data;
48
};