Backed out 2 changesets (bug 1853057) for causing mda failures on test_video_low_powe...
[gecko.git] / xpcom / components / nsIComponentRegistrar.idl
blob6b85caffab4ff79194f36cfb8243382409aae9f9
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/. */
5 /**
6 * The nsIComponentRegistrar interface.
7 */
9 #include "nsISupports.idl"
11 interface nsIFile;
12 interface nsIFactory;
14 [builtinclass, scriptable, uuid(2417cbfe-65ad-48a6-b4b6-eb84db174392)]
15 interface nsIComponentRegistrar : nsISupports
17 /**
18 * autoRegister
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);
28 /**
29 * registerFactory
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,
42 in string aClassName,
43 in string aContractID,
44 in nsIFactory aFactory);
46 /**
47 * unregisterFactory
49 * Unregister a factory associated with CID aClass.
51 * @param aClass : CID being unregistered
52 * @param aFactory : Factory previously registered to create instances of
53 * CID aClass.
55 * @throws NS_ERROR* Method failure.
57 void unregisterFactory(in nsCIDRef aClass,
58 in nsIFactory aFactory);
60 /**
61 * isCIDRegistered
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
67 * false otherwise.
69 boolean isCIDRegistered(in nsCIDRef aClass);
71 /**
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
78 * false otherwise.
80 boolean isContractIDRegistered(in string aContractID);
82 /**
83 * getContractIDs
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();
92 /**
93 * contractIDToCID
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);