Bug 663036 part.2 Implement GetComplex() and SetComplex() in Preferences r=roc

This commit is contained in:
Masayuki Nakano 2011-06-12 11:30:15 +09:00
Родитель 5ad968ec2f
Коммит 82aeafcc35
2 изменённых файлов: 23 добавлений и 0 удалений

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

@ -174,6 +174,9 @@ public:
static nsresult GetLocalizedCString(const char* aPref, nsACString* aResult);
static nsresult GetLocalizedString(const char* aPref, nsAString* aResult);
static nsresult GetComplex(const char* aPref, const nsIID &aType,
void** aResult);
/**
* Sets various type pref values.
*/
@ -188,6 +191,9 @@ public:
static nsresult SetString(const char* aPref, const PRUnichar* aValue);
static nsresult SetString(const char* aPref, const nsAString &aValue);
static nsresult SetComplex(const char* aPref, const nsIID &aType,
nsISupports* aValue);
/**
* Clears user set pref.
*/

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

@ -1252,6 +1252,14 @@ Preferences::GetLocalizedString(const char* aPref, nsAString* aResult)
return rv;
}
// static
nsresult
Preferences::GetComplex(const char* aPref, const nsIID &aType, void** aResult)
{
NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
return sPreferences->mRootBranch->GetComplexValue(aPref, aType, aResult);
}
// static
nsresult
Preferences::SetCString(const char* aPref, const char* aValue)
@ -1299,6 +1307,15 @@ Preferences::SetInt(const char* aPref, PRInt32 aValue)
return sPreferences->mRootBranch->SetIntPref(aPref, aValue);
}
// static
nsresult
Preferences::SetComplex(const char* aPref, const nsIID &aType,
nsISupports* aValue)
{
NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
return sPreferences->mRootBranch->SetComplexValue(aPref, aType, aValue);
}
// static
nsresult
Preferences::ClearUser(const char* aPref)