PageRenderTime 15ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIFactory.h

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