gecko-dev/netwerk/protocol/http/public/nsIHTTPProtocolHandler.idl
ruslan%netscape.com 55a5f44203 Backing up some changes from friday which broke authenticate (36071). Support
Apache-style keep-alive header. Make *ServerCapabilities methods public.
2000-04-18 02:32:53 +00:00

177 lines
5.0 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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/
*
* 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.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsIProtocolHandler.idl"
interface nsIInputStream;
[ptr] native nsAuthEnginePtr(nsAuthEngine);
%{C++
class nsAuthEngine;
#define NS_IHTTPHANDLER_CID \
{ /* 52A30880-DD95-11d3-A1A7-0050041CAF44 */ \
0x52a30880, 0xdd95, 0x11d3, { 0xa1, 0xa7, 0x0, 0x50, 0x4, 0x1c, 0xaf, 0x44 } \
}
%}
[scriptable, uuid(ad1d53ae-3e25-11d3-8cd3-0060b0fc14a3)]
interface nsIHTTPProtocolHandler : nsIProtocolHandler
{
const unsigned long ENCODE_NORMAL = 0;
const unsigned long ENCODE_ADD_CRLF = (1 << 0);
const unsigned long ENCODE_QUOTE_LINES = (1 << 1);
const unsigned long ALLOW_KEEPALIVE = 1;
const unsigned long ALLOW_PIPELINING = 2;
const unsigned long ALLOW_PROXY_KEEPALIVE = 4;
const unsigned long ALLOW_PROXY_PIPELINING = 8;
const unsigned long DONTRECORD_CAPABILITIES = 16;
const unsigned long DONTALLOW_HTTP11 = 32;
/**
*
*/
nsIInputStream NewEncodeStream(in nsIInputStream rawStream,
in unsigned long encodeFlags);
/**
*
*/
nsIInputStream NewDecodeStream(in nsIInputStream encodedStream,
in unsigned long encodeFlags);
/**
*
*/
nsIInputStream NewPostDataStream(in boolean isFile,
in string data,
in unsigned long encodeFlags);
attribute string acceptLanguages;
attribute string acceptEncodings;
attribute unsigned long httpVersion;
/* i'll file a bug on the http guys to make nsAuthEngine scriptable
and then we can get rid of this no script code! */
[noscript] void getAuthEngine(out nsAuthEnginePtr authEngine);
/**
* Get the application name.
*
* @return The name of this application (eg. "Mozilla").
*/
readonly attribute wstring appName;
/**
* Get the application version string.
*
* @return The complete version (major and minor) string. (eg. "5.0")
*/
readonly attribute wstring appVersion;
/**
* @return The vendor name.
*/
attribute wstring vendor;
/**
* @return The vendor sub string.
*/
attribute wstring vendorSub;
/**
* @return The vendor comment.
*/
attribute wstring vendorComment;
/**
* @return The product name.
*/
attribute wstring product;
/**
* @return A product sub string.
*/
attribute wstring productSub;
/**
* @return A product comment.
*/
attribute wstring productComment;
/**
* Get the current platform.
*
* @return The platform this application is running on
* (eg. "Windows", "Macintosh", "X11")
*/
readonly attribute wstring platform;
/**
* Get the current oscpu.
*
* @return The oscpu this application is running on
*/
readonly attribute wstring oscpu;
/**
* 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".
*/
attribute wstring language;
/**
* Get the HTTP advertised user agent string.
*/
readonly attribute wstring userAgent;
/**
* Get/Set the application comment misc portion.
*/
attribute wstring misc;
readonly attribute unsigned long capabilities;
readonly attribute unsigned long keepAliveTimeout;
/**
* Check for bad server and return the capabilites supported by
* such server
*/
unsigned long Check4BrokenHTTPServers (in string serverHeader);
unsigned long GetServerCapabilities (in string host, in long port, in unsigned long defaultCapabilities);
void SetServerCapabilities (in string host, in long port, in unsigned long capabilities);
};
%{C++
//Possible errors
#define NS_ERROR_BAD_REQUEST NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 200)
#define NS_ERROR_BUSY NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 201)
// HTTP protocol handler will do_GetService() each CID or Progid that is registered
// under this category when it comes alive.
#define NS_HTTP_STARTUP_CATEGORY "http-startup-category"
%}