Struct xpcom::interfaces::nsIPrefService
[−]
[src]
#[repr(C)]pub struct nsIPrefService { /* fields omitted */ }
interface nsIPrefService : nsISupports
/**
* The nsIPrefService interface is the main entry point into the back end
* preferences management library. The preference service is directly
* responsible for the management of the preferences files and also facilitates
* access to the preference branch object which allows the direct manipulation
* of the preferences themselves.
*
* @see nsIPrefBranch
*/
Methods
impl nsIPrefService
[src]
pub fn coerce<T: nsIPrefServiceCoerce>(&self) -> &T
[src]
Cast this nsIPrefService
to one of its base interfaces.
impl nsIPrefService
[src]
pub unsafe fn ResetPrefs(&self) -> nsresult
[src]
/**
* Called to completely flush and re-initialize the preferences system.
*
* @throws Error The preference service failed to restart correctly.
*/
void resetPrefs ();
pub unsafe fn ResetUserPrefs(&self) -> nsresult
[src]
/**
* Called to reset all preferences with user set values back to the
* application default values.
*/
void resetUserPrefs ();
pub unsafe fn SavePrefFile(&self, aFile: *const nsIFile) -> nsresult
[src]
/**
* Called to write current preferences state to a file.
*
* @param aFile The file to be written.
*
* @note
* If nullptr is passed in for the aFile parameter the preference data is
* written out to the current preferences file (usually prefs.js.)
*
* @throws Error File failed to write.
*
* @see readUserPrefs
* @see nsIFile
*/
void savePrefFile (in nsIFile aFile);
pub unsafe fn GetBranch(
&self,
aPrefRoot: *const c_char,
_retval: *mut *const nsIPrefBranch
) -> nsresult
[src]
&self,
aPrefRoot: *const c_char,
_retval: *mut *const nsIPrefBranch
) -> nsresult
/**
* Call to get a Preferences "Branch" which accesses user preference data.
* Using a Set method on this object will always create or set a user
* preference value. When using a Get method a user set value will be
* returned if one exists, otherwise a default value will be returned.
*
* @param aPrefRoot The preference "root" on which to base this "branch".
* For example, if the root "browser.startup." is used, the
* branch will be able to easily access the preferences
* "browser.startup.page", "browser.startup.homepage", or
* "browser.startup.homepage_override" by simply requesting
* "page", "homepage", or "homepage_override". nullptr or ""
* may be used to access to the entire preference "tree".
*
* @return nsIPrefBranch The object representing the requested branch.
*
* @see getDefaultBranch
*/
nsIPrefBranch getBranch (in string aPrefRoot);
pub unsafe fn GetDefaultBranch(
&self,
aPrefRoot: *const c_char,
_retval: *mut *const nsIPrefBranch
) -> nsresult
[src]
&self,
aPrefRoot: *const c_char,
_retval: *mut *const nsIPrefBranch
) -> nsresult
/**
* Call to get a Preferences "Branch" which accesses only the default
* preference data. Using a Set method on this object will always create or
* set a default preference value. When using a Get method a default value
* will always be returned.
*
* @param aPrefRoot The preference "root" on which to base this "branch".
* For example, if the root "browser.startup." is used, the
* branch will be able to easily access the preferences
* "browser.startup.page", "browser.startup.homepage", or
* "browser.startup.homepage_override" by simply requesting
* "page", "homepage", or "homepage_override". nullptr or ""
* may be used to access to the entire preference "tree".
*
* @note
* Few consumers will want to create default branch objects. Many of the
* branch methods do nothing on a default branch because the operations only
* make sense when applied to user set preferences.
*
* @return nsIPrefBranch The object representing the requested default branch.
*
* @see getBranch
*/
nsIPrefBranch getDefaultBranch (in string aPrefRoot);
pub unsafe fn GetDirty(&self, aDirty: *mut bool) -> nsresult
[src]
/**
* The preference service is 'dirty' if there are changes to user preferences
* that have not been written to disk
*/
readonly attribute boolean dirty;
pub unsafe fn ReadUserPrefsFromFile(&self, aFile: *const nsIFile) -> nsresult
[src]
/**
* Read in the preferences specified in a user preference file. This method
* does not clear user preferences that were already set.
*
* @param aFile The file to be read.
*
* @throws Error File failed to read or contained invalid data.
* @note This method is intended for internal unit testing only!
*/
void readUserPrefsFromFile (in nsIFile aFile);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIPrefService
[src]
const IID: nsIID
IID: nsIID = nsID(528809302, 14678, 16607, [184, 106, 30, 160, 20, 2, 238, 150])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIPrefService
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIPrefService
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.