PageRenderTime 35ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIInterfaceRequestor.h

http://firefox-mac-pdf.googlecode.com/
C Header | 114 lines | 48 code | 26 blank | 40 comment | 0 complexity | 43c301e160dc35cef934edd02ab8ef5f MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/base/nsIInterfaceRequestor.idl
  3. */
  4. #ifndef __gen_nsIInterfaceRequestor_h__
  5. #define __gen_nsIInterfaceRequestor_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: nsIInterfaceRequestor */
  14. #define NS_IINTERFACEREQUESTOR_IID_STR "033a1470-8b2a-11d3-af88-00a024ffc08c"
  15. #define NS_IINTERFACEREQUESTOR_IID \
  16. {0x033a1470, 0x8b2a, 0x11d3, \
  17. { 0xaf, 0x88, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
  18. /**
  19. * The nsIInterfaceRequestor interface defines a generic interface for
  20. * requesting interfaces that a given object might provide access to.
  21. * This is very similar to QueryInterface found in nsISupports.
  22. * The main difference is that interfaces returned from GetInterface()
  23. * are not required to provide a way back to the object implementing this
  24. * interface. The semantics of QI() dictate that given an interface A that
  25. * you QI() on to get to interface B, you must be able to QI on B to get back
  26. * to A. This interface however allows you to obtain an interface C from A
  27. * that may or most likely will not have the ability to get back to A.
  28. *
  29. * @status FROZEN
  30. */
  31. class NS_NO_VTABLE NS_SCRIPTABLE nsIInterfaceRequestor : public nsISupports {
  32. public:
  33. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINTERFACEREQUESTOR_IID)
  34. /**
  35. * Retrieves the specified interface pointer.
  36. *
  37. * @param uuid The IID of the interface being requested.
  38. * @param result [out] The interface pointer to be filled in if
  39. * the interface is accessible.
  40. * @return NS_OK - interface was successfully returned.
  41. * NS_NOINTERFACE - interface not accessible.
  42. * NS_ERROR* - method failure.
  43. */
  44. /* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  45. NS_SCRIPTABLE NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) = 0;
  46. };
  47. NS_DEFINE_STATIC_IID_ACCESSOR(nsIInterfaceRequestor, NS_IINTERFACEREQUESTOR_IID)
  48. /* Use this macro when declaring classes that implement this interface. */
  49. #define NS_DECL_NSIINTERFACEREQUESTOR \
  50. NS_SCRIPTABLE NS_IMETHOD GetInterface(const nsIID & uuid, void * *result);
  51. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  52. #define NS_FORWARD_NSIINTERFACEREQUESTOR(_to) \
  53. NS_SCRIPTABLE NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) { return _to GetInterface(uuid, result); }
  54. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  55. #define NS_FORWARD_SAFE_NSIINTERFACEREQUESTOR(_to) \
  56. NS_SCRIPTABLE NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInterface(uuid, result); }
  57. #if 0
  58. /* Use the code below as a template for the implementation class for this interface. */
  59. /* Header file */
  60. class nsInterfaceRequestor : public nsIInterfaceRequestor
  61. {
  62. public:
  63. NS_DECL_ISUPPORTS
  64. NS_DECL_NSIINTERFACEREQUESTOR
  65. nsInterfaceRequestor();
  66. private:
  67. ~nsInterfaceRequestor();
  68. protected:
  69. /* additional members */
  70. };
  71. /* Implementation file */
  72. NS_IMPL_ISUPPORTS1(nsInterfaceRequestor, nsIInterfaceRequestor)
  73. nsInterfaceRequestor::nsInterfaceRequestor()
  74. {
  75. /* member initializers and constructor code */
  76. }
  77. nsInterfaceRequestor::~nsInterfaceRequestor()
  78. {
  79. /* destructor code */
  80. }
  81. /* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  82. NS_IMETHODIMP nsInterfaceRequestor::GetInterface(const nsIID & uuid, void * *result)
  83. {
  84. return NS_ERROR_NOT_IMPLEMENTED;
  85. }
  86. /* End of implementation class template. */
  87. #endif
  88. #endif /* __gen_nsIInterfaceRequestor_h__ */