зеркало из https://github.com/mozilla/gecko-dev.git
Added nsIPref::GetPrefType.
This commit is contained in:
Родитель
1378f725e1
Коммит
ac58d4a6f3
|
@ -42,6 +42,22 @@ interface nsIFileSpec;
|
|||
|
||||
[scriptable, uuid(a22ad7b0-ca86-11d1-a9a4-00805f8a7ac4)]
|
||||
interface nsIPref : nsISupports {
|
||||
%{C++
|
||||
/* Pref types - see GetPrefType() */
|
||||
enum {
|
||||
ePrefInvalid = 0,
|
||||
ePrefLocked = 1,
|
||||
ePrefUserset = 2,
|
||||
ePrefConfig = 4,
|
||||
ePreRemote = 8,
|
||||
ePrefLilocal = 16,
|
||||
ePrefString = 32,
|
||||
ePrefInt = 64,
|
||||
ePrefBool = 128,
|
||||
ePrefValuetypeMask = (ePrefString | ePrefInt | ePrefBool)
|
||||
};
|
||||
%}
|
||||
|
||||
// Initialize/shutdown
|
||||
void StartUp();
|
||||
void ReadUserPrefs();
|
||||
|
@ -70,6 +86,7 @@ interface nsIPref : nsISupports {
|
|||
[noscript] readonly attribute JSObject prefConfigObject;
|
||||
|
||||
/* Getters */
|
||||
long GetPrefType(in string pref);
|
||||
long GetIntPref(in string pref);
|
||||
boolean GetBoolPref(in string pref);
|
||||
[noscript] void GetBinaryPref(in string pref, in voidStar buf, inout long buf_length);
|
||||
|
|
|
@ -501,6 +501,16 @@ NS_IMETHODIMP nsPref::GetPrefConfigObject(JSObject **js_object)
|
|||
/*
|
||||
* Getters
|
||||
*/
|
||||
NS_IMETHODIMP nsPref::GetPrefType(const char *pref, PRInt32 * return_type)
|
||||
{
|
||||
// XXX The current implementation returns the raw type - the
|
||||
// enums defining the types have been duplicated. If the old
|
||||
// types don't all make sense in the context of the new API,
|
||||
// we might need to do some translation.
|
||||
|
||||
*return_type = PREF_GetPrefType(pref);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPref::GetIntPref(const char *pref, PRInt32 * return_int)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче