1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 * The nsIComponentRegistrar interface.
9 #include
"nsISupports.idl"
13 interface nsISimpleEnumerator
;
15 [scriptable
, uuid(2417cbfe
-65ad
-48a6
-b4b6
-eb84db174392
)]
16 interface nsIComponentRegistrar
: nsISupports
21 * Register a .manifest file, or an entire directory containing
22 * these files. Registration lasts for this run only, and is not cached.
24 * @note Formerly this method would register component files directly. This
25 * is no longer supported.
27 void autoRegister
(in nsIFile aSpec
);
31 * @status OBSOLETE: This method is no longer implemented, but preserved
32 * in this interface for binary compatibility with
35 void autoUnregister
(in nsIFile aSpec
);
41 * Register a factory with a given ContractID, CID and Class Name.
43 * @param aClass : CID of object
44 * @param aClassName : Class Name of CID (unused)
45 * @param aContractID : ContractID associated with CID aClass. May be null
46 * if no contract ID is needed.
47 * @param aFactory : Factory that will be registered for CID aClass.
48 * If aFactory is null, the contract will be associated
49 * with a previously registered CID.
51 void registerFactory
(in nsCIDRef aClass
,
53 in string aContractID
,
54 in nsIFactory aFactory
);
59 * Unregister a factory associated with CID aClass.
61 * @param aClass : CID being unregistered
62 * @param aFactory : Factory previously registered to create instances of
65 * @throws NS_ERROR* Method failure.
67 void unregisterFactory
(in nsCIDRef aClass
,
68 in nsIFactory aFactory
);
71 * registerFactoryLocation
72 * @status OBSOLETE: This method is no longer implemented, but preserved
73 * in this interface for binary compatibility with
76 void registerFactoryLocation
(in nsCIDRef aClass
,
78 in string aContractID
,
84 * unregisterFactoryLocation
85 * @status OBSOLETE: This method is no longer implemented, but preserved
86 * in this interface for binary compatibility with
89 void unregisterFactoryLocation
(in nsCIDRef aClass
,
95 * Returns true if a factory is registered for the CID.
97 * @param aClass : CID queried for registeration
98 * @return : true if a factory is registered for CID
101 boolean isCIDRegistered
(in nsCIDRef aClass
);
104 * isContractIDRegistered
106 * Returns true if a factory is registered for the contract id.
108 * @param aClass : contract id queried for registeration
109 * @return : true if a factory is registered for contract id
112 boolean isContractIDRegistered
(in string aContractID
);
117 * Enumerate the list of all registered CIDs.
119 * @return : enumerator for CIDs. Elements of the enumeration can be QI'ed
120 * for the nsISupportsID interface. From the nsISupportsID, you
121 * can obtain the actual CID.
123 nsISimpleEnumerator enumerateCIDs
();
126 * enumerateContractIDs
128 * Enumerate the list of all registered ContractIDs.
130 * @return : enumerator for ContractIDs. Elements of the enumeration can be
131 * QI'ed for the nsISupportsCString interface. From the
132 * nsISupportsCString interface, you can obtain the actual
133 * Contract ID string.
135 nsISimpleEnumerator enumerateContractIDs
();
139 * @status OBSOLETE: This method is no longer implemented, but preserved
140 * in this interface for binary compatibility with
143 string CIDToContractID
(in nsCIDRef aClass
);
148 * Returns the CID for a given Contract ID, if one exists and is registered.
150 * @return : Contract ID.
152 nsCIDPtr contractIDToCID
(in string aContractID
);