/* -*- 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); /** * */ 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; /* 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 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; }; %{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" %}