
nsIObserverService
Service allows a client listener (
nsIObserver) to register and unregister for notifications ofa specific string referenced topic. Service also provides a way to notify registered listeners and a way to enumerate registered client listenersRegisters a given listener for a notifications regarding the specified topic.
Syntax:
void nsIObserverService::addObserver( in nsIObserver anObserver,in string aTopic, in boolean ownsWeak)Parameters:
ownsWeak:If set toFALSE, thensIObserverServicewill hold a strong reference toanObserver. If set toTRUEandanObserversupports thensIWeakReferenceinterface, a weak reference will be held. Otherwise an error will be returned.
nsresult:
Unregisters a given listener from notifications regarding the specified topic.
Syntax:
void nsIObserverService::removeObserver( in nsIObserver anObserver,in string aTopic)Parameters:
nsresult:
Notifies all registered listeners of the given topic.
Syntax:
void nsIObserverService::notifyObservers( in nsISupports aSubject,in string aTopic, in wstring someData)Parameters:
nsresult:
Returns an enumeration of all registered listeners.
See also:
nsISimpleEnumerator.Syntax:
nsISimpleEnumerator nsIObserverService::enumerateObservers( in string aTopic)Parameters:
nsresult:
| Written by:Ellen Evans | Comments, questions, complaints?
Bug 143387 |