Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
nsImapService Class Reference

#include <nsImapService.h>

Inheritance diagram for nsImapService:
Inheritance graph
[legend]
Collaboration diagram for nsImapService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsImapService ()
virtual ~nsImapService ()
void selectFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL)
void liteSelectFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL)
void fetchMessage (in nsIImapUrl aUrl, in nsImapState aImapAction, in nsIMsgFolder aImapMailFolder, in nsIImapMessageSink aImapMessageSink, in nsIMsgWindow aMsgWindow, in nsISupports aConsumer, in string aMessageIdentifierList, in boolean convertDataToText, in string additionalHeader, out nsIURI aOutURL)
void noop (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL)
void getHeaders (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL, in string aMessageIdentifierList, in boolean aMessageIdsAreUID)
nsIURI getBodyStart (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, in string aMessageIdentifierList, in long numBytes)
void expunge (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL)
nsIURI updateFolderStatus (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener)
void biff (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL, in unsigned long aUidHighWater)
void deleteMessages (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL, in string aMessageIdentifierList, in boolean aMessageIdsAreUID)
void deleteAllMessages (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL)
void addMessageFlags (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL, in string aMessageIdentifierList, in imapMessageFlagsType aFlags, in boolean aMessageIdsAreUID)
void subtractMessageFlags (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL, in string aMessageIdentifierList, in imapMessageFlagsType aFlags, in boolean aMessageIdsAreUID)
void setMessageFlags (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL, in string aMessageIdentifierList, in imapMessageFlagsType aFlags, in boolean aMessageIdsAreUID)
void discoverAllFolders (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL)
void discoverAllAndSubscribedFolders (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, out nsIURI aURL)
void discoverChildren (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aImapMailFolder, in nsIUrlListener aUrlListener, in string folderPath, out nsIURI aURL)
void onlineMessageCopy (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aSrcFolder, in string aMessageIds, in nsIMsgFolder aDstFolder, in boolean aIdsAreUids, in boolean aIsMove, in nsIUrlListener aUrlListener, out nsIURI aURL, in nsISupports aCopyState, in nsIMsgWindow aWindow)
void appendMessageFromFile (in nsIEventQueue aClientEventQueue, in nsIFileSpec aFileSpec, in nsIMsgFolder aDstFolder, in string aMessageId, in boolean idsAreUids, in boolean aInSelectedState, in nsIUrlListener aUrlListener, out nsIURI aURL, in nsISupports aCopyState, in nsIMsgWindow aMsgWindow)
void downloadMessagesForOffline (in string aMessageIds, in nsIMsgFolder aSrcFolder, in nsIUrlListener aListener, in nsIMsgWindow aMsgWindow)
nsIURI moveFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aSrcFolder, in nsIMsgFolder aDstFolder, in nsIUrlListener aUrlListener, in nsIMsgWindow msgWindow)
nsIURI renameLeaf (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aSrcFolder, in wstring aLeafName, in nsIUrlListener aUrlListener, in nsIMsgWindow msgWindow)
nsIURI deleteFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aFolder, in nsIUrlListener aUrlListener)
nsIURI createFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aParentFolder, in wstring aLeafName, in nsIUrlListener aUrlListener)
nsIURI listFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in nsIUrlListener aUrlListener)
nsIURI subscribeFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in wstring mailboxName, in nsIUrlListener aUrlListener)
nsIURI unsubscribeFolder (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in wstring mailboxName, in nsIUrlListener aUrlListener)
nsIURI ensureFolderExists (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aParentFolder, in wstring aLeafName, in nsIUrlListener aUrlListener)
nsIURI getFolderAdminUrl (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener)
nsIURI issueCommandOnMsgs (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in nsIMsgWindow aMsgWindow, in string aCommand, in string aMessageIdentifierList)
nsIURI fetchCustomMsgAttribute (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in nsIMsgWindow aMsgWindow, in string aAttribute, in string aMessageIdentifierList)
nsIURI storeCustomKeywords (in nsIEventQueue aClientEventQueue, in nsIMsgFolder aMailFolder, in nsIMsgWindow aMsgWindow, in string flagsToAdd, in string flagsToSubtract, in string aMessageIdentifierList)
void getListOfFoldersOnServer (in nsIImapIncomingServer aServer, in nsIMsgWindow aMsgWindow)
void getListOfFoldersWithPath (in nsIImapIncomingServer aServer, in nsIMsgWindow aMsgWindow, in string folderPath)
nsISupports playbackAllOfflineOperations (in nsIMsgWindow aMsgWindow, in nsIUrlListener aListener)
void downloadAllOffineImapFolders (in nsIMsgWindow aMsgWindow, in nsIUrlListener aListener)
void CopyMessage (in string aSrcURI, in nsIStreamListener aCopyListener, in boolean aMoveMessage, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL)
void CopyMessages (in nsMsgKeyArrayPtr keys, in nsIMsgFolder srcFolder, in nsIStreamListener aCopyListener, in boolean aMoveMessage, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL)
void DisplayMessage (in string aMessageURI, in nsISupports aDisplayConsumer, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, in string aCharsetOverride, out nsIURI aURL)
void openAttachment (in string aContentType, in string aFileName, in string aUrl, in string aMessageUri, in nsISupports aDisplayConsumer, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener)
void SaveMessageToDisk (in string aMessageURI, in nsIFileSpec aFile, in boolean aGenerateDummyEnvelope, in nsIUrlListener aUrlListener, out nsIURI aURL, in boolean canonicalLineEnding, in nsIMsgWindow aMsgWindow)
void GetUrlForUri (in string aMessageURI, out nsIURI aURL, in nsIMsgWindow aMsgWindow)
void DisplayMessageForPrinting (in string aMessageURI, in nsISupports aDisplayConsumer, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, out nsIURI aURL)
void Search (in nsIMsgSearchSession aSearchSession, in nsIMsgWindow aMsgWindow, in nsIMsgFolder aMsgFolder, in string aSearchUri)
nsIURI streamMessage (in string aMessageURI, in nsISupports aConsumer, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, in boolean aConvertData, in string aAdditionalHeader)
nsIMsgDBHdr messageURIToMsgHdr (in string uri)
 now the the message datasource is going away we need away to go from message uri to go nsIMsgDBHdr
nsIURI fetchMimePart (in nsIURI aURI, in string aMessageUri, in nsISupports aDisplayConsumer, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener)
nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI)
 Makes a URI object that is suitable for loading by this protocol, where the URI string is given as an UTF-8 string.
nsIChannel newChannel (in nsIURI aURI)
 Constructs a new channel from the given URI for this protocol handler.
boolean allowPort (in long port, in string scheme)
 Allows a protocol to override blacklisted ports.
long getDefaultServerPort (in boolean isSecure)
void handleContent (in string aContentType, in nsIInterfaceRequestor aWindowContext, in nsIRequest aRequest)
 Tells the content handler to take over handling the content.

Public Attributes

readonly attribute nsICacheSession cacheSession
readonly attribute ACString scheme
 The scheme of this protocol (e.g., "file").
readonly attribute long defaultPort
 The default port is the port that this protocol normally uses.
readonly attribute unsigned long protocolFlags
 Returns the protocol specific flags (see flag definitions below).
const unsigned long URI_STD = 0
 standard full URI with authority component and concept of relative URIs (http, ftp, ...)
const unsigned long URI_NORELATIVE = (1<<0)
 no concept of relative URIs (about, javascript, finger, ...)
const unsigned long URI_NOAUTH = (1<<1)
 no authority component (file, ...)
const unsigned long ALLOWS_PROXY = (1<<2)
 This protocol handler can be proxied via a proxy (socks or http) (e.g., irc, smtp, http, etc.).
const unsigned long ALLOWS_PROXY_HTTP = (1<<3)
 This protocol handler can be proxied using a http proxy (e.g., http, ftp, etc.).
attribute nsIFileSpec defaultLocalPath
 the default path to store local data for this type of server.
readonly attribute nsIIDPtr serverIID
 the IID of the protocol-specific interface for this server usually used from JS to dynamically get server-specific attributes
readonly attribute boolean requiresUsername
 does this server type require a username? for instance, news does not but IMAP/POP do
readonly attribute boolean preflightPrettyNameWithEmailAddress
 if the pretty name of the server should just be the e-mail address.
readonly attribute boolean canDelete
 can this type of server be removed from the account manager? for instance, local mail is not removable
readonly attribute boolean canLoginAtStartUp
 can this type of server log in at startup?
readonly attribute boolean canDuplicate
 can you duplicate this server? for instance, local mail is unique and should not be duplicated.
readonly attribute boolean canGetMessages
 An attribute that tell us whether on not we can get messages for the given server type this is poorly named right now.
readonly attribute boolean canGetIncomingMessages
 do messages arrive for this server if they do, we can use our junk controls on it.
readonly attribute boolean defaultDoBiff
 do biff by default?
readonly attribute boolean showComposeMsgLink
 do we need to show compose message link in the AccountCentral page ?
readonly attribute boolean needToBuildSpecialFolderURIs
 do we need to build special folder URIs ? In case of IMAP, special folders like 'Sent', 'Drafts' and 'Templates' are not created unless needed.
readonly attribute boolean specialFoldersDeletionAllowed
 do we allow special folder deletion ?

Protected Member Functions

PRUnichar GetHierarchyDelimiter (nsIMsgFolder *aMsgFolder)
nsresult GetFolderName (nsIMsgFolder *aImapFolder, char **folderName)
nsresult CreateStartOfImapUrl (const char *aImapURI, nsIImapUrl **imapUrl, nsIMsgFolder *aImapFolder, nsIUrlListener *aUrlListener, nsCString &urlSpec, PRUnichar &hierarchyDelimiter)
nsresult GetImapConnectionAndLoadUrl (nsIEventQueue *aClientEventQueue, nsIImapUrl *aImapUrl, nsISupports *aConsumer, nsIURI **aURL)
nsresult SetImapUrlSink (nsIMsgFolder *aMsgFolder, nsIImapUrl *aImapUrl)
nsresult FetchMimePart (nsIImapUrl *aImapUrl, nsImapAction aImapAction, nsIMsgFolder *aImapMailFolder, nsIImapMessageSink *aImapMessage, nsIURI **aURL, nsISupports *aDisplayConsumer, const char *messageIdentifierList, const char *mimePart)
nsresult FolderCommand (nsIEventQueue *clientEventQueue, nsIMsgFolder *imapMailFolder, nsIUrlListener *urlListener, const char *command, nsImapAction imapAction, nsIURI **url)
nsresult ChangeFolderSubscription (nsIEventQueue *eventQueue, nsIMsgFolder *folder, const PRUnichar *folderName, const char *command, nsIUrlListener *urlListener, nsIURI **url)
nsresult DiddleFlags (nsIEventQueue *aClientEventQueue, nsIMsgFolder *aImapMailFolder, nsIUrlListener *aUrlListener, nsIURI **aURL, const char *messageIdentifierList, const char *howToDiddle, imapMessageFlagsType flags, PRBool messageIdsAreUID)
nsresult OfflineAppendFromFile (nsIFileSpec *aFileSpec, nsIURI *aUrl, nsIMsgFolder *aDstFolder, const char *messageId, PRBool inSelectedState, nsIUrlListener *aListener, nsIURI **aURL, nsISupports *aCopyState)
nsresult GetServerFromUrl (nsIImapUrl *aImapUrl, nsIMsgIncomingServer **aServer)
nsresult DecomposeImapURI (const char *aMessageURI, nsIMsgFolder **aFolder, char **msgKey)
nsresult DecomposeImapURI (const char *aMessageURI, nsIMsgFolder **aFolder, nsMsgKey *msgKey)

Protected Attributes

PRBool mPrintingOperation
nsCOMPtr< nsICacheSessionmCacheSession

Detailed Description

Definition at line 58 of file nsImapService.h.


Constructor & Destructor Documentation

Definition at line 146 of file nsImapService.cpp.

{
}

Member Function Documentation

void nsIImapService::addMessageFlags ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in string  aMessageIdentifierList,
in imapMessageFlagsType  aFlags,
in boolean  aMessageIdsAreUID 
) [inherited]
boolean nsIProtocolHandler::allowPort ( in long  port,
in string  scheme 
) [inherited]

Allows a protocol to override blacklisted ports.

This method will be called when there is an attempt to connect to a port that is blacklisted. For example, for most protocols, port 25 (Simple Mail Transfer) is banned. When a URI containing this "known-to-do-bad-things" port number is encountered, this function will be called to ask if the protocol handler wants to override the ban.

void nsIImapService::appendMessageFromFile ( in nsIEventQueue  aClientEventQueue,
in nsIFileSpec  aFileSpec,
in nsIMsgFolder  aDstFolder,
in string  aMessageId,
in boolean  idsAreUids,
in boolean  aInSelectedState,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in nsISupports  aCopyState,
in nsIMsgWindow  aMsgWindow 
) [inherited]
void nsIImapService::biff ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in unsigned long  aUidHighWater 
) [inherited]
nsresult nsImapService::ChangeFolderSubscription ( nsIEventQueue eventQueue,
nsIMsgFolder folder,
const PRUnichar folderName,
const char *  command,
nsIUrlListener urlListener,
nsIURI **  url 
) [protected]

Definition at line 3030 of file nsImapService.cpp.

{
    NS_ENSURE_ARG_POINTER(eventQueue);
    NS_ENSURE_ARG_POINTER(folder);
    NS_ENSURE_ARG_POINTER(folderName);
    
    nsCOMPtr<nsIImapUrl> imapUrl;
    nsCAutoString urlSpec;
    nsresult rv;
    PRUnichar hierarchySeparator = GetHierarchyDelimiter(folder);
    rv = CreateStartOfImapUrl(nsnull, getter_AddRefs(imapUrl), folder, urlListener,
                              urlSpec, hierarchySeparator);
    if (NS_SUCCEEDED(rv) && imapUrl)
    {
        rv = SetImapUrlSink(folder, imapUrl);
        if (NS_SUCCEEDED(rv))
        {
            nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
            urlSpec.Append(command);
            urlSpec.Append(char(hierarchySeparator));
            nsCAutoString utfFolderName;
            rv = CopyUTF16toMUTF7(nsDependentString(folderName), utfFolderName);
            NS_ENSURE_SUCCESS(rv, rv);
            char* escapedFolderName = nsEscape(utfFolderName.get(), url_Path);
            urlSpec.Append(escapedFolderName);
            nsCRT::free(escapedFolderName);
            rv = uri->SetSpec(urlSpec);
            if (NS_SUCCEEDED(rv))
                rv = GetImapConnectionAndLoadUrl(eventQueue, imapUrl,
                                                 nsnull, url);
        }
    }
    return rv;
}

Here is the call graph for this function:

void nsIMsgMessageService::CopyMessage ( in string  aSrcURI,
in nsIStreamListener  aCopyListener,
in boolean  aMoveMessage,
in nsIUrlListener  aUrlListener,
in nsIMsgWindow  aMsgWindow,
out nsIURI  aURL 
) [inherited]
void nsIMsgMessageService::CopyMessages ( in nsMsgKeyArrayPtr  keys,
in nsIMsgFolder  srcFolder,
in nsIStreamListener  aCopyListener,
in boolean  aMoveMessage,
in nsIUrlListener  aUrlListener,
in nsIMsgWindow  aMsgWindow,
out nsIURI  aURL 
) [inherited]
nsIURI nsIImapService::createFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aParentFolder,
in wstring  aLeafName,
in nsIUrlListener  aUrlListener 
) [inherited]
nsresult nsImapService::CreateStartOfImapUrl ( const char *  aImapURI,
nsIImapUrl **  imapUrl,
nsIMsgFolder aImapFolder,
nsIUrlListener aUrlListener,
nsCString urlSpec,
PRUnichar hierarchyDelimiter 
) [protected]

Definition at line 1182 of file nsImapService.cpp.

{
  nsresult rv = NS_OK;
  char *hostname = nsnull;
  nsXPIDLCString username;
  nsXPIDLCString escapedUsername;
  
  rv = aImapMailFolder->GetHostname(&hostname);
  if (NS_FAILED(rv)) return rv;
  rv = aImapMailFolder->GetUsername(getter_Copies(username));
  if (NS_FAILED(rv))
  {
    PR_Free(hostname);
    return rv;
  }
  
  if (((const char*)username) && username[0])
    *((char **)getter_Copies(escapedUsername)) = nsEscape(username, url_XAlphas);
  
  PRInt32 port = IMAP_PORT;
  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = aImapMailFolder->GetServer(getter_AddRefs(server));
  if (NS_SUCCEEDED(rv)) 
  {
    server->GetPort(&port);
    if (port == -1 || port == 0) port = IMAP_PORT;
  }
  
  // now we need to create an imap url to load into the connection. The url
  // needs to represent a select folder action. 
  rv = CallCreateInstance(kImapUrlCID, imapUrl);
  if (NS_SUCCEEDED(rv) && *imapUrl)
  {
    nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(*imapUrl, &rv);
    if (NS_SUCCEEDED(rv) && mailnewsUrl && aUrlListener)
      mailnewsUrl->RegisterListener(aUrlListener);
    nsCOMPtr<nsIMsgMessageUrl> msgurl(do_QueryInterface(*imapUrl));
    (*imapUrl)->SetExternalLinkUrl(PR_FALSE);
    msgurl->SetUri(aImapURI);
    
    urlSpec = "imap://";
    urlSpec.Append((const char *) escapedUsername);
    urlSpec.Append('@');
    urlSpec.Append(hostname);
    urlSpec.Append(':');
    
    urlSpec.AppendInt(port);
    
    // *** jefft - force to parse the urlSpec in order to search for
    // the correct incoming server
    // mscott - this cast to a char * is okay...there's a bug in the XPIDL
    // compiler that is preventing in string parameters from showing up as
    // const char *. hopefully they will fix it soon.
    rv = mailnewsUrl->SetSpec(urlSpec);
    
    hierarchyDelimiter = kOnlineHierarchySeparatorUnknown;
    nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(aImapMailFolder);
    if (imapFolder)
      imapFolder->GetHierarchyDelimiter(&hierarchyDelimiter);
  }
  
  PR_Free(hostname);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsImapService::DecomposeImapURI ( const char *  aMessageURI,
nsIMsgFolder **  aFolder,
char **  msgKey 
) [protected]

Definition at line 901 of file nsImapService.cpp.

{
    nsMsgKey msgKey;
    nsresult rv;
    rv = DecomposeImapURI(aMessageURI, aFolder, &msgKey);
    NS_ENSURE_SUCCESS(rv,rv);

    if (msgKey) {
      nsCAutoString messageIdString;
      messageIdString.AppendInt(msgKey);
      *aMsgKey = ToNewCString(messageIdString);
    }

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsImapService::DecomposeImapURI ( const char *  aMessageURI,
nsIMsgFolder **  aFolder,
nsMsgKey msgKey 
) [protected]

Definition at line 876 of file nsImapService.cpp.

{
    NS_ENSURE_ARG_POINTER(aMessageURI);
    NS_ENSURE_ARG_POINTER(aFolder);
    NS_ENSURE_ARG_POINTER(aMsgKey);

    nsresult rv = NS_OK;
    nsCAutoString folderURI;
    rv = nsParseImapMessageURI(aMessageURI, folderURI, aMsgKey, nsnull);
    NS_ENSURE_SUCCESS(rv,rv);

    nsCOMPtr <nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1",&rv);
    NS_ENSURE_SUCCESS(rv,rv);

    nsCOMPtr<nsIRDFResource> res;
    rv = rdf->GetResource(folderURI, getter_AddRefs(res));
    NS_ENSURE_SUCCESS(rv,rv);

    rv = res->QueryInterface(NS_GET_IID(nsIMsgFolder), (void **) aFolder);
    NS_ENSURE_SUCCESS(rv,rv);

    return NS_OK;
}

Here is the call graph for this function:

void nsIImapService::deleteAllMessages ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL 
) [inherited]
nsIURI nsIImapService::deleteFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aFolder,
in nsIUrlListener  aUrlListener 
) [inherited]
void nsIImapService::deleteMessages ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in string  aMessageIdentifierList,
in boolean  aMessageIdsAreUID 
) [inherited]
nsresult nsImapService::DiddleFlags ( nsIEventQueue aClientEventQueue,
nsIMsgFolder aImapMailFolder,
nsIUrlListener aUrlListener,
nsIURI **  aURL,
const char *  messageIdentifierList,
const char *  howToDiddle,
imapMessageFlagsType  flags,
PRBool  messageIdsAreUID 
) [protected]

Definition at line 1620 of file nsImapService.cpp.

{
  // create a protocol instance to handle the request.
  // NOTE: once we start working with multiple connections, this step will be much more complicated...but for now
  // just create a connection and process the request.
  NS_ASSERTION (aImapMailFolder && aClientEventQueue,
    "Oops ... null pointer");
  if (!aImapMailFolder || !aClientEventQueue)
    return NS_ERROR_NULL_POINTER;
  
  nsCOMPtr<nsIImapUrl> imapUrl;
  nsCAutoString urlSpec;
  
  PRUnichar hierarchySeparator = GetHierarchyDelimiter(aImapMailFolder);
  nsresult rv = CreateStartOfImapUrl(nsnull, getter_AddRefs(imapUrl),
    aImapMailFolder,
    aUrlListener, urlSpec, hierarchySeparator); 
  if (NS_SUCCEEDED(rv) && imapUrl)
  {
    
    rv = imapUrl->SetImapAction(nsIImapUrl::nsImapMsgFetch);
    rv = SetImapUrlSink(aImapMailFolder, imapUrl);
    
    if (NS_SUCCEEDED(rv))
    {
      nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
      
      urlSpec.Append('/');
      urlSpec.Append(howToDiddle);
      urlSpec.Append('>');
      urlSpec.Append(messageIdsAreUID ? uidString : sequenceString);
      urlSpec.Append(">");
      urlSpec.Append(char(hierarchySeparator));
      nsXPIDLCString folderName;
      GetFolderName(aImapMailFolder, getter_Copies(folderName));
      urlSpec.Append((const char *) folderName);
      urlSpec.Append(">");
      urlSpec.Append(messageIdentifierList);
      urlSpec.Append('>');
      urlSpec.AppendInt(flags);
      rv = uri->SetSpec(urlSpec);
      if (NS_SUCCEEDED(rv))
        rv = GetImapConnectionAndLoadUrl(aClientEventQueue, imapUrl,
        nsnull, aURL);
    }
  }
  return rv;
}

Here is the call graph for this function:

void nsIImapService::discoverAllAndSubscribedFolders ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL 
) [inherited]
void nsIImapService::discoverAllFolders ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
in nsIMsgWindow  aMsgWindow,
out nsIURI  aURL 
) [inherited]
void nsIImapService::discoverChildren ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
in string  folderPath,
out nsIURI  aURL 
) [inherited]
void nsIMsgMessageService::DisplayMessage ( in string  aMessageURI,
in nsISupports  aDisplayConsumer,
in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener,
in string  aCharsetOverride,
out nsIURI  aURL 
) [inherited]

Here is the caller graph for this function:

void nsIMsgMessageService::DisplayMessageForPrinting ( in string  aMessageURI,
in nsISupports  aDisplayConsumer,
in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL 
) [inherited]
void nsIImapService::downloadMessagesForOffline ( in string  aMessageIds,
in nsIMsgFolder  aSrcFolder,
in nsIUrlListener  aListener,
in nsIMsgWindow  aMsgWindow 
) [inherited]
nsIURI nsIImapService::ensureFolderExists ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aParentFolder,
in wstring  aLeafName,
in nsIUrlListener  aUrlListener 
) [inherited]
void nsIImapService::expunge ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL 
) [inherited]
nsIURI nsIImapService::fetchCustomMsgAttribute ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in nsIMsgWindow  aMsgWindow,
in string  aAttribute,
in string  aMessageIdentifierList 
) [inherited]
void nsIImapService::fetchMessage ( in nsIImapUrl  aUrl,
in nsImapState  aImapAction,
in nsIMsgFolder  aImapMailFolder,
in nsIImapMessageSink  aImapMessageSink,
in nsIMsgWindow  aMsgWindow,
in nsISupports  aConsumer,
in string  aMessageIdentifierList,
in boolean  convertDataToText,
in string  additionalHeader,
out nsIURI  aOutURL 
) [inherited]
nsresult nsImapService::FetchMimePart ( nsIImapUrl aImapUrl,
nsImapAction  aImapAction,
nsIMsgFolder aImapMailFolder,
nsIImapMessageSink aImapMessage,
nsIURI **  aURL,
nsISupports *  aDisplayConsumer,
const char *  messageIdentifierList,
const char *  mimePart 
) [protected]

Definition at line 409 of file nsImapService.cpp.

{
  nsresult rv = NS_OK;
  nsCOMPtr<nsIMsgFolder> folder;
  nsXPIDLCString msgKey;
  nsXPIDLCString mimePart;
  nsCAutoString      folderURI;
  nsMsgKey key;
  
  rv = DecomposeImapURI(aMessageURI, getter_AddRefs(folder), getter_Copies(msgKey));
  rv = nsParseImapMessageURI(aMessageURI, folderURI, &key, getter_Copies(mimePart));
  if (NS_SUCCEEDED(rv))
  {
    nsCOMPtr<nsIImapMessageSink> imapMessageSink(do_QueryInterface(folder, &rv));
    if (NS_SUCCEEDED(rv))
    {
      nsCOMPtr<nsIImapUrl> imapUrl = do_QueryInterface(aURI);
      nsCOMPtr<nsIMsgMailNewsUrl> msgurl (do_QueryInterface(aURI));
      
      msgurl->SetMsgWindow(aMsgWindow);
      msgurl->RegisterListener(aUrlListener);
      
      if (mimePart)
      {
        return FetchMimePart(imapUrl, nsIImapUrl::nsImapMsgFetch, folder, imapMessageSink,
          aURL, aDisplayConsumer, msgKey, mimePart);
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

nsIURI nsIMsgMessageFetchPartService::fetchMimePart ( in nsIURI  aURI,
in string  aMessageUri,
in nsISupports  aDisplayConsumer,
in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener 
) [inherited]
nsresult nsImapService::FolderCommand ( nsIEventQueue clientEventQueue,
nsIMsgFolder imapMailFolder,
nsIUrlListener urlListener,
const char *  command,
nsImapAction  imapAction,
nsIURI **  url 
) [protected]

Definition at line 1366 of file nsImapService.cpp.

{
  NS_ASSERTION (imapMailFolder && clientEventQueue,
    "Oops ... null pointer");
  if (!imapMailFolder || !clientEventQueue)
    return NS_ERROR_NULL_POINTER;
  
  nsCOMPtr<nsIImapUrl> imapUrl;
  nsCAutoString urlSpec;
  
  PRUnichar hierarchySeparator = GetHierarchyDelimiter(imapMailFolder);
  nsresult rv = CreateStartOfImapUrl(nsnull, getter_AddRefs(imapUrl),
    imapMailFolder,
    urlListener, urlSpec, hierarchySeparator);
  if (NS_SUCCEEDED(rv) && imapUrl)
  {
    
    rv = imapUrl->SetImapAction(imapAction);
    rv = SetImapUrlSink(imapMailFolder, imapUrl);
    nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
    
    if (NS_SUCCEEDED(rv))
    {
      urlSpec.Append(command);
      urlSpec.Append(char (hierarchySeparator));
      
      nsXPIDLCString folderName;
      
      GetFolderName(imapMailFolder, getter_Copies(folderName));
      urlSpec.Append((const char *) folderName);
      rv = uri->SetSpec(urlSpec);
      if (NS_SUCCEEDED(rv))
        rv = GetImapConnectionAndLoadUrl(clientEventQueue, imapUrl,
        nsnull, url);
    }
  }
  return rv;
}

Here is the call graph for this function:

nsIURI nsIImapService::getBodyStart ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
in string  aMessageIdentifierList,
in long  numBytes 
) [inherited]
nsIURI nsIImapService::getFolderAdminUrl ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener 
) [inherited]
nsresult nsImapService::GetFolderName ( nsIMsgFolder aImapFolder,
char **  folderName 
) [protected]

Definition at line 164 of file nsImapService.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIMsgImapMailFolder> aFolder(do_QueryInterface(aImapFolder, &rv));
  if (NS_FAILED(rv)) return rv;
  nsXPIDLCString onlineName;
  // online name is in imap utf-7 - leave it that way
  rv = aFolder->GetOnlineName(getter_Copies(onlineName));
  
  if (NS_FAILED(rv)) return rv;
  if (onlineName.IsEmpty())
  {
    char *uri = nsnull;
    rv = aImapFolder->GetURI(&uri);
    if (NS_FAILED(rv)) return rv;
    char * hostname = nsnull;
    rv = aImapFolder->GetHostname(&hostname);
    if (NS_FAILED(rv)) return rv;
    rv = nsImapURI2FullName(kImapRootURI, hostname, uri, getter_Copies(onlineName));
    PR_Free(uri);
    PR_Free(hostname);
  }
  // if the hierarchy delimiter is not '/', then we want to escape slashes;
  // otherwise, we do want to escape slashes.
  // we want to escape slashes and '^' first, otherwise, nsEscape will lose them
  PRBool escapeSlashes = (GetHierarchyDelimiter(aImapFolder) != (PRUnichar) '/');
  if (escapeSlashes && (const char *) onlineName)
  {
    char* escapedOnlineName;
    rv = nsImapUrl::EscapeSlashes((const char *) onlineName, &escapedOnlineName);
    if (NS_SUCCEEDED(rv))
      onlineName.Adopt(escapedOnlineName);
  }
  // need to escape everything else
  *folderName = nsEscape((const char *) onlineName, url_Path);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIImapService::getHeaders ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in string  aMessageIdentifierList,
in boolean  aMessageIdsAreUID 
) [inherited]

Definition at line 150 of file nsImapService.cpp.

{
  PRUnichar delimiter = '/';
  if (aMsgFolder)
  {
    nsCOMPtr<nsIMsgImapMailFolder> imapFolder = do_QueryInterface(aMsgFolder);
    if (imapFolder)
      imapFolder->GetHierarchyDelimiter(&delimiter);
  }
  return delimiter;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsImapService::GetImapConnectionAndLoadUrl ( nsIEventQueue aClientEventQueue,
nsIImapUrl aImapUrl,
nsISupports *  aConsumer,
nsIURI **  aURL 
) [protected]

Definition at line 2127 of file nsImapService.cpp.

{
  NS_ENSURE_ARG(aImapUrl);

  if (WeAreOffline())
  {
    nsImapAction imapAction;

    // the only thing we can do offline is fetch messages.
    // ### TODO - need to look at msg copy, save attachment, etc. when we
    // have offline message bodies.
    aImapUrl->GetImapAction(&imapAction);
    if (imapAction != nsIImapUrl::nsImapMsgFetch && imapAction != nsIImapUrl::nsImapSaveMessageToDisk)
      return NS_MSG_ERROR_OFFLINE;
  }

  nsresult rv = NS_OK;
  nsCOMPtr<nsIMsgIncomingServer> aMsgIncomingServer;
  nsCOMPtr<nsIMsgMailNewsUrl> msgUrl = do_QueryInterface(aImapUrl);
  rv = msgUrl->GetServer(getter_AddRefs(aMsgIncomingServer));
    
  if (aURL)
      NS_IF_ADDREF(*aURL = msgUrl);

  if (NS_SUCCEEDED(rv) && aMsgIncomingServer)
  {
    nsCOMPtr<nsIImapIncomingServer> aImapServer(do_QueryInterface(aMsgIncomingServer, &rv));
    if (NS_SUCCEEDED(rv) && aImapServer)
      rv = aImapServer->GetImapConnectionAndLoadUrl(aClientEventQueue,
                                                    aImapUrl, aConsumer);
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIImapService::getListOfFoldersWithPath ( in nsIImapIncomingServer  aServer,
in nsIMsgWindow  aMsgWindow,
in string  folderPath 
) [inherited]
nsresult nsImapService::GetServerFromUrl ( nsIImapUrl aImapUrl,
nsIMsgIncomingServer **  aServer 
) [protected]

Definition at line 2450 of file nsImapService.cpp.

{
    nsCAutoString userPass;
    nsCAutoString hostName;
    nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aImapUrl);
    nsresult rv;
    
    nsXPIDLCString folderName;

    // if we can't get a folder name out of the url then I think this is an error
    aImapUrl->CreateCanonicalSourceFolderPathString(getter_Copies(folderName));
    if (folderName.IsEmpty())
    {
      rv = mailnewsUrl->GetFileName(folderName);
      if (NS_FAILED(rv)) 
        return rv;
    }
    
    nsCOMPtr<nsIMsgAccountManager> accountManager = 
             do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
    if (NS_FAILED(rv)) 
      return rv;
    
    rv = accountManager->FindServerByURI(mailnewsUrl, PR_FALSE, aServer);

    // look for server with any user name, in case we're trying to subscribe
    // to a folder with some one else's user name like the following
    // "IMAP://userSharingFolder@server1/SharedFolderName"

    if (NS_FAILED(rv) || !aServer)
    {
      nsCAutoString turl;
      nsCOMPtr<nsIURL> url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
      if (NS_FAILED(rv)) return rv;

      mailnewsUrl->GetSpec(turl);
      rv = url->SetSpec(turl);
      if (NS_FAILED(rv)) return rv;

      url->SetUserPass(EmptyCString());
      rv = accountManager->FindServerByURI(url, PR_FALSE, aServer);
      if (*aServer)
        aImapUrl->SetExternalLinkUrl(PR_TRUE);
    }
    // if we can't extract the imap server from this url then give up!!!
    if (NS_FAILED(rv))
      return rv;
    NS_ENSURE_TRUE(*aServer, NS_ERROR_FAILURE);
    return rv;
}

Here is the call graph for this function:

void nsIMsgMessageService::GetUrlForUri ( in string  aMessageURI,
out nsIURI  aURL,
in nsIMsgWindow  aMsgWindow 
) [inherited]
void nsIContentHandler::handleContent ( in string  aContentType,
in nsIInterfaceRequestor  aWindowContext,
in nsIRequest  aRequest 
) [inherited]

Tells the content handler to take over handling the content.

If this function succeeds, the URI Loader will leave this request alone, ignoring progress notifications. Failure of this method will cause the request to be cancelled, unless the error code is NS_ERROR_WONT_HANDLE_CONTENT (see below).

Parameters:
aWindowContextWindow context, used to get things like the current nsIDOMWindow for this request. May be null.
aContentTypeThe content type of aRequest
aRequestA request whose content type is already known.
Exceptions:
NS_ERROR_WONT_HANDLE_CONTENTIndicates that this handler does not want to handle this content. A different way for handling this content should be tried.
nsIURI nsIImapService::issueCommandOnMsgs ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in nsIMsgWindow  aMsgWindow,
in string  aCommand,
in string  aMessageIdentifierList 
) [inherited]
nsIURI nsIImapService::listFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in nsIUrlListener  aUrlListener 
) [inherited]
void nsIImapService::liteSelectFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL 
) [inherited]

now the the message datasource is going away we need away to go from message uri to go nsIMsgDBHdr

nsIURI nsIImapService::moveFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aSrcFolder,
in nsIMsgFolder  aDstFolder,
in nsIUrlListener  aUrlListener,
in nsIMsgWindow  msgWindow 
) [inherited]

Constructs a new channel from the given URI for this protocol handler.

nsIURI nsIProtocolHandler::newURI ( in AUTF8String  aSpec,
in string  aOriginCharset,
in nsIURI  aBaseURI 
) [inherited]

Makes a URI object that is suitable for loading by this protocol, where the URI string is given as an UTF-8 string.

The caller may provide the charset from which the URI string originated, so that the URI string can be translated back to that charset (if necessary) before communicating with, for example, the origin server of the URI string. (Many servers do not support UTF-8 IRIs at the present time, so we must be careful about tracking the native charset of the origin server.)

Parameters:
aSpec- the URI string in UTF-8 encoding. depending on the protocol implementation, unicode character sequences may or may not be xx escaped.
aOriginCharset- the charset of the document from which this URI string originated. this corresponds to the charset that should be used when communicating this URI to an origin server, for example. if null, then UTF-8 encoding is assumed (i.e., no charset transformation from aSpec).
aBaseURI- if null, aSpec must specify an absolute URI. otherwise, aSpec may be resolved relative to aBaseURI, depending on the protocol. If the protocol has no concept of relative URI aBaseURI will simply be ignored.
void nsIImapService::noop ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL 
) [inherited]
nsresult nsImapService::OfflineAppendFromFile ( nsIFileSpec aFileSpec,
nsIURI aUrl,
nsIMsgFolder aDstFolder,
const char *  messageId,
PRBool  inSelectedState,
nsIUrlListener aListener,
nsIURI **  aURL,
nsISupports *  aCopyState 
) [protected]

Definition at line 1940 of file nsImapService.cpp.

{
  nsCOMPtr <nsIMsgDatabase> destDB;
  nsresult rv = aDstFolder->GetMsgDatabase(nsnull, getter_AddRefs(destDB));
  // ### might need to send some notifications instead of just returning

  if (NS_SUCCEEDED(rv) && destDB)
  {
    nsMsgKey fakeKey;
    destDB->GetNextFakeOfflineMsgKey(&fakeKey);
    
    nsCOMPtr <nsIMsgOfflineImapOperation> op;
    rv = destDB->GetOfflineOpForKey(fakeKey, PR_TRUE, getter_AddRefs(op));
    if (NS_SUCCEEDED(rv) && op)
    {
      nsXPIDLCString destFolderUri;

      aDstFolder->GetURI(getter_Copies(destFolderUri));
      op->SetOperation(nsIMsgOfflineImapOperation::kAppendDraft); // ### do we care if it's a template?
      op->SetDestinationFolderURI(destFolderUri);
      nsCOMPtr <nsIOutputStream> offlineStore;
      rv = aDstFolder->GetOfflineStoreOutputStream(getter_AddRefs(offlineStore));

      if (NS_SUCCEEDED(rv) && offlineStore)
      {
        PRInt64 curOfflineStorePos = 0;
        nsCOMPtr <nsISeekableStream> seekable = do_QueryInterface(offlineStore);
        if (seekable)
          seekable->Tell(&curOfflineStorePos);
        else
        {
          NS_ASSERTION(PR_FALSE, "needs to be a random store!");
          return NS_ERROR_FAILURE;
        }


        nsCOMPtr <nsIInputStream> inputStream;
        nsCOMPtr <nsIMsgParseMailMsgState> msgParser = do_CreateInstance(NS_PARSEMAILMSGSTATE_CONTRACTID, &rv);
        msgParser->SetMailDB(destDB);

        if (NS_SUCCEEDED(rv))
          rv = aFileSpec->GetInputStream(getter_AddRefs(inputStream));
        if (NS_SUCCEEDED(rv) && inputStream)
        {
          // now, copy the temp file to the offline store for the dest folder.
          PRInt32 inputBufferSize = 10240;
          nsMsgLineStreamBuffer *inputStreamBuffer = new nsMsgLineStreamBuffer(inputBufferSize, PR_TRUE /* allocate new lines */, PR_FALSE /* leave CRLFs on the returned string */);
          PRUint32 fileSize;
          aFileSpec->GetFileSize(&fileSize);
          PRUint32 bytesWritten;
          rv = NS_OK;
//            rv = inputStream->Read(inputBuffer, inputBufferSize, &bytesRead);
//            if (NS_SUCCEEDED(rv) && bytesRead > 0)
          msgParser->SetState(nsIMsgParseMailMsgState::ParseHeadersState);
          // set the env pos to fake key so the msg hdr will have that for a key
          msgParser->SetEnvelopePos(fakeKey);
          PRBool needMoreData = PR_FALSE;
          char * newLine = nsnull;
          PRUint32 numBytesInLine = 0;
          do
          {
            newLine = inputStreamBuffer->ReadNextLine(inputStream, numBytesInLine, needMoreData); 
            if (newLine)
            {
              msgParser->ParseAFolderLine(newLine, numBytesInLine);
              rv = offlineStore->Write(newLine, numBytesInLine, &bytesWritten);
              nsCRT::free(newLine);
            }
          }
          while (newLine);
          nsCOMPtr <nsIMsgDBHdr> fakeHdr;

          msgParser->FinishHeader();
          msgParser->GetNewMsgHdr(getter_AddRefs(fakeHdr));
          if (fakeHdr)
          {
            if (NS_SUCCEEDED(rv) && fakeHdr)
            {
              PRUint32 resultFlags;
              nsInt64 tellPos = curOfflineStorePos;
              fakeHdr->SetMessageOffset((PRUint32) tellPos);
              fakeHdr->OrFlags(MSG_FLAG_OFFLINE | MSG_FLAG_READ, &resultFlags);
              fakeHdr->SetOfflineMessageSize(fileSize);
              destDB->AddNewHdrToDB(fakeHdr, PR_TRUE /* notify */);
              aDstFolder->SetFlag(MSG_FOLDER_FLAG_OFFLINEEVENTS);
            }
          }
          // tell the listener we're done.
          inputStream = nsnull;
          aFileSpec->CloseStream();
          aListener->OnStopRunningUrl(aUrl, NS_OK);
          delete inputStreamBuffer;
        }
      }
    }
  }
          
         
  if (destDB)
    destDB->Close(PR_TRUE);
  return rv;
}

Here is the call graph for this function:

void nsIImapService::onlineMessageCopy ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aSrcFolder,
in string  aMessageIds,
in nsIMsgFolder  aDstFolder,
in boolean  aIdsAreUids,
in boolean  aIsMove,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in nsISupports  aCopyState,
in nsIMsgWindow  aWindow 
) [inherited]
void nsIMsgMessageService::openAttachment ( in string  aContentType,
in string  aFileName,
in string  aUrl,
in string  aMessageUri,
in nsISupports  aDisplayConsumer,
in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener 
) [inherited]
nsISupports nsIImapService::playbackAllOfflineOperations ( in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aListener 
) [inherited]
nsIURI nsIImapService::renameLeaf ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aSrcFolder,
in wstring  aLeafName,
in nsIUrlListener  aUrlListener,
in nsIMsgWindow  msgWindow 
) [inherited]
void nsIMsgMessageService::SaveMessageToDisk ( in string  aMessageURI,
in nsIFileSpec  aFile,
in boolean  aGenerateDummyEnvelope,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in boolean  canonicalLineEnding,
in nsIMsgWindow  aMsgWindow 
) [inherited]
void nsIMsgMessageService::Search ( in nsIMsgSearchSession  aSearchSession,
in nsIMsgWindow  aMsgWindow,
in nsIMsgFolder  aMsgFolder,
in string  aSearchUri 
) [inherited]
void nsIImapService::selectFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
in nsIMsgWindow  aMsgWindow,
out nsIURI  aURL 
) [inherited]
nsresult nsImapService::SetImapUrlSink ( nsIMsgFolder aMsgFolder,
nsIImapUrl aImapUrl 
) [protected]

Definition at line 1677 of file nsImapService.cpp.

{
  nsresult rv = NS_ERROR_NULL_POINTER;
  nsISupports* aInst = nsnull;
  nsCOMPtr <nsIMsgIncomingServer> incomingServer;
  nsCOMPtr <nsIImapServerSink> imapServerSink;

  NS_ASSERTION (aMsgFolder && aImapUrl, "Oops ... null pointers");
  if (!aMsgFolder || !aImapUrl)
      return rv;
    
  rv = aMsgFolder->GetServer(getter_AddRefs(incomingServer));
  if (NS_SUCCEEDED(rv) && incomingServer)
  {
    imapServerSink = do_QueryInterface(incomingServer);
    if (imapServerSink)
      aImapUrl->SetImapServerSink(imapServerSink);
  }
   
  rv = aMsgFolder->QueryInterface(NS_GET_IID(nsIImapMailFolderSink), 
                                 (void**)&aInst);
  if (NS_SUCCEEDED(rv) && aInst)
      aImapUrl->SetImapMailFolderSink((nsIImapMailFolderSink*) aInst);
  NS_IF_RELEASE (aInst);
  aInst = nsnull;
  
  rv = aMsgFolder->QueryInterface(NS_GET_IID(nsIImapMessageSink), 
                                 (void**)&aInst);
  if (NS_SUCCEEDED(rv) && aInst)
      aImapUrl->SetImapMessageSink((nsIImapMessageSink*) aInst);
  NS_IF_RELEASE (aInst);
  aInst = nsnull;
  
  nsCOMPtr <nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aImapUrl);
  mailnewsUrl->SetFolder(aMsgFolder);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIImapService::setMessageFlags ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in string  aMessageIdentifierList,
in imapMessageFlagsType  aFlags,
in boolean  aMessageIdsAreUID 
) [inherited]
nsIURI nsIImapService::storeCustomKeywords ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in nsIMsgWindow  aMsgWindow,
in string  flagsToAdd,
in string  flagsToSubtract,
in string  aMessageIdentifierList 
) [inherited]
nsIURI nsIMsgMessageService::streamMessage ( in string  aMessageURI,
in nsISupports  aConsumer,
in nsIMsgWindow  aMsgWindow,
in nsIUrlListener  aUrlListener,
in boolean  aConvertData,
in string  aAdditionalHeader 
) [inherited]
nsIURI nsIImapService::subscribeFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in wstring  mailboxName,
in nsIUrlListener  aUrlListener 
) [inherited]
void nsIImapService::subtractMessageFlags ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener,
out nsIURI  aURL,
in string  aMessageIdentifierList,
in imapMessageFlagsType  aFlags,
in boolean  aMessageIdsAreUID 
) [inherited]
nsIURI nsIImapService::unsubscribeFolder ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aMailFolder,
in wstring  mailboxName,
in nsIUrlListener  aUrlListener 
) [inherited]
nsIURI nsIImapService::updateFolderStatus ( in nsIEventQueue  aClientEventQueue,
in nsIMsgFolder  aImapMailFolder,
in nsIUrlListener  aUrlListener 
) [inherited]

Member Data Documentation

const unsigned long nsIProtocolHandler::ALLOWS_PROXY = (1<<2) [inherited]

This protocol handler can be proxied via a proxy (socks or http) (e.g., irc, smtp, http, etc.).

If the protocol supports transparent proxying, the handler should implement nsIProxiedProtocolHandler.

If it supports only HTTP proxying, then it need not support nsIProxiedProtocolHandler, but should instead set the ALLOWS_PROXY_HTTP flag (see below).

See also:
nsIProxiedProtocolHandler

Definition at line 148 of file nsIProtocolHandler.idl.

const unsigned long nsIProtocolHandler::ALLOWS_PROXY_HTTP = (1<<3) [inherited]

This protocol handler can be proxied using a http proxy (e.g., http, ftp, etc.).

nsIIOService::newChannelFromURI will feed URIs from this protocol handler to the HTTP protocol handler instead. This flag is ignored if ALLOWS_PROXY is not set.

Definition at line 156 of file nsIProtocolHandler.idl.

Definition at line 276 of file nsIImapService.idl.

can this type of server be removed from the account manager? for instance, local mail is not removable

Definition at line 80 of file nsIMsgProtocolInfo.idl.

can you duplicate this server? for instance, local mail is unique and should not be duplicated.

Definition at line 91 of file nsIMsgProtocolInfo.idl.

do messages arrive for this server if they do, we can use our junk controls on it.

Definition at line 114 of file nsIMsgProtocolInfo.idl.

An attribute that tell us whether on not we can get messages for the given server type this is poorly named right now.

it's really is there an inbox for this type? XXX todo, rename this.

Definition at line 108 of file nsIMsgProtocolInfo.idl.

can this type of server log in at startup?

Definition at line 85 of file nsIMsgProtocolInfo.idl.

do biff by default?

Definition at line 119 of file nsIMsgProtocolInfo.idl.

the default path to store local data for this type of server.

Each server is usually in a subdirectory below this

Definition at line 55 of file nsIMsgProtocolInfo.idl.

The default port is the port that this protocol normally uses.

If a port does not make sense for the protocol (e.g., "about:") then -1 will be returned.

Definition at line 61 of file nsIProtocolHandler.idl.

Definition at line 158 of file nsImapService.h.

Definition at line 155 of file nsImapService.h.

do we need to build special folder URIs ? In case of IMAP, special folders like 'Sent', 'Drafts' and 'Templates' are not created unless needed.

But, we do need to create folder URIs to reflect the choices in the UI in copies and folders settings panel.

Definition at line 132 of file nsIMsgProtocolInfo.idl.

if the pretty name of the server should just be the e-mail address.

Otherwise it usually ends up being something like "news on hostname"

Definition at line 74 of file nsIMsgProtocolInfo.idl.

readonly attribute unsigned long nsIProtocolHandler::protocolFlags [inherited]

Returns the protocol specific flags (see flag definitions below).

Definition at line 66 of file nsIProtocolHandler.idl.

does this server type require a username? for instance, news does not but IMAP/POP do

Definition at line 67 of file nsIMsgProtocolInfo.idl.

readonly attribute ACString nsIProtocolHandler::scheme [inherited]

The scheme of this protocol (e.g., "file").

Definition at line 54 of file nsIProtocolHandler.idl.

readonly attribute nsIIDPtr nsIMsgProtocolInfo::serverIID [inherited]

the IID of the protocol-specific interface for this server usually used from JS to dynamically get server-specific attributes

Definition at line 61 of file nsIMsgProtocolInfo.idl.

do we need to show compose message link in the AccountCentral page ?

Definition at line 124 of file nsIMsgProtocolInfo.idl.

do we allow special folder deletion ?

Definition at line 137 of file nsIMsgProtocolInfo.idl.

const unsigned long nsIProtocolHandler::URI_NOAUTH = (1<<1) [inherited]

no authority component (file, ...)

Definition at line 135 of file nsIProtocolHandler.idl.

const unsigned long nsIProtocolHandler::URI_NORELATIVE = (1<<0) [inherited]

no concept of relative URIs (about, javascript, finger, ...)

Definition at line 130 of file nsIProtocolHandler.idl.

const unsigned long nsIProtocolHandler::URI_STD = 0 [inherited]

standard full URI with authority component and concept of relative URIs (http, ftp, ...)

Definition at line 125 of file nsIProtocolHandler.idl.


The documentation for this class was generated from the following files: