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"
14 [builtinclass
, scriptable
, uuid(2417cbfe
-65ad
-48a6
-b4b6
-eb84db174392
)]
15 interface nsIComponentRegistrar
: nsISupports
20 * Register a .manifest file, or an entire directory containing
21 * these files. Registration lasts for this run only, and is not cached.
23 * @note Formerly this method would register component files directly. This
24 * is no longer supported.
26 void autoRegister
(in nsIFile aSpec
);
31 * Register a factory with a given ContractID, CID and Class Name.
33 * @param aClass : CID of object
34 * @param aClassName : Class Name of CID (unused)
35 * @param aContractID : ContractID associated with CID aClass. May be null
36 * if no contract ID is needed.
37 * @param aFactory : Factory that will be registered for CID aClass.
38 * If aFactory is null, the contract will be associated
39 * with a previously registered CID.
41 void registerFactory
(in nsCIDRef aClass
,
43 in string aContractID
,
44 in nsIFactory aFactory
);
49 * Unregister a factory associated with CID aClass.
51 * @param aClass : CID being unregistered
52 * @param aFactory : Factory previously registered to create instances of
55 * @throws NS_ERROR* Method failure.
57 void unregisterFactory
(in nsCIDRef aClass
,
58 in nsIFactory aFactory
);
63 * Returns true if a factory is registered for the CID.
65 * @param aClass : CID queried for registeration
66 * @return : true if a factory is registered for CID
69 boolean isCIDRegistered
(in nsCIDRef aClass
);
72 * isContractIDRegistered
74 * Returns true if a factory is registered for the contract id.
76 * @param aClass : contract id queried for registeration
77 * @return : true if a factory is registered for contract id
80 boolean isContractIDRegistered
(in string aContractID
);
85 * Return the list of all registered ContractIDs.
87 * @return : Array of ContractIDs. Elements of the array are the string
88 * encoding of Contract IDs.
90 Array
<ACString
> getContractIDs
();
95 * Returns the CID for a given Contract ID, if one exists and is registered.
97 * @return : Contract ID.
99 nsCIDPtr contractIDToCID
(in string aContractID
);