1999-06-08 01:33:30 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-06-08 01:33:30 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-06-08 01:33:30 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-06-08 01:33:30 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-06-08 01:33:30 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIProtocolHandler;
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIEventSinkGetter;
|
|
|
|
interface nsIChannel;
|
1999-06-12 12:07:05 +04:00
|
|
|
interface nsIStreamObserver;
|
|
|
|
interface nsIStreamListener;
|
|
|
|
interface nsIEventQueue;
|
|
|
|
interface nsIBufferInputStream;
|
1999-06-29 00:37:10 +04:00
|
|
|
interface nsIInputStream;
|
1999-06-15 09:18:40 +04:00
|
|
|
interface nsIBufferOutputStream;
|
1999-06-16 08:15:22 +04:00
|
|
|
interface nsIFileChannel;
|
1999-06-25 02:58:42 +04:00
|
|
|
interface nsILoadGroup;
|
1999-07-20 12:46:33 +04:00
|
|
|
interface nsILoadGroupObserver;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
1999-11-03 08:13:44 +03:00
|
|
|
[scriptable, uuid(1daf19f0-8ea7-11d3-93ad-00104ba0fd40)]
|
1999-06-08 01:33:30 +04:00
|
|
|
interface nsIIOService : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns a protocol handler for a given URI scheme.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIProtocolHandler getProtocolHandler(in string scheme);
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method constructs a new URI by first determining the scheme
|
|
|
|
* of the URI spec, and then delegating the construction of the URI
|
|
|
|
* to the protocol handler for that scheme. QueryInterface can be used
|
|
|
|
* on the resulting URI object to obtain a more specific type of URI.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIURI newURI(in string aSpec, in nsIURI aBaseURI);
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a channel for a given URI. The eventSinkGetter is used to
|
|
|
|
* obtain the appropriate callbacks for the URI's protocol from the
|
|
|
|
* application.
|
1999-10-26 13:16:24 +04:00
|
|
|
*
|
|
|
|
* @param originalURI - Specifies the original URI which caused the creation
|
|
|
|
* of this channel. This can occur when the construction of one channel
|
|
|
|
* (e.g. for resource:) causes another channel to be created on its behalf
|
|
|
|
* (e.g. a file: channel), or if a redirect occurs, causing the current
|
|
|
|
* URL to become different from the original URL. If NULL, the aURI parameter
|
|
|
|
* will be used as the originalURI instead.
|
1999-06-08 01:33:30 +04:00
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIChannel newChannelFromURI(in string verb,
|
1999-06-08 01:33:30 +04:00
|
|
|
in nsIURI aURI,
|
1999-09-07 02:59:11 +04:00
|
|
|
in nsILoadGroup aLoadGroup,
|
1999-10-26 13:16:24 +04:00
|
|
|
in nsIEventSinkGetter eventSinkGetter,
|
|
|
|
in nsIURI originalURI);
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience routine that first creates a URI by calling NewURI, and
|
|
|
|
* then passes the URI to NewChannelFromURI.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIChannel newChannel(in string verb,
|
1999-06-08 01:33:30 +04:00
|
|
|
in string aSpec,
|
|
|
|
in nsIURI aBaseURI,
|
1999-09-07 02:59:11 +04:00
|
|
|
in nsILoadGroup aLoadGroup,
|
1999-10-26 13:16:24 +04:00
|
|
|
in nsIEventSinkGetter eventSinkGetter,
|
|
|
|
in nsIURI originalURI);
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the application name string that will be used as part
|
|
|
|
* of a HTTP request.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
readonly attribute wstring appCodeName;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the application version string that will be used as part
|
|
|
|
* of a HTTP request.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
readonly attribute wstring appVersion;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the application name.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
readonly attribute wstring appName;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the translation of the application. The value for language
|
|
|
|
* is usually a 2-letter code such as "en" and occasionally a
|
|
|
|
* five-character code to indicate a language subtype, such as "zh_CN".
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
attribute wstring language;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current platform (machine type).
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
readonly attribute wstring platform;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the HTTP advertised user agent string.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
readonly attribute wstring userAgent;
|
1999-06-08 01:33:30 +04:00
|
|
|
|
1999-06-12 12:07:05 +04:00
|
|
|
/**
|
|
|
|
* Returns a new stream observer that marshals data from another
|
|
|
|
* stream observer over to the thread specified by an event queue.
|
1999-10-06 12:26:01 +04:00
|
|
|
* If the event queue is null, the current thread's event queue is
|
|
|
|
* used.
|
1999-06-12 12:07:05 +04:00
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIStreamObserver newAsyncStreamObserver(in nsIStreamObserver receiver,
|
1999-06-12 12:07:05 +04:00
|
|
|
in nsIEventQueue eventQueue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An asynchronous stream listener is used to ship data over to another thread specified
|
|
|
|
* by the thread's event queue. The receiver stream listener is then used to receive
|
|
|
|
* the data on the other thread.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIStreamListener newAsyncStreamListener(in nsIStreamListener receiver,
|
1999-06-12 12:07:05 +04:00
|
|
|
in nsIEventQueue eventQueue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A synchronous stream listener pushes data through a pipe that ends up
|
|
|
|
* in an input stream to be read by another thread.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIStreamListener newSyncStreamListener(out nsIInputStream inStream,
|
1999-06-15 09:18:40 +04:00
|
|
|
out nsIBufferOutputStream outStream);
|
1999-06-12 12:07:05 +04:00
|
|
|
|
1999-06-16 08:15:22 +04:00
|
|
|
/**
|
|
|
|
* This convenience routine first looks up the file protocol handler, and
|
|
|
|
* then uses it to construct a file channel from a native path string.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIFileChannel newChannelFromNativePath(in string nativePath);
|
1999-06-25 02:58:42 +04:00
|
|
|
|
1999-07-03 08:05:14 +04:00
|
|
|
/**
|
|
|
|
* Returns a simple channel implementation that uses the given input
|
|
|
|
* stream and content type. A URI may also be supplied which will be returned
|
|
|
|
* by the channel's GetURI method. This routine is a convenience facililty
|
|
|
|
* for protocol writers.
|
|
|
|
*/
|
1999-10-12 05:39:37 +04:00
|
|
|
nsIChannel newInputStreamChannel(in nsIURI uri,
|
1999-07-03 08:05:14 +04:00
|
|
|
in string contentType,
|
1999-10-06 12:26:01 +04:00
|
|
|
in long contentLength,
|
1999-09-16 12:03:02 +04:00
|
|
|
in nsIInputStream inStr,
|
1999-10-26 13:16:24 +04:00
|
|
|
in nsILoadGroup group,
|
|
|
|
in nsIURI originalURI);
|
1999-06-08 01:33:30 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
|
|
|
|
#define NS_IOSERVICE_CID \
|
|
|
|
{ /* 9ac9e770-18bc-11d3-9337-00104ba0fd40 */ \
|
|
|
|
0x9ac9e770, \
|
|
|
|
0x18bc, \
|
|
|
|
0x11d3, \
|
|
|
|
{0x93, 0x37, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
|
|
|
|
}
|
|
|
|
|
|
|
|
%}
|