OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0
-Release/WINNT_5.2_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 */ |
| 31 class NS_NO_VTABLE nsIObserver : public nsISupports { |
| 32 public: |
| 33 |
| 34 NS_DEFINE_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_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar
*aData) = 0; |
| 55 |
| 56 }; |
| 57 |
| 58 /* Use this macro when declaring classes that implement this interface. */ |
| 59 #define NS_DECL_NSIOBSERVER \ |
| 60 NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar
*aData); |
| 61 |
| 62 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 63 #define NS_FORWARD_NSIOBSERVER(_to) \ |
| 64 NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar
*aData) { return _to Observe(aSubject, aTopic, aData); } |
| 65 |
| 66 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 67 #define NS_FORWARD_SAFE_NSIOBSERVER(_to) \ |
| 68 NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar
*aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->Observe(aSubject, aTopic, a
Data); } |
| 69 |
| 70 #if 0 |
| 71 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 72 |
| 73 /* Header file */ |
| 74 class nsObserver : public nsIObserver |
| 75 { |
| 76 public: |
| 77 NS_DECL_ISUPPORTS |
| 78 NS_DECL_NSIOBSERVER |
| 79 |
| 80 nsObserver(); |
| 81 |
| 82 private: |
| 83 ~nsObserver(); |
| 84 |
| 85 protected: |
| 86 /* additional members */ |
| 87 }; |
| 88 |
| 89 /* Implementation file */ |
| 90 NS_IMPL_ISUPPORTS1(nsObserver, nsIObserver) |
| 91 |
| 92 nsObserver::nsObserver() |
| 93 { |
| 94 /* member initializers and constructor code */ |
| 95 } |
| 96 |
| 97 nsObserver::~nsObserver() |
| 98 { |
| 99 /* destructor code */ |
| 100 } |
| 101 |
| 102 /* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); *
/ |
| 103 NS_IMETHODIMP nsObserver::Observe(nsISupports *aSubject, const char *aTopic, con
st PRUnichar *aData) |
| 104 { |
| 105 return NS_ERROR_NOT_IMPLEMENTED; |
| 106 } |
| 107 |
| 108 /* End of implementation class template. */ |
| 109 #endif |
| 110 |
| 111 |
| 112 #endif /* __gen_nsIObserver_h__ */ |
OLD | NEW |