This commit is contained in:
vidur%netscape.com 1999-08-27 06:05:04 +00:00
Родитель 1378f725e1
Коммит ac58d4a6f3
2 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -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)
{