PageRenderTime 102ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 58ms app.codeStats 0ms

/gecko_api/include/nsIObserver.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 114 lines | 48 code | 26 blank | 40 comment | 0 complexity | 0099594c0ab37d1255ea124464fa3147 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/ds/nsIObserver.idl
  3 */
  4
  5#ifndef __gen_nsIObserver_h__
  6#define __gen_nsIObserver_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:    nsIObserver */
 19#define NS_IOBSERVER_IID_STR "db242e01-e4d9-11d2-9dde-000064657374"
 20
 21#define NS_IOBSERVER_IID \
 22  {0xdb242e01, 0xe4d9, 0x11d2, \
 23    { 0x9d, 0xde, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
 24
 25/**
 26 * This interface is implemented by an object that wants
 27 * to observe an event corresponding to a topic.
 28 *
 29 * @status FROZEN
 30 */
 31class NS_NO_VTABLE NS_SCRIPTABLE nsIObserver : public nsISupports {
 32 public: 
 33
 34  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBSERVER_IID)
 35
 36  /**
 37    * Observe will be called when there is a notification for the
 38    * topic |aTopic|.  This assumes that the object implementing
 39    * this interface has been registered with an observer service
 40    * such as the nsIObserverService. 
 41    *
 42    * If you expect multiple topics/subjects, the impl is 
 43    * responsible for filtering.
 44    *
 45    * You should not modify, add, remove, or enumerate 
 46    * notifications in the implemention of observe. 
 47    *
 48    * @param aSubject : Notification specific interface pointer.
 49    * @param aTopic   : The notification topic or subject.
 50    * @param aData    : Notification specific wide string.
 51    *                    subject event.
 52    */
 53  /* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */
 54  NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) = 0;
 55
 56};
 57
 58  NS_DEFINE_STATIC_IID_ACCESSOR(nsIObserver, NS_IOBSERVER_IID)
 59
 60/* Use this macro when declaring classes that implement this interface. */
 61#define NS_DECL_NSIOBSERVER \
 62  NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData); 
 63
 64/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 65#define NS_FORWARD_NSIOBSERVER(_to) \
 66  NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) { return _to Observe(aSubject, aTopic, aData); } 
 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_NSIOBSERVER(_to) \
 70  NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->Observe(aSubject, aTopic, aData); } 
 71
 72#if 0
 73/* Use the code below as a template for the implementation class for this interface. */
 74
 75/* Header file */
 76class nsObserver : public nsIObserver
 77{
 78public:
 79  NS_DECL_ISUPPORTS
 80  NS_DECL_NSIOBSERVER
 81
 82  nsObserver();
 83
 84private:
 85  ~nsObserver();
 86
 87protected:
 88  /* additional members */
 89};
 90
 91/* Implementation file */
 92NS_IMPL_ISUPPORTS1(nsObserver, nsIObserver)
 93
 94nsObserver::nsObserver()
 95{
 96  /* member initializers and constructor code */
 97}
 98
 99nsObserver::~nsObserver()
100{
101  /* destructor code */
102}
103
104/* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */
105NS_IMETHODIMP nsObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
106{
107    return NS_ERROR_NOT_IMPLEMENTED;
108}
109
110/* End of implementation class template. */
111#endif
112
113
114#endif /* __gen_nsIObserver_h__ */