Add getIntpref & setIntPref. Add wrapColumn pref
git-svn-id: svn://10.0.0.236/trunk@31623 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -100,6 +100,26 @@ nsMsgIdentity::setCharPref(const char *prefname,
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMsgIdentity::getIntPref(const char *prefname,
|
||||
PRInt32 *val)
|
||||
{
|
||||
char *prefName = getPrefName(m_identityKey, prefname);
|
||||
nsresult rv = m_prefs->GetIntPref(prefName, val);
|
||||
PR_Free(prefName);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMsgIdentity::setIntPref(const char *prefname,
|
||||
PRInt32 val)
|
||||
{
|
||||
char *prefName = getPrefName(m_identityKey, prefname);
|
||||
nsresult rv = m_prefs->SetIntPref(prefName, val);
|
||||
PR_Free(prefName);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMsgIdentity::SetKey(char* identityKey)
|
||||
{
|
||||
@@ -132,3 +152,4 @@ NS_IMPL_IDPREF_STR(SmtpHostname, "smtp_server");
|
||||
NS_IMPL_IDPREF_STR(SmtpUsername, "smtp_name");
|
||||
NS_IMPL_IDPREF_BOOL(AttachVCard, "attach_vcard");
|
||||
NS_IMPL_IDPREF_BOOL(AttachSignature, "attach_signature");
|
||||
NS_IMPL_IDPREF_INT(WrapColumn, "wrap_column");
|
||||
|
||||
@@ -38,6 +38,10 @@ public:
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/* attribute string key; */
|
||||
NS_IMETHOD GetKey(char * *aKey);
|
||||
NS_IMETHOD SetKey(char * aKey);
|
||||
|
||||
/* attribute string identityName; */
|
||||
NS_IMETHOD GetIdentityName(char * *aIdentityName);
|
||||
NS_IMETHOD SetIdentityName(char * aIdentityName);
|
||||
@@ -66,6 +70,10 @@ public:
|
||||
NS_IMETHOD GetAttachSignature(PRBool *aAttachSignature);
|
||||
NS_IMETHOD SetAttachSignature(PRBool aAttachSignature);
|
||||
|
||||
/* attribute attachVCard; */
|
||||
NS_IMETHOD GetAttachVCard(PRBool *attachVCard);
|
||||
NS_IMETHOD SetAttachVCard(PRBool attachVCard);
|
||||
|
||||
/* attribute nsIMsgSignature signature; */
|
||||
NS_IMETHOD GetSignature(nsIMsgSignature * *aSignature);
|
||||
NS_IMETHOD SetSignature(nsIMsgSignature * aSignature);
|
||||
@@ -74,10 +82,6 @@ public:
|
||||
NS_IMETHOD GetVCard(nsIMsgVCard * *aVCard);
|
||||
NS_IMETHOD SetVCard(nsIMsgVCard * aVCard);
|
||||
|
||||
/* attribute attachVCard; */
|
||||
NS_IMETHOD GetAttachVCard(PRBool *attachVCard);
|
||||
NS_IMETHOD SetAttachVCard(PRBool attachVCard);
|
||||
|
||||
/* attribute string smtpHostname; */
|
||||
NS_IMETHOD GetSmtpHostname(char * *aSmtpHostname);
|
||||
NS_IMETHOD SetSmtpHostname(char * aSmtpHostname);
|
||||
@@ -86,9 +90,9 @@ public:
|
||||
NS_IMETHOD GetSmtpUsername(char * *aSmtpUsername);
|
||||
NS_IMETHOD SetSmtpUsername(char * aSmtpUsername);
|
||||
|
||||
/* attribute string key; */
|
||||
NS_IMETHOD GetKey(char * *aKey);
|
||||
NS_IMETHOD SetKey(char * aKey);
|
||||
/* attribute long WrapColumn; */
|
||||
NS_IMETHOD GetWrapColumn(PRInt32 *aWrapColumn);
|
||||
NS_IMETHOD SetWrapColumn(PRInt32 aWrapColumn);
|
||||
|
||||
private:
|
||||
nsIMsgSignature* m_signature;
|
||||
@@ -102,7 +106,9 @@ protected:
|
||||
nsresult setCharPref(const char *pref, char *);
|
||||
nsresult getBoolPref(const char *pref, PRBool *);
|
||||
nsresult setBoolPref(const char *pref, PRBool);
|
||||
|
||||
nsresult getIntPref(const char *pref, PRInt32 *);
|
||||
nsresult setIntPref(const char *pref, PRInt32);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -130,5 +136,17 @@ nsMsgIdentity::Set##_postfix(PRBool value) \
|
||||
return setBoolPref(_prefname, value); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_IDPREF_INT(_postfix, _prefname) \
|
||||
NS_IMETHODIMP \
|
||||
nsMsgIdentity::Get##_postfix(PRInt32 *retval) \
|
||||
{ \
|
||||
return getIntPref(_prefname, retval); \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
nsMsgIdentity::Set##_postfix(PRInt32 value) \
|
||||
{ \
|
||||
return setIntPref(_prefname, value); \
|
||||
}
|
||||
|
||||
|
||||
#endif /* nsMsgIdentity_h___ */
|
||||
|
||||
Reference in New Issue
Block a user