|
1 /* -*- Mode: IDL; 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 /** |
|
9 * A class factory allows the creation of nsISupports derived |
|
10 * components without specifying a concrete base class. |
|
11 */ |
|
12 |
|
13 [scriptable, object, uuid(00000001-0000-0000-c000-000000000046)] |
|
14 interface nsIFactory : nsISupports { |
|
15 /** |
|
16 * Creates an instance of a component. |
|
17 * |
|
18 * @param aOuter Pointer to a component that wishes to be aggregated |
|
19 * in the resulting instance. This will be nullptr if no |
|
20 * aggregation is requested. |
|
21 * @param iid The IID of the interface being requested in |
|
22 * the component which is being currently created. |
|
23 * @param result [out] Pointer to the newly created instance, if successful. |
|
24 * @throws NS_NOINTERFACE - Interface not accessible. |
|
25 * @throws NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the |
|
26 * component is not aggregatable. |
|
27 * NS_ERROR* - Method failure. |
|
28 */ |
|
29 void createInstance(in nsISupports aOuter, in nsIIDRef iid, |
|
30 [retval, iid_is(iid)] out nsQIResult result); |
|
31 |
|
32 /** |
|
33 * LockFactory provides the client a way to keep the component |
|
34 * in memory until it is finished with it. The client can call |
|
35 * LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE) |
|
36 * to release the factory. |
|
37 * |
|
38 * @param lock - Must be PR_TRUE or PR_FALSE |
|
39 * @throws NS_ERROR* - Method failure. |
|
40 */ |
|
41 void lockFactory(in boolean lock); |
|
42 }; |