📄 nsiprefbranch.h
字号:
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIPrefBranch.idl */#ifndef __gen_nsIPrefBranch_h__#define __gen_nsIPrefBranch_h__#ifndef __gen_nsISupports_h__#include "nsISupports.h"#endif/* For IDL files that don't want to include root IDL files. */#ifndef NS_NO_VTABLE#define NS_NO_VTABLE#endif/* starting interface: nsIPrefBranch */#define NS_IPREFBRANCH_IID_STR "56c35506-f14b-11d3-99d3-ddbfac2ccf65"#define NS_IPREFBRANCH_IID \ {0x56c35506, 0xf14b, 0x11d3, \ { 0x99, 0xd3, 0xdd, 0xbf, 0xac, 0x2c, 0xcf, 0x65 }}/** * The nsIPrefBranch interface is used to manipulate the preferences data. This * object may be obtained from the preferences service (nsIPrefService) and * used to get and set default and/or user preferences across the application. * * This object is created with a "root" value which describes the base point in * the preferences "tree" from which this "branch" stems. Preferences are * accessed off of this root by using just the final portion of the preference. * For example, if this object is created with the root "browser.startup.", * the preferences "browser.startup.page", "browser.startup.homepage", * and "browser.startup.homepage_override" can be accessed by simply passing * "page", "homepage", or "homepage_override" to the various Get/Set methods. * * @see nsIPrefService * * @status FROZEN */class NS_NO_VTABLE nsIPrefBranch : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPREFBRANCH_IID) /** * Values describing the basic preference types. * * @see getPrefType */ enum { PREF_INVALID = 0 }; enum { PREF_STRING = 32 }; enum { PREF_INT = 64 }; enum { PREF_BOOL = 128 }; /** * Called to get the root on which this branch is based, such as * "browser.startup." */ /* readonly attribute string root; */ NS_IMETHOD GetRoot(char * *aRoot) = 0; /** * Called to determine the type of a specific preference. * * @param aPrefName The preference to get the type of. * * @return long A value representing the type of the preference. This * value will be PREF_STRING, PREF_INT, or PREF_BOOL. */ /* long getPrefType (in string aPrefName); */ NS_IMETHOD GetPrefType(const char *aPrefName, PRInt32 *_retval) = 0; /** * Called to get the state of an individual boolean preference. * * @param aPrefName The boolean preference to get the state of. * * @return boolean The value of the requested boolean preference. * * @see setBoolPref */ /* boolean getBoolPref (in string aPrefName); */ NS_IMETHOD GetBoolPref(const char *aPrefName, PRBool *_retval) = 0; /** * Called to set the state of an individual boolean preference. * * @param aPrefName The boolean preference to set the state of. * @param aValue The boolean value to set the preference to. * * @return NS_OK The value was successfully set. * @return Other The value was not set or is the wrong type. * * @see getBoolPref */ /* void setBoolPref (in string aPrefName, in long aValue); */ NS_IMETHOD SetBoolPref(const char *aPrefName, PRInt32 aValue) = 0; /** * Called to get the state of an individual string preference. * * @param aPrefName The string preference to retrieve. * * @return string The value of the requested string preference. * * @see setCharPref */ /* string getCharPref (in string aPrefName); */ NS_IMETHOD GetCharPref(const char *aPrefName, char **_retval) = 0; /** * Called to set the state of an individual string preference. * * @param aPrefName The string preference to set. * @param aValue The string value to set the preference to. * * @return NS_OK The value was successfully set. * @return Other The value was not set or is the wrong type. * * @see getCharPref */ /* void setCharPref (in string aPrefName, in string aValue); */ NS_IMETHOD SetCharPref(const char *aPrefName, const char *aValue) = 0; /** * Called to get the state of an individual integer preference. * * @param aPrefName The integer preference to get the value of. * * @return long The value of the requested integer preference. * * @see setIntPref */ /* long getIntPref (in string aPrefName); */ NS_IMETHOD GetIntPref(const char *aPrefName, PRInt32 *_retval) = 0; /** * Called to set the state of an individual integer preference. * * @param aPrefName The integer preference to set the value of. * @param aValue The integer value to set the preference to. * * @return NS_OK The value was successfully set. * @return Other The value was not set or is the wrong type. * * @see getIntPref */ /* void setIntPref (in string aPrefName, in long aValue); */ NS_IMETHOD SetIntPref(const char *aPrefName, PRInt32 aValue) = 0; /** * Called to get the state of an individual complex preference. A complex * preference is a preference which represents an XPCOM object that can not * be easily represented using a standard boolean, integer or string value. * * @param aPrefName The complex preference to get the value of. * @param aType The XPCOM interface that this complex preference * represents. Interfaces currently supported are: * - nsILocalFile * - nsISupportsString (UniChar) * - nsIPrefLocalizedString (Localized UniChar) * - nsIFileSpec (deprecated - to be removed eventually) * @param aValue The XPCOM object into which to the complex preference * value should be retrieved. * * @return NS_OK The value was successfully retrieved. * @return Other The value does not exist or is the wrong type. * * @see setComplexValue */ /* void getComplexValue (in string aPrefName, in nsIIDRef aType, [iid_is (aType), retval] out nsQIResult aValue); */ NS_IMETHOD GetComplexValue(const char *aPrefName, const nsIID & aType, void * *aValue) = 0; /** * Called to set the state of an individual complex preference. A complex * preference is a preference which represents an XPCOM object that can not * be easily represented using a standard boolean, integer or string value. * * @param aPrefName The complex preference to set the value of. * @param aType The XPCOM interface that this complex preference * represents. Interfaces currently supported are: * - nsILocalFile * - nsISupportsString (UniChar) * - nsIPrefLocalizedString (Localized UniChar) * - nsIFileSpec (deprecated - to be removed eventually) * @param aValue The XPCOM object from which to set the complex preference * value. * * @return NS_OK The value was successfully set. * @return Other The value was not set or is the wrong type. * * @see getComplexValue */ /* void setComplexValue (in string aPrefName, in nsIIDRef aType, in nsISupports aValue); */ NS_IMETHOD SetComplexValue(const char *aPrefName, const nsIID & aType, nsISupports *aValue) = 0; /** * Called to clear a user set value from a specific preference. This will, in * effect, reset the value to the default value. If no default value exists * the preference will cease to exist. * * @param aPrefName The preference to be cleared. * * @note * This method does nothing if this object is a default branch. * * @return NS_OK The user preference was successfully cleared. * @return Other The preference does not exist or have a user set value. */ /* void clearUserPref (in string aPrefName); */ NS_IMETHOD ClearUserPref(const char *aPrefName) = 0; /** * Called to lock a specific preference. Locking a preference will cause the * preference service to always return the default value regardless of * whether there is a user set value or not. * * @param aPrefName The preference to be locked. * * @note * This method can be called on either a default or user branch but, in * effect, always operates on the default branch. * * @return NS_OK The preference was successfully locked. * @return Other The preference does not exist or an error occurred. * * @see unlockPref */ /* void lockPref (in string aPrefName); */ NS_IMETHOD LockPref(const char *aPrefName) = 0; /** * Called to check if a specific preference has a user value associated to * it. * * @param aPrefName The preference to be tested. * * @note * This method can be called on either a default or user branch but, in * effect, always operates on the user branch. * * @return boolean true The preference has a user set value. * false The preference only has a default value. */ /* boolean prefHasUserValue (in string aPrefName); */ NS_IMETHOD PrefHasUserValue(const char *aPrefName, PRBool *_retval) = 0; /** * Called to check if a specific preference is locked. If a preference is * locked calling its Get method will always return the default value. * * @param aPrefName The preference to be tested. * * @note * This method can be called on either a default or user branch but, in * effect, always operates on the default branch. * * @return boolean true The preference is locked. * false The preference is not locked. * * @see lockPref * @see unlockPref */ /* boolean prefIsLocked (in string aPrefName); */ NS_IMETHOD PrefIsLocked(const char *aPrefName, PRBool *_retval) = 0; /** * Called to unlock a specific preference. Unlocking a previously locked * preference allows the preference service to once again return the user set * value of the preference. * * @param aPrefName The preference to be unlocked.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -