nsIInterfaceRequestor.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/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 nsIInterfaceRequestor : public nsISupports {
  32. public:
  33. NS_DEFINE_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_IMETHOD GetInterface(const nsIID & uuid, void * *result) = 0;
  46. };
  47. /* Use this macro when declaring classes that implement this interface. */
  48. #define NS_DECL_NSIINTERFACEREQUESTOR \
  49. NS_IMETHOD GetInterface(const nsIID & uuid, void * *result);
  50. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  51. #define NS_FORWARD_NSIINTERFACEREQUESTOR(_to) \
  52. NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) { return _to GetInterface(uuid, result); }
  53. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  54. #define NS_FORWARD_SAFE_NSIINTERFACEREQUESTOR(_to) \
  55. NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInterface(uuid, result); }
  56. #if 0
  57. /* Use the code below as a template for the implementation class for this interface. */
  58. /* Header file */
  59. class nsInterfaceRequestor : public nsIInterfaceRequestor
  60. {
  61. public:
  62. NS_DECL_ISUPPORTS
  63. NS_DECL_NSIINTERFACEREQUESTOR
  64. nsInterfaceRequestor();
  65. private:
  66. ~nsInterfaceRequestor();
  67. protected:
  68. /* additional members */
  69. };
  70. /* Implementation file */
  71. NS_IMPL_ISUPPORTS1(nsInterfaceRequestor, nsIInterfaceRequestor)
  72. nsInterfaceRequestor::nsInterfaceRequestor()
  73. {
  74. /* member initializers and constructor code */
  75. }
  76. nsInterfaceRequestor::~nsInterfaceRequestor()
  77. {
  78. /* destructor code */
  79. }
  80. /* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  81. NS_IMETHODIMP nsInterfaceRequestor::GetInterface(const nsIID & uuid, void * *result)
  82. {
  83. return NS_ERROR_NOT_IMPLEMENTED;
  84. }
  85. /* End of implementation class template. */
  86. #endif
  87. #endif /* __gen_nsIInterfaceRequestor_h__ */