michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * A class factory allows the creation of nsISupports derived michael@0: * components without specifying a concrete base class. michael@0: */ michael@0: michael@0: [scriptable, object, uuid(00000001-0000-0000-c000-000000000046)] michael@0: interface nsIFactory : nsISupports { michael@0: /** michael@0: * Creates an instance of a component. michael@0: * michael@0: * @param aOuter Pointer to a component that wishes to be aggregated michael@0: * in the resulting instance. This will be nullptr if no michael@0: * aggregation is requested. michael@0: * @param iid The IID of the interface being requested in michael@0: * the component which is being currently created. michael@0: * @param result [out] Pointer to the newly created instance, if successful. michael@0: * @throws NS_NOINTERFACE - Interface not accessible. michael@0: * @throws NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the michael@0: * component is not aggregatable. michael@0: * NS_ERROR* - Method failure. michael@0: */ michael@0: void createInstance(in nsISupports aOuter, in nsIIDRef iid, michael@0: [retval, iid_is(iid)] out nsQIResult result); michael@0: michael@0: /** michael@0: * LockFactory provides the client a way to keep the component michael@0: * in memory until it is finished with it. The client can call michael@0: * LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE) michael@0: * to release the factory. michael@0: * michael@0: * @param lock - Must be PR_TRUE or PR_FALSE michael@0: * @throws NS_ERROR* - Method failure. michael@0: */ michael@0: void lockFactory(in boolean lock); michael@0: };