nsIPrefBranch2

IID:74567534-eb94-4b1c-8f45-389643bfc555
Inherits From:nsIPrefBranch
Status:FROZEN

nsIPrefBranch2 allows clients to observe changes to pref values.

This interface is implemented by the following components:


Methods

void addObserver ( char* domain , nsIObserver observer , PRBool holdWeak ) void removeObserver ( char* domain , nsIObserver observer )

void addObserver ( char* domain , nsIObserver observer , PRBool holdWeak )

Add a preference change observer. On preference changes, the following arguments will be passed to the nsIObserver.observe() method: subject - The nsIPrefBranch object (this) topic - The string defined by NS_PREFBRANCH_PREFCHANGE_TOPIC_ID data - The preference which has changed

Arguments:
domain: The preference on which to listen for changes. This can be the name of an entire branch to observe. e.g. Holding the "root" prefbranch and calling addObserver("foo.bar.", ...) will observe changes to foo.bar.baz and foo.bar.bzip
observer: The object to be notified if the preference changes.
holdWeak: true Hold a weak reference to |observer|. The object must implement the nsISupportsWeakReference interface or this will fail. false Hold a strong reference to |observer|.

void removeObserver ( char* domain , nsIObserver observer )

Remove a preference change observer.

Arguments:
domain: The preference which is being observed for changes.
observer: An observer previously registered with addObserver().

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com