/gecko_api/include/nsIFactory.h
C++ Header | 135 lines | 56 code | 28 blank | 51 comment | 0 complexity | a305e26530c4fd422fe6d8e8d0387cab MD5 | raw file
1/* 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/components/nsIFactory.idl 3 */ 4 5#ifndef __gen_nsIFactory_h__ 6#define __gen_nsIFactory_h__ 7 8 9#ifndef __gen_nsISupports_h__ 10#include "nsISupports.h" 11#endif 12 13/* For IDL files that don't want to include root IDL files. */ 14#ifndef NS_NO_VTABLE 15#define NS_NO_VTABLE 16#endif 17 18/* starting interface: nsIFactory */ 19#define NS_IFACTORY_IID_STR "00000001-0000-0000-c000-000000000046" 20 21#define NS_IFACTORY_IID \ 22 {0x00000001, 0x0000, 0x0000, \ 23 { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }} 24 25/** 26 * A class factory allows the creation of nsISupports derived 27 * components without specifying a concrete base class. 28 * 29 * @status FROZEN 30 */ 31class NS_NO_VTABLE NS_SCRIPTABLE nsIFactory : public nsISupports { 32 public: 33 34 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFACTORY_IID) 35 36 /** 37 * Creates an instance of a component. 38 * 39 * @param aOuter Pointer to a component that wishes to be aggregated 40 * in the resulting instance. This will be nsnull if no 41 * aggregation is requested. 42 * @param iid The IID of the interface being requested in 43 * the component which is being currently created. 44 * @param result [out] Pointer to the newly created instance, if successful. 45 * @return NS_OK - Component successfully created and the interface 46 * being requested was successfully returned in result. 47 * NS_NOINTERFACE - Interface not accessible. 48 * NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the 49 * component is not aggregatable. 50 * NS_ERROR* - Method failure. 51 */ 52 /* void createInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */ 53 NS_SCRIPTABLE NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) = 0; 54 55 /** 56 * LockFactory provides the client a way to keep the component 57 * in memory until it is finished with it. The client can call 58 * LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE) 59 * to release the factory. 60 * 61 * @param lock - Must be PR_TRUE or PR_FALSE 62 * @return NS_OK - If the lock operation was successful. 63 * NS_ERROR* - Method failure. 64 */ 65 /* void lockFactory (in PRBool lock); */ 66 NS_SCRIPTABLE NS_IMETHOD LockFactory(PRBool lock) = 0; 67 68}; 69 70 NS_DEFINE_STATIC_IID_ACCESSOR(nsIFactory, NS_IFACTORY_IID) 71 72/* Use this macro when declaring classes that implement this interface. */ 73#define NS_DECL_NSIFACTORY \ 74 NS_SCRIPTABLE NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result); \ 75 NS_SCRIPTABLE NS_IMETHOD LockFactory(PRBool lock); 76 77/* Use this macro to declare functions that forward the behavior of this interface to another object. */ 78#define NS_FORWARD_NSIFACTORY(_to) \ 79 NS_SCRIPTABLE NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) { return _to CreateInstance(aOuter, iid, result); } \ 80 NS_SCRIPTABLE NS_IMETHOD LockFactory(PRBool lock) { return _to LockFactory(lock); } 81 82/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ 83#define NS_FORWARD_SAFE_NSIFACTORY(_to) \ 84 NS_SCRIPTABLE NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateInstance(aOuter, iid, result); } \ 85 NS_SCRIPTABLE NS_IMETHOD LockFactory(PRBool lock) { return !_to ? NS_ERROR_NULL_POINTER : _to->LockFactory(lock); } 86 87#if 0 88/* Use the code below as a template for the implementation class for this interface. */ 89 90/* Header file */ 91class nsFactory : public nsIFactory 92{ 93public: 94 NS_DECL_ISUPPORTS 95 NS_DECL_NSIFACTORY 96 97 nsFactory(); 98 99private: 100 ~nsFactory(); 101 102protected: 103 /* additional members */ 104}; 105 106/* Implementation file */ 107NS_IMPL_ISUPPORTS1(nsFactory, nsIFactory) 108 109nsFactory::nsFactory() 110{ 111 /* member initializers and constructor code */ 112} 113 114nsFactory::~nsFactory() 115{ 116 /* destructor code */ 117} 118 119/* void createInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */ 120NS_IMETHODIMP nsFactory::CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) 121{ 122 return NS_ERROR_NOT_IMPLEMENTED; 123} 124 125/* void lockFactory (in PRBool lock); */ 126NS_IMETHODIMP nsFactory::LockFactory(PRBool lock) 127{ 128 return NS_ERROR_NOT_IMPLEMENTED; 129} 130 131/* End of implementation class template. */ 132#endif 133 134 135#endif /* __gen_nsIFactory_h__ */