PageRenderTime 141ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 62ms app.codeStats 1ms

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