1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/components/nsIFactory.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +/** 1.12 + * A class factory allows the creation of nsISupports derived 1.13 + * components without specifying a concrete base class. 1.14 + */ 1.15 + 1.16 +[scriptable, object, uuid(00000001-0000-0000-c000-000000000046)] 1.17 +interface nsIFactory : nsISupports { 1.18 + /** 1.19 + * Creates an instance of a component. 1.20 + * 1.21 + * @param aOuter Pointer to a component that wishes to be aggregated 1.22 + * in the resulting instance. This will be nullptr if no 1.23 + * aggregation is requested. 1.24 + * @param iid The IID of the interface being requested in 1.25 + * the component which is being currently created. 1.26 + * @param result [out] Pointer to the newly created instance, if successful. 1.27 + * @throws NS_NOINTERFACE - Interface not accessible. 1.28 + * @throws NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the 1.29 + * component is not aggregatable. 1.30 + * NS_ERROR* - Method failure. 1.31 + */ 1.32 + void createInstance(in nsISupports aOuter, in nsIIDRef iid, 1.33 + [retval, iid_is(iid)] out nsQIResult result); 1.34 + 1.35 + /** 1.36 + * LockFactory provides the client a way to keep the component 1.37 + * in memory until it is finished with it. The client can call 1.38 + * LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE) 1.39 + * to release the factory. 1.40 + * 1.41 + * @param lock - Must be PR_TRUE or PR_FALSE 1.42 + * @throws NS_ERROR* - Method failure. 1.43 + */ 1.44 + void lockFactory(in boolean lock); 1.45 +};