netwerk/base/public/nsIMIMEInputStream.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIMIMEInputStream.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsIInputStream.idl"
    1.10 +
    1.11 +/**
    1.12 + * The MIME stream separates headers and a datastream. It also allows
    1.13 + * automatic creation of the content-length header.
    1.14 + */
    1.15 +
    1.16 +[scriptable, uuid(dcbce63c-1dd1-11b2-b94d-91f6d49a3161)]
    1.17 +interface nsIMIMEInputStream : nsIInputStream
    1.18 +{
    1.19 +    /**
    1.20 +     * When true a "Content-Length" header is automatically added to the
    1.21 +     * stream. The value of the content-length is automatically calculated
    1.22 +     * using the available() method on the data stream. The value is
    1.23 +     * recalculated every time the stream is rewinded to the start.
    1.24 +     * Not allowed to be changed once the stream has been started to be read.
    1.25 +     */
    1.26 +    attribute boolean addContentLength;
    1.27 +
    1.28 +    /**
    1.29 +     * Adds an additional header to the stream on the form "name: value". May
    1.30 +     * not be called once the stream has been started to be read.
    1.31 +     * @param name   name of the header
    1.32 +     * @param value  value of the header
    1.33 +     */
    1.34 +    void addHeader(in string name, in string value);
    1.35 +
    1.36 +    /**
    1.37 +     * Sets data-stream. May not be called once the stream has been started
    1.38 +     * to be read.
    1.39 +     * The cursor of the new stream should be located at the beginning of the
    1.40 +     * stream if the implementation of the nsIMIMEInputStream also is used as
    1.41 +     * an nsISeekableStream.
    1.42 +     * @param stream  stream containing the data for the stream
    1.43 +     */
    1.44 +    void setData(in nsIInputStream stream);
    1.45 +};

mercurial