Bug 460926 A11y hierachy is broken on Ubuntu 8.10 (GNOME 2.24), r=Evan.Yan sr=roc
[wine-gecko.git] / netwerk / base / public / nsIStreamTransportService.idl
blobf9bf3be6a5807c19ec1d3f9d426195daa33929f3
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is Mozilla.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 2002
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
22 * Darin Fisher <darin@netscape.com>
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsISupports.idl"
40 interface nsITransport;
41 interface nsIInputStream;
42 interface nsIOutputStream;
44 /**
45 * This service read/writes a stream on a background thread.
47 * Use this service to transform any blocking stream (e.g., file stream)
48 * into a fully asynchronous stream that can be read/written without
49 * blocking the main thread.
51 [scriptable, uuid(8268D474-EFBF-494f-A152-E8A8616F4E52)]
52 interface nsIStreamTransportService : nsISupports
54 /**
55 * CreateInputTransport
57 * @param aStream
58 * The input stream that will be read on a background thread.
59 * This stream must implement "blocking" stream semantics.
60 * @param aStartOffset
61 * The input stream will be read starting from this offset. Pass
62 * -1 to read from the current stream offset. NOTE: this parameter
63 * is ignored if the stream does not support nsISeekableStream.
64 * @param aReadLimit
65 * This parameter limits the number of bytes that will be read from
66 * the input stream. Pass -1 to read everything.
67 * @param aCloseWhenDone
68 * Specify this flag to have the input stream closed once its
69 * contents have been completely read.
71 * @return nsITransport instance.
73 nsITransport createInputTransport(in nsIInputStream aStream,
74 in long long aStartOffset,
75 in long long aReadLimit,
76 in boolean aCloseWhenDone);
78 /**
79 * CreateOutputTransport
81 * @param aStream
82 * The output stream that will be written to on a background thread.
83 * This stream must implement "blocking" stream semantics.
84 * @param aStartOffset
85 * The output stream will be written starting at this offset. Pass
86 * -1 to write to the current stream offset. NOTE: this parameter
87 * is ignored if the stream does not support nsISeekableStream.
88 * @param aWriteLimit
89 * This parameter limits the number of bytes that will be written to
90 * the output stream. Pass -1 for unlimited writing.
91 * @param aCloseWhenDone
92 * Specify this flag to have the output stream closed once its
93 * contents have been completely written.
95 * @return nsITransport instance.
97 nsITransport createOutputTransport(in nsIOutputStream aStream,
98 in long long aStartOffset,
99 in long long aWriteLimit,
100 in boolean aCloseWhenDone);