michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIProxiedProtocolHandler.idl" michael@0: michael@0: [scriptable, uuid(c48126d9-2ddd-485b-a51a-378e917e75f8)] michael@0: interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler michael@0: { michael@0: /** michael@0: * Get the HTTP advertised user agent string. michael@0: */ michael@0: readonly attribute ACString userAgent; michael@0: michael@0: /** michael@0: * Get the application name. michael@0: * michael@0: * @return The name of this application (eg. "Mozilla"). michael@0: */ michael@0: readonly attribute ACString appName; michael@0: michael@0: /** michael@0: * Get the application version string. michael@0: * michael@0: * @return The complete version (major and minor) string. (eg. "5.0") michael@0: */ michael@0: readonly attribute ACString appVersion; michael@0: michael@0: /** michael@0: * Get the current platform. michael@0: * michael@0: * @return The platform this application is running on michael@0: * (eg. "Windows", "Macintosh", "X11") michael@0: */ michael@0: readonly attribute ACString platform; michael@0: michael@0: /** michael@0: * Get the current oscpu. michael@0: * michael@0: * @return The oscpu this application is running on michael@0: */ michael@0: readonly attribute ACString oscpu; michael@0: michael@0: /** michael@0: * Get the application comment misc portion. michael@0: */ michael@0: readonly attribute ACString misc; michael@0: michael@0: }; michael@0: michael@0: %{C++ michael@0: // ----------- Categories ----------- michael@0: /** michael@0: * At initialization time, the HTTP handler will initialize each service michael@0: * registered under this category: michael@0: */ michael@0: #define NS_HTTP_STARTUP_CATEGORY "http-startup-category" michael@0: michael@0: // ----------- Observer topics ----------- michael@0: /** michael@0: * nsIObserver notification corresponding to startup category. Services michael@0: * registered under the startup category will receive this observer topic at michael@0: * startup if they implement nsIObserver. The "subject" of the notification michael@0: * is the nsIHttpProtocolHandler instance. michael@0: */ michael@0: #define NS_HTTP_STARTUP_TOPIC "http-startup" michael@0: michael@0: /** michael@0: * This observer topic is notified when an HTTP channel is opened. michael@0: * It is similar to http-on-modify-request, except that michael@0: * 1) The notification is guaranteed to occur before on-modify-request, during michael@0: * the AsyncOpen call itself. michael@0: * 2) It only occurs for the initial open of a channel, not for internal michael@0: * asyncOpens that happen during redirects, etc. michael@0: * 3) Some information (most notably nsIProxiedChannel.proxyInfo) may not be set michael@0: * on the channel object yet. michael@0: * michael@0: * The "subject" of the notification is the nsIHttpChannel instance. michael@0: * michael@0: * Generally the 'http-on-modify-request' notification is preferred unless the michael@0: * synchronous, during-asyncOpen behavior that this notification provides is michael@0: * required. michael@0: */ michael@0: #define NS_HTTP_ON_OPENING_REQUEST_TOPIC "http-on-opening-request" michael@0: michael@0: /** michael@0: * Before an HTTP request is sent to the server, this observer topic is michael@0: * notified. The observer of this topic can then choose to set any additional michael@0: * headers for this request before the request is actually sent to the server. michael@0: * The "subject" of the notification is the nsIHttpChannel instance. michael@0: */ michael@0: #define NS_HTTP_ON_MODIFY_REQUEST_TOPIC "http-on-modify-request" michael@0: michael@0: /** michael@0: * After an HTTP server response is received, this observer topic is notified. michael@0: * The observer of this topic can interrogate the response. The "subject" of michael@0: * the notification is the nsIHttpChannel instance. michael@0: */ michael@0: #define NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC "http-on-examine-response" michael@0: michael@0: /** michael@0: * The observer of this topic is notified after the received HTTP response michael@0: * is merged with data from the browser cache. This means that, among other michael@0: * things, the Content-Type header will be set correctly. michael@0: */ michael@0: #define NS_HTTP_ON_EXAMINE_MERGED_RESPONSE_TOPIC "http-on-examine-merged-response" michael@0: michael@0: /** michael@0: * The observer of this topic is notified before data is read from the cache. michael@0: * The notification is sent if and only if there is no network communication michael@0: * at all. michael@0: */ michael@0: #define NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC "http-on-examine-cached-response" michael@0: michael@0: michael@0: %}