bug 812562 - click-to-play: reshow notification for blocklisted plugins r=jaws
[gecko.git] / xpcom / ds / nsIObserverService.idl
blobd5b40e227ac1017872fdef1b7ed65fa038cd3c30
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIObserver;
9 interface nsISimpleEnumerator;
11 /**
12 * nsIObserverService
14 * Service allows a client listener (nsIObserver) to register and unregister for
15 * notifications of specific string referenced topic. Service also provides a
16 * way to notify registered listeners and a way to enumerate registered client
17 * listeners.
20 [scriptable, uuid(D07F5192-E3D1-11d2-8ACD-00105A1B8860)]
21 interface nsIObserverService : nsISupports
24 /**
25 * AddObserver
27 * Registers a given listener for a notifications regarding the specified
28 * topic.
30 * @param anObserve : The interface pointer which will receive notifications.
31 * @param aTopic : The notification topic or subject.
32 * @param ownsWeak : If set to false, the nsIObserverService will hold a
33 * strong reference to |anObserver|. If set to true and
34 * |anObserver| supports the nsIWeakReference interface,
35 * a weak reference will be held. Otherwise an error will be
36 * returned.
38 void addObserver( in nsIObserver anObserver, in string aTopic, in boolean ownsWeak);
40 /**
41 * removeObserver
43 * Unregisters a given listener from notifications regarding the specified
44 * topic.
46 * @param anObserver : The interface pointer which will stop recieving
47 * notifications.
48 * @param aTopic : The notification topic or subject.
50 void removeObserver( in nsIObserver anObserver, in string aTopic );
52 /**
53 * notifyObservers
55 * Notifies all registered listeners of the given topic.
57 * @param aSubject : Notification specific interface pointer.
58 * @param aTopic : The notification topic or subject.
59 * @param someData : Notification specific wide string.
61 void notifyObservers( in nsISupports aSubject,
62 in string aTopic,
63 in wstring someData );
65 /**
66 * enumerateObservers
68 * Returns an enumeration of all registered listeners.
70 * @param aTopic : The notification topic or subject.
72 nsISimpleEnumerator enumerateObservers( in string aTopic );