add folder attribute to mailnews urls, part of extensibility hooks, r=cavin, sr=sspitzer 161226

This commit is contained in:
bienvenu%netscape.com 2002-08-13 01:29:49 +00:00
parent c25e74319b
commit ba3502ac84
6 changed files with 23 additions and 8 deletions

View File

@ -49,6 +49,7 @@ interface nsICacheEntryDescriptor;
interface nsICacheSession;
interface nsIMimeHeaders;
interface nsIStreamListener;
interface nsIMsgFolder;
[scriptable, uuid(6CFFCEB0-CB8C-11d2-8065-006008128C4E)]
interface nsIMsgMailNewsUrl : nsIURL {
@ -71,6 +72,7 @@ interface nsIMsgMailNewsUrl : nsIURL {
void GetUrlState(out boolean runningUrl);
readonly attribute nsIMsgIncomingServer server;
attribute nsIMsgFolder folder;
// the ownership model for msg feedback
attribute nsIMsgStatusFeedback statusFeedback;

View File

@ -996,3 +996,13 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetSaveAsListener(PRBool addDummyEnvelope,
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFolder(nsIMsgFolder * /* aFolder */)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgMailNewsUrl::GetFolder(nsIMsgFolder ** /* aFolder */)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@ -472,7 +472,7 @@ char * extractAttributeValue(const char * searchString, const char * attributeNa
// nsIMsgI18NUrl support
nsresult nsMailboxUrl::GetMsgFolder(nsIMsgFolder **msgFolder)
nsresult nsMailboxUrl::GetFolder(nsIMsgFolder **msgFolder)
{
// if we have a RDF URI, then try to get the folder for that URI and then ask the folder
// for it's charset....
@ -493,7 +493,7 @@ nsresult nsMailboxUrl::GetMsgFolder(nsIMsgFolder **msgFolder)
NS_IMETHODIMP nsMailboxUrl::GetFolderCharset(PRUnichar ** aCharacterSet)
{
nsCOMPtr<nsIMsgFolder> folder;
nsresult rv = GetMsgFolder(getter_AddRefs(folder));
nsresult rv = GetFolder(getter_AddRefs(folder));
NS_ENSURE_SUCCESS(rv,rv);
NS_ENSURE_TRUE(folder, NS_ERROR_FAILURE);
folder->GetCharset(aCharacterSet);
@ -503,7 +503,7 @@ NS_IMETHODIMP nsMailboxUrl::GetFolderCharset(PRUnichar ** aCharacterSet)
NS_IMETHODIMP nsMailboxUrl::GetFolderCharsetOverride(PRBool * aCharacterSetOverride)
{
nsCOMPtr<nsIMsgFolder> folder;
nsresult rv = GetMsgFolder(getter_AddRefs(folder));
nsresult rv = GetFolder(getter_AddRefs(folder));
NS_ENSURE_SUCCESS(rv,rv);
NS_ENSURE_TRUE(folder, NS_ERROR_FAILURE);
folder->GetCharsetOverride(aCharacterSetOverride);

View File

@ -71,6 +71,8 @@ public:
NS_IMETHOD GetNumMoveCopyMsgs(PRUint32 *numMsgs);
NS_IMPL_CLASS_GETSET(CurMoveCopyMsgIndex, PRUint32, m_curMsgIndex);
NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
// nsMailboxUrl
nsMailboxUrl();
virtual ~nsMailboxUrl();
@ -104,7 +106,6 @@ protected:
// for multiple msg move/copy
nsMsgKeyArray m_keys;
PRInt32 m_curMsgIndex;
nsresult GetMsgFolder(nsIMsgFolder **msgFolder);
// truncated message support
nsXPIDLCString m_originalSpec;

View File

@ -320,7 +320,7 @@ nsNntpUrl::SetOriginalSpec(const char *aSpec)
return NS_OK;
}
nsresult nsNntpUrl::GetMsgFolder(nsIMsgFolder **msgFolder)
NS_IMETHODIMP nsNntpUrl::GetFolder(nsIMsgFolder **msgFolder)
{
nsresult rv;
@ -345,7 +345,7 @@ NS_IMETHODIMP
nsNntpUrl::GetFolderCharset(PRUnichar **aCharacterSet)
{
nsCOMPtr<nsIMsgFolder> folder;
nsresult rv = GetMsgFolder(getter_AddRefs(folder));
nsresult rv = GetFolder(getter_AddRefs(folder));
// don't assert here. this can happen if there is no message folder
// like when we display a news://host/message-id url
if (NS_FAILED(rv)) return rv;
@ -359,7 +359,7 @@ nsNntpUrl::GetFolderCharset(PRUnichar **aCharacterSet)
NS_IMETHODIMP nsNntpUrl::GetFolderCharsetOverride(PRBool * aCharacterSetOverride)
{
nsCOMPtr<nsIMsgFolder> folder;
nsresult rv = GetMsgFolder(getter_AddRefs(folder));
nsresult rv = GetFolder(getter_AddRefs(folder));
NS_ENSURE_SUCCESS(rv,rv);
NS_ENSURE_TRUE(folder, NS_ERROR_FAILURE);
rv = folder->GetCharsetOverride(aCharacterSetOverride);

View File

@ -56,6 +56,9 @@ public:
NS_IMETHOD IsUrlType(PRUint32 type, PRBool *isType);
// nsIMsgFolder override
NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
// nsNntpUrl
nsNntpUrl();
virtual ~nsNntpUrl();
@ -64,7 +67,6 @@ public:
private:
virtual const char * GetUserName() { return nsnull; }
nsresult GetMsgFolder(nsIMsgFolder **msgFolder);
nsresult DetermineNewsAction();
nsINNTPNewsgroupPost *m_newsgroupPost;