PageRenderTime 145ms CodeModel.GetById 22ms RepoModel.GetById 0ms 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. #ifndef __gen_nsIObserver_h__
  5. #define __gen_nsIObserver_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: nsIObserver */
  14. #define NS_IOBSERVER_IID_STR "db242e01-e4d9-11d2-9dde-000064657374"
  15. #define NS_IOBSERVER_IID \
  16. {0xdb242e01, 0xe4d9, 0x11d2, \
  17. { 0x9d, 0xde, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
  18. /**
  19. * This interface is implemented by an object that wants
  20. * to observe an event corresponding to a topic.
  21. *
  22. * @status FROZEN
  23. */
  24. class NS_NO_VTABLE NS_SCRIPTABLE nsIObserver : public nsISupports {
  25. public:
  26. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBSERVER_IID)
  27. /**
  28. * Observe will be called when there is a notification for the
  29. * topic |aTopic|. This assumes that the object implementing
  30. * this interface has been registered with an observer service
  31. * such as the nsIObserverService.
  32. *
  33. * If you expect multiple topics/subjects, the impl is
  34. * responsible for filtering.
  35. *
  36. * You should not modify, add, remove, or enumerate
  37. * notifications in the implemention of observe.
  38. *
  39. * @param aSubject : Notification specific interface pointer.
  40. * @param aTopic : The notification topic or subject.
  41. * @param aData : Notification specific wide string.
  42. * subject event.
  43. */
  44. /* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */
  45. NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) = 0;
  46. };
  47. NS_DEFINE_STATIC_IID_ACCESSOR(nsIObserver, NS_IOBSERVER_IID)
  48. /* Use this macro when declaring classes that implement this interface. */
  49. #define NS_DECL_NSIOBSERVER \
  50. NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData);
  51. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  52. #define NS_FORWARD_NSIOBSERVER(_to) \
  53. NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) { return _to Observe(aSubject, aTopic, aData); }
  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_NSIOBSERVER(_to) \
  56. NS_SCRIPTABLE NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->Observe(aSubject, aTopic, aData); }
  57. #if 0
  58. /* Use the code below as a template for the implementation class for this interface. */
  59. /* Header file */
  60. class nsObserver : public nsIObserver
  61. {
  62. public:
  63. NS_DECL_ISUPPORTS
  64. NS_DECL_NSIOBSERVER
  65. nsObserver();
  66. private:
  67. ~nsObserver();
  68. protected:
  69. /* additional members */
  70. };
  71. /* Implementation file */
  72. NS_IMPL_ISUPPORTS1(nsObserver, nsIObserver)
  73. nsObserver::nsObserver()
  74. {
  75. /* member initializers and constructor code */
  76. }
  77. nsObserver::~nsObserver()
  78. {
  79. /* destructor code */
  80. }
  81. /* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */
  82. NS_IMETHODIMP nsObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
  83. {
  84. return NS_ERROR_NOT_IMPLEMENTED;
  85. }
  86. /* End of implementation class template. */
  87. #endif
  88. #endif /* __gen_nsIObserver_h__ */