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 "nsISupports.idl" michael@0: michael@0: interface nsIFile; michael@0: interface nsIComponentManager; michael@0: michael@0: /** michael@0: * The nsIModule interface. michael@0: */ michael@0: michael@0: [scriptable, uuid(7392D032-5371-11d3-994E-00805FD26FEE)] michael@0: interface nsIModule : nsISupports michael@0: { michael@0: /** michael@0: * Object Instance Creation michael@0: * michael@0: * Obtains a Class Object from a nsIModule for a given CID and IID pair. michael@0: * This class object can either be query to a nsIFactory or a may be michael@0: * query to a nsIClassInfo. michael@0: * michael@0: * @param aCompMgr : The global component manager michael@0: * @param aClass : ClassID of object instance requested michael@0: * @param aIID : IID of interface requested michael@0: * michael@0: */ michael@0: void getClassObject(in nsIComponentManager aCompMgr, michael@0: in nsCIDRef aClass, michael@0: in nsIIDRef aIID, michael@0: [retval, iid_is(aIID)] out nsQIResult aResult); michael@0: michael@0: michael@0: /** michael@0: * One time registration callback michael@0: * michael@0: * When the nsIModule is discovered, this method will be michael@0: * called so that any setup registration can be preformed. michael@0: * michael@0: * @param aCompMgr : The global component manager michael@0: * @param aLocation : The location of the nsIModule on disk michael@0: * @param aLoaderStr: Opaque loader specific string michael@0: * @param aType : Loader Type being used to load this module michael@0: */ michael@0: void registerSelf(in nsIComponentManager aCompMgr, michael@0: in nsIFile aLocation, michael@0: in string aLoaderStr, michael@0: in string aType); michael@0: /** michael@0: * One time unregistration callback michael@0: * michael@0: * When the nsIModule is being unregistered, this method will be michael@0: * called so that any unregistration can be preformed michael@0: * michael@0: * @param aCompMgr : The global component manager michael@0: * @param aLocation : The location of the nsIModule on disk michael@0: * @param aLoaderStr : Opaque loader specific string michael@0: * michael@0: */ michael@0: void unregisterSelf(in nsIComponentManager aCompMgr, michael@0: in nsIFile aLocation, michael@0: in string aLoaderStr); michael@0: michael@0: /** michael@0: * Module load management michael@0: * michael@0: * @param aCompMgr : The global component manager michael@0: * michael@0: * @return indicates to the caller if the module can be unloaded. michael@0: * Returning PR_TRUE isn't a guarantee that the module will be michael@0: * unloaded. It constitues only willingness of the module to be michael@0: * unloaded. It is very important to ensure that no outstanding michael@0: * references to the module's code/data exist before returning michael@0: * PR_TRUE. michael@0: * Returning PR_FALSE guaratees that the module won't be unloaded. michael@0: */ michael@0: boolean canUnload(in nsIComponentManager aCompMgr); michael@0: }; michael@0: michael@0: