From 287e9385869aa03278276963d15752aa8fe4e17f Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Mon, 24 May 1999 19:50:39 +0000 Subject: [PATCH] First whack at various external module apis. --- netwerk/base/public/nsIHttpNotify.idl | 40 +++++++++++++ netwerk/base/public/nsINetAppNegotiater.idl | 45 +++++++++++++++ netwerk/base/public/nsINetModuleMgr.idl | 62 +++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 netwerk/base/public/nsIHttpNotify.idl create mode 100644 netwerk/base/public/nsINetAppNegotiater.idl create mode 100644 netwerk/base/public/nsINetModuleMgr.idl diff --git a/netwerk/base/public/nsIHttpNotify.idl b/netwerk/base/public/nsIHttpNotify.idl new file mode 100644 index 000000000000..952e9fca28e0 --- /dev/null +++ b/netwerk/base/public/nsIHttpNotify.idl @@ -0,0 +1,40 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +/* The internal networking library http outgoing interface. External modules + * desiring to receive notification of internal http events implement this + * interface, and pass it into the nsINetModuleMgr Register and Unregister + * methods. + * + * All calls are asyncronous. + */ + +#include "nsISupports.idl" + +[scriptable, uuid(8D9430E0-0FB4-11d3-9DE6-0010A4053FD0)] +interface nsIHttpNotify : nsISupports { + // Once all http headers have been downloaded and parsed out of the + // stream, this method is called. + // + // ARGUMENTS: + // aHeaders: All http headers (as defined in + // http://www.w3.org/Protocols/HTTP/1.0/spec.html#Message-Headers) + // + // RETURNS: nsresult + void OnHeaders(in string aHeaders); +}; \ No newline at end of file diff --git a/netwerk/base/public/nsINetAppNegotiater.idl b/netwerk/base/public/nsINetAppNegotiater.idl new file mode 100644 index 000000000000..34a5ed5b9281 --- /dev/null +++ b/netwerk/base/public/nsINetAppNegotiater.idl @@ -0,0 +1,45 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#include "nsISupports.idl" + +/* The nsINetAppNegotiater interface provides an api that allows dialogs + * to be thrown outside of netlib (perhaps on another thread). + * When dialogs would + * be thrown on another thread, NSPR syncronous events are used. + * All the Async* calls are asyncronous calls. + */ + +[scriptable, uuid(8D9430E1-0FB4-11d3-9DE6-0010A4053FD0)] +interface nsINetAppNegotiater : nsISupports { + // Causes a modal dialog to be thrown. + // + // ARGUMENTS: + // aIUsername: a username, if any. + // aOUsername: a new username. + // aPassword: a password. + // + // RETURNS: nsresult + void DlgPromptUsernamePassword(in string aIUsername, out string aOUsername, out string aPassword); + + // Initializes a progress Dialog. + void AsyncProgressInit(); + + // Updates status. + void AsyncProgress(); +}; \ No newline at end of file diff --git a/netwerk/base/public/nsINetModuleMgr.idl b/netwerk/base/public/nsINetModuleMgr.idl new file mode 100644 index 000000000000..4e571855fda4 --- /dev/null +++ b/netwerk/base/public/nsINetModuleMgr.idl @@ -0,0 +1,62 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +/* The nsINetModuleMgr singleton service allows external module to register + * themselves with the networking library to receive events they want to + * receive. + * + * An external module that is interested in being notified when a particular + * networking level event occurs would register with this service, and + * implement the appropriate interface(s) that correspond to the events they + * want to receive. These interfaces are defined by networking internal + * components (for example, http would define a notification interface that + * the external cookies module would implement). + */ + +#include "nsISupports.idl" + +[scriptable, uuid(ff9ead40-0ef2-11d3-9de6-0010a4053fd0)] +interface nsINetModuleMgr : nsISupports { + + // Register the external module to receive notifications. + // + // ARGUMENTS: + // aComponent: The internal component that the external module wants to monitor. + // aEventQueue: The event queue to receive the events. + // aNotify: The external module interface methods to be called when an event is fired. + // + // RETURNS: nsresult + void RegisterModule(in string aComponent, in nsIEventQueue* aEventQueue, in nsINetNotify aNotify); + + // Unregister the external module. Removes the nsINetModuleMgr binding between + // internal component and external module. + // + // ARGUMENTS: + // aComponent: The internal component being monitored. + // aNotify: The external modules notification module. + // + // RETURNS: nsresult + void UnregisterModule(in string aComponent, in nsINetNotify aNotify); + + // Enumerates all the registered modules for the specified component. + // + // ARGUMENTS: + // aComponent: the component to get all the notifiers for. + // aNotifiers: the array of notifiers. + void EnumerateModules(in string aComponent, out nsINetNotify* ** aNotifiers); +}; \ No newline at end of file