1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
---|
2 | * |
---|
3 | * The contents of this file are subject to the Netscape Public License |
---|
4 | * Version 1.1 (the "NPL"); you may not use this file except in |
---|
5 | * compliance with the NPL. You may obtain a copy of the NPL at |
---|
6 | * http://www.mozilla.org/NPL/ |
---|
7 | * |
---|
8 | * Software distributed under the NPL is distributed on an "AS IS" basis, |
---|
9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL |
---|
10 | * for the specific language governing rights and limitations under the |
---|
11 | * NPL. |
---|
12 | * |
---|
13 | * The Initial Developer of this code under the NPL is Netscape |
---|
14 | * Communications Corporation. Portions created by Netscape are |
---|
15 | * Copyright (C) 1998 Netscape Communications Corporation. All Rights |
---|
16 | * Reserved. |
---|
17 | */ |
---|
18 | |
---|
19 | #include "nsISupports.idl" |
---|
20 | #include "nsIFactory.idl" |
---|
21 | #include "nsIFile.idl" |
---|
22 | #include "nsIComponentManager.idl" |
---|
23 | |
---|
24 | [object, uuid(c073cfc0-567c-11d3-aec1-0000f8e25c06)] |
---|
25 | interface nsIComponentLoader : nsISupports { |
---|
26 | |
---|
27 | /** |
---|
28 | * Get the factory for a given component. |
---|
29 | */ |
---|
30 | nsIFactory getFactory(in nsIIDRef aCID, in string aLocation, |
---|
31 | in string aType); |
---|
32 | |
---|
33 | /** |
---|
34 | * Initialize the loader. |
---|
35 | * |
---|
36 | * We use nsISupports here because nsIRegistry isn't IDLized yet. |
---|
37 | */ |
---|
38 | void init(in nsIComponentManager aCompMgr, in nsISupports aRegistry); |
---|
39 | |
---|
40 | /** |
---|
41 | * Called when a component of the appropriate type is registered, |
---|
42 | * to give the component loader an opportunity to do things like |
---|
43 | * annotate the registry and such. |
---|
44 | */ |
---|
45 | void onRegister(in nsIIDRef aCID, in string aType, |
---|
46 | in string aClassName, in string aContractID, |
---|
47 | in string aLocation, in boolean aReplace, |
---|
48 | in boolean aPersist); |
---|
49 | |
---|
50 | /** |
---|
51 | * When is AutoRegistration occuring? |
---|
52 | */ |
---|
53 | const long Startup = 0; |
---|
54 | const long Component = 1; |
---|
55 | const long Timer = 2; |
---|
56 | |
---|
57 | /** |
---|
58 | * AutoRegister components in the given directory. |
---|
59 | */ |
---|
60 | void autoRegisterComponents(in long aWhen, in nsIFile aDirectory); |
---|
61 | |
---|
62 | /** |
---|
63 | * AutoRegister the given component. |
---|
64 | * |
---|
65 | * Returns true if the component was registered, false if it couldn't |
---|
66 | * attempt to register the component (wrong type) and ``throws'' an |
---|
67 | * NS_FAILED code if there was an error during registration. |
---|
68 | */ |
---|
69 | boolean autoRegisterComponent(in long aWhen, in nsIFile aComponent); |
---|
70 | |
---|
71 | /** |
---|
72 | * AutoUnregister the given component. |
---|
73 | * Returns true if the component was unregistered, false if it coudln't |
---|
74 | * attempt to unregister the component (not found, wrong type). |
---|
75 | */ |
---|
76 | boolean autoUnregisterComponent(in long aWhen, in nsIFile aComponent); |
---|
77 | |
---|
78 | /** |
---|
79 | * Register any deferred (NS_ERROR_FACTORY_REGISTER_AGAIN) components. |
---|
80 | * Return registered-any-components? |
---|
81 | */ |
---|
82 | boolean registerDeferredComponents(in long aWhen); |
---|
83 | |
---|
84 | /** |
---|
85 | * Unload all components that are willing. |
---|
86 | */ |
---|
87 | void unloadAll(in long aWhen); |
---|
88 | |
---|
89 | }; |
---|