|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 interface nsIFile; |
|
9 interface nsIComponentManager; |
|
10 |
|
11 /** |
|
12 * The nsIModule interface. |
|
13 */ |
|
14 |
|
15 [scriptable, uuid(7392D032-5371-11d3-994E-00805FD26FEE)] |
|
16 interface nsIModule : nsISupports |
|
17 { |
|
18 /** |
|
19 * Object Instance Creation |
|
20 * |
|
21 * Obtains a Class Object from a nsIModule for a given CID and IID pair. |
|
22 * This class object can either be query to a nsIFactory or a may be |
|
23 * query to a nsIClassInfo. |
|
24 * |
|
25 * @param aCompMgr : The global component manager |
|
26 * @param aClass : ClassID of object instance requested |
|
27 * @param aIID : IID of interface requested |
|
28 * |
|
29 */ |
|
30 void getClassObject(in nsIComponentManager aCompMgr, |
|
31 in nsCIDRef aClass, |
|
32 in nsIIDRef aIID, |
|
33 [retval, iid_is(aIID)] out nsQIResult aResult); |
|
34 |
|
35 |
|
36 /** |
|
37 * One time registration callback |
|
38 * |
|
39 * When the nsIModule is discovered, this method will be |
|
40 * called so that any setup registration can be preformed. |
|
41 * |
|
42 * @param aCompMgr : The global component manager |
|
43 * @param aLocation : The location of the nsIModule on disk |
|
44 * @param aLoaderStr: Opaque loader specific string |
|
45 * @param aType : Loader Type being used to load this module |
|
46 */ |
|
47 void registerSelf(in nsIComponentManager aCompMgr, |
|
48 in nsIFile aLocation, |
|
49 in string aLoaderStr, |
|
50 in string aType); |
|
51 /** |
|
52 * One time unregistration callback |
|
53 * |
|
54 * When the nsIModule is being unregistered, this method will be |
|
55 * called so that any unregistration can be preformed |
|
56 * |
|
57 * @param aCompMgr : The global component manager |
|
58 * @param aLocation : The location of the nsIModule on disk |
|
59 * @param aLoaderStr : Opaque loader specific string |
|
60 * |
|
61 */ |
|
62 void unregisterSelf(in nsIComponentManager aCompMgr, |
|
63 in nsIFile aLocation, |
|
64 in string aLoaderStr); |
|
65 |
|
66 /** |
|
67 * Module load management |
|
68 * |
|
69 * @param aCompMgr : The global component manager |
|
70 * |
|
71 * @return indicates to the caller if the module can be unloaded. |
|
72 * Returning PR_TRUE isn't a guarantee that the module will be |
|
73 * unloaded. It constitues only willingness of the module to be |
|
74 * unloaded. It is very important to ensure that no outstanding |
|
75 * references to the module's code/data exist before returning |
|
76 * PR_TRUE. |
|
77 * Returning PR_FALSE guaratees that the module won't be unloaded. |
|
78 */ |
|
79 boolean canUnload(in nsIComponentManager aCompMgr); |
|
80 }; |
|
81 |
|
82 |