mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
add getters and setters for new imap sink: imap log.
This commit is contained in:
parent
926ff30143
commit
2dd1e97083
@ -53,7 +53,8 @@ nsImapUrl::nsImapUrl()
|
||||
m_port = IMAP_PORT;
|
||||
m_spec = nsnull;
|
||||
m_search = nsnull;
|
||||
|
||||
|
||||
m_imapLog = nsnull;
|
||||
m_runningUrl = PR_FALSE;
|
||||
|
||||
nsComponentManager::CreateInstance(kUrlListenerManagerCID, nsnull, nsIUrlListenerManager::GetIID(),
|
||||
@ -62,6 +63,7 @@ nsImapUrl::nsImapUrl()
|
||||
|
||||
nsImapUrl::~nsImapUrl()
|
||||
{
|
||||
NS_IF_RELEASE(m_imapLog);
|
||||
NS_IF_RELEASE(m_urlListeners);
|
||||
PR_FREEIF(m_errorMessage);
|
||||
|
||||
@ -122,33 +124,30 @@ NS_IMETHODIMP nsImapUrl::QueryInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
// Begin nsIImapUrl specific support
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHODIMP nsImapUrl::SetErrorMessage (char * errorMessage)
|
||||
NS_IMETHODIMP nsImapUrl::GetImapLog(nsIImapLog ** aImapLog)
|
||||
{
|
||||
NS_LOCK_INSTANCE();
|
||||
if (errorMessage)
|
||||
if (aImapLog)
|
||||
{
|
||||
PR_FREEIF(m_errorMessage);
|
||||
m_errorMessage = errorMessage;
|
||||
*aImapLog = m_imapLog;
|
||||
NS_IF_ADDREF(m_imapLog);
|
||||
}
|
||||
NS_UNLOCK_INSTANCE();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// caller must free using PR_FREE
|
||||
NS_IMETHODIMP nsImapUrl::GetErrorMessage (char ** errorMessage) const
|
||||
NS_IMETHODIMP nsImapUrl::SetImapLog(nsIImapLog * aImapLog)
|
||||
{
|
||||
NS_LOCK_INSTANCE();
|
||||
if (errorMessage)
|
||||
if (aImapLog)
|
||||
{
|
||||
if (m_errorMessage)
|
||||
*errorMessage = nsCRT::strdup(m_errorMessage);
|
||||
else
|
||||
*errorMessage = nsnull;
|
||||
NS_IF_RELEASE(m_imapLog);
|
||||
m_imapLog = aImapLog;
|
||||
NS_ADDREF(m_imapLog);
|
||||
}
|
||||
NS_UNLOCK_INSTANCE();
|
||||
return NS_OK;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// End nsIImapUrl specific support
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -200,6 +199,33 @@ NS_IMETHODIMP nsImapUrl::SetUrlState(PRBool aRunningUrl, nsresult aExitCode)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapUrl::SetErrorMessage (char * errorMessage)
|
||||
{
|
||||
NS_LOCK_INSTANCE();
|
||||
if (errorMessage)
|
||||
{
|
||||
PR_FREEIF(m_errorMessage);
|
||||
m_errorMessage = errorMessage;
|
||||
}
|
||||
NS_UNLOCK_INSTANCE();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// caller must free using PR_FREE
|
||||
NS_IMETHODIMP nsImapUrl::GetErrorMessage (char ** errorMessage) const
|
||||
{
|
||||
NS_LOCK_INSTANCE();
|
||||
if (errorMessage)
|
||||
{
|
||||
if (m_errorMessage)
|
||||
*errorMessage = nsCRT::strdup(m_errorMessage);
|
||||
else
|
||||
*errorMessage = nsnull;
|
||||
}
|
||||
NS_UNLOCK_INSTANCE();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// Begin nsINetlibURL support
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -43,6 +43,8 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// we support the nsIImapUrl interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NS_IMETHOD GetImapLog(nsIImapLog ** aImapLog) = 0;
|
||||
NS_IMETHOD SetImapLog(nsIImapLog * aImapLog) = 0;
|
||||
|
||||
NS_IMPL_CLASS_GETSET(ImapAction, nsImapAction, m_imapAction);
|
||||
|
||||
@ -103,6 +105,7 @@ protected:
|
||||
PRBool m_runningUrl;
|
||||
|
||||
nsImapAction m_imapAction;
|
||||
nsIImapLog * m_imapLog;
|
||||
};
|
||||
|
||||
#endif /* nsImapUrl_h___ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user