Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIObserver; |
michael@0 | 9 | interface nsISimpleEnumerator; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * nsIObserverService |
michael@0 | 13 | * |
michael@0 | 14 | * Service allows a client listener (nsIObserver) to register and unregister for |
michael@0 | 15 | * notifications of specific string referenced topic. Service also provides a |
michael@0 | 16 | * way to notify registered listeners and a way to enumerate registered client |
michael@0 | 17 | * listeners. |
michael@0 | 18 | */ |
michael@0 | 19 | |
michael@0 | 20 | [scriptable, uuid(D07F5192-E3D1-11d2-8ACD-00105A1B8860)] |
michael@0 | 21 | interface nsIObserverService : nsISupports |
michael@0 | 22 | { |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * AddObserver |
michael@0 | 26 | * |
michael@0 | 27 | * Registers a given listener for a notifications regarding the specified |
michael@0 | 28 | * topic. |
michael@0 | 29 | * |
michael@0 | 30 | * @param anObserve : The interface pointer which will receive notifications. |
michael@0 | 31 | * @param aTopic : The notification topic or subject. |
michael@0 | 32 | * @param ownsWeak : If set to false, the nsIObserverService will hold a |
michael@0 | 33 | * strong reference to |anObserver|. If set to true and |
michael@0 | 34 | * |anObserver| supports the nsIWeakReference interface, |
michael@0 | 35 | * a weak reference will be held. Otherwise an error will be |
michael@0 | 36 | * returned. |
michael@0 | 37 | */ |
michael@0 | 38 | void addObserver( in nsIObserver anObserver, in string aTopic, in boolean ownsWeak); |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * removeObserver |
michael@0 | 42 | * |
michael@0 | 43 | * Unregisters a given listener from notifications regarding the specified |
michael@0 | 44 | * topic. |
michael@0 | 45 | * |
michael@0 | 46 | * @param anObserver : The interface pointer which will stop recieving |
michael@0 | 47 | * notifications. |
michael@0 | 48 | * @param aTopic : The notification topic or subject. |
michael@0 | 49 | */ |
michael@0 | 50 | void removeObserver( in nsIObserver anObserver, in string aTopic ); |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * notifyObservers |
michael@0 | 54 | * |
michael@0 | 55 | * Notifies all registered listeners of the given topic. |
michael@0 | 56 | * |
michael@0 | 57 | * @param aSubject : Notification specific interface pointer. |
michael@0 | 58 | * @param aTopic : The notification topic or subject. |
michael@0 | 59 | * @param someData : Notification specific wide string. |
michael@0 | 60 | */ |
michael@0 | 61 | void notifyObservers( in nsISupports aSubject, |
michael@0 | 62 | in string aTopic, |
michael@0 | 63 | in wstring someData ); |
michael@0 | 64 | |
michael@0 | 65 | /** |
michael@0 | 66 | * enumerateObservers |
michael@0 | 67 | * |
michael@0 | 68 | * Returns an enumeration of all registered listeners. |
michael@0 | 69 | * |
michael@0 | 70 | * @param aTopic : The notification topic or subject. |
michael@0 | 71 | */ |
michael@0 | 72 | nsISimpleEnumerator enumerateObservers( in string aTopic ); |
michael@0 | 73 | |
michael@0 | 74 | |
michael@0 | 75 | }; |
michael@0 | 76 | |
michael@0 | 77 |