diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/local/public | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | comm/mailnews/local/public/moz.build | 26 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsILocalMailIncomingServer.idl | 23 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIMailboxService.idl | 34 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIMailboxUrl.idl | 58 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIMsgLocalMailFolder.idl | 134 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIMsgParseMailMsgState.idl | 46 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsINewsBlogFeedDownloader.idl | 32 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsINoIncomingServer.idl | 16 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsINoneService.idl | 11 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIPop3IncomingServer.idl | 33 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIPop3Protocol.idl | 23 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIPop3Service.idl | 128 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIPop3Sink.idl | 42 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIPop3URL.idl | 19 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIRssIncomingServer.idl | 16 | ||||
-rw-r--r-- | comm/mailnews/local/public/nsIRssService.idl | 10 |
16 files changed, 651 insertions, 0 deletions
diff --git a/comm/mailnews/local/public/moz.build b/comm/mailnews/local/public/moz.build new file mode 100644 index 0000000000..962078a7af --- /dev/null +++ b/comm/mailnews/local/public/moz.build @@ -0,0 +1,26 @@ +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +XPIDL_SOURCES += [ + "nsILocalMailIncomingServer.idl", + "nsIMailboxService.idl", + "nsIMailboxUrl.idl", + "nsIMsgLocalMailFolder.idl", + "nsIMsgParseMailMsgState.idl", + "nsINewsBlogFeedDownloader.idl", + "nsINoIncomingServer.idl", + "nsINoneService.idl", + "nsIPop3IncomingServer.idl", + "nsIPop3Protocol.idl", + "nsIPop3Service.idl", + "nsIPop3Sink.idl", + "nsIPop3URL.idl", + "nsIRssIncomingServer.idl", + "nsIRssService.idl", +] + +XPIDL_MODULE = "msglocal" + +EXPORTS += [] diff --git a/comm/mailnews/local/public/nsILocalMailIncomingServer.idl b/comm/mailnews/local/public/nsILocalMailIncomingServer.idl new file mode 100644 index 0000000000..11bd5543b6 --- /dev/null +++ b/comm/mailnews/local/public/nsILocalMailIncomingServer.idl @@ -0,0 +1,23 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIURI; +interface nsIMsgWindow; +interface nsIUrlListener; +interface nsIMsgFolder; + +[scriptable, uuid(f465a3ee-5b29-4da6-8b2e-d764bcba468e)] +interface nsILocalMailIncomingServer : nsISupports +{ + /// Create the necessary default folders that must always exist in an account (e.g. Inbox/Trash). + void createDefaultMailboxes(); + + /// Set special folder flags on the default folders. + void setFlagsOnDefaultMailboxes(); + + nsIURI getNewMail(in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, in nsIMsgFolder aInbox); +}; diff --git a/comm/mailnews/local/public/nsIMailboxService.idl b/comm/mailnews/local/public/nsIMailboxService.idl new file mode 100644 index 0000000000..13d998844d --- /dev/null +++ b/comm/mailnews/local/public/nsIMailboxService.idl @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIUrlListener.idl" + +interface nsIURI; +interface nsIStreamListener; +interface nsIMsgWindow; +interface nsIFile; + +[scriptable, uuid(809FCD02-B9EA-4DC0-84F0-3FBC55AE11F1)] +interface nsIMailboxService : nsISupports { + + /* + * All of these functions build mailbox urls and run them. If you want a + * handle on the running task, pass in a valid nsIURI ptr. You can later + * interrupt this action by asking the netlib service manager to interrupt + * the url you are given back. Remember to release aURL when you are done + * with it. Pass nullptr in for aURL if you don't care about the returned URL. + */ + + /* + * Pass in a file path for the mailbox you wish to parse. You also need to + * pass in a mailbox parser (the consumer). The url listener can be null + * if you have no interest in tracking the url. + */ + nsIURI ParseMailbox(in nsIMsgWindow aMsgWindow, in nsIFile aMailboxPath, + in nsIStreamListener aMailboxParser, + in nsIUrlListener aUrlListener); + +}; diff --git a/comm/mailnews/local/public/nsIMailboxUrl.idl b/comm/mailnews/local/public/nsIMailboxUrl.idl new file mode 100644 index 0000000000..85aefd7343 --- /dev/null +++ b/comm/mailnews/local/public/nsIMailboxUrl.idl @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "MailNewsTypes2.idl" + +interface nsIStreamListener; +interface nsIMsgDBHdr; + +typedef long nsMailboxAction; + +[scriptable, uuid(2ac72280-90f4-4d80-8af1-5e7a1997e2a8)] +interface nsIMailboxUrl : nsISupports { + + // Mailbox urls which parse a mailbox folder require a consumer of the + // stream which will represent the mailbox. This consumer is the mailbox + // parser. As data from the mailbox folder is read in, the data will be + // written to a stream and the consumer will be notified through + // nsIStreamListenter::OnDataAvailable that the stream has data + // available... + // mscott: I wonder if the caller should be allowed to create and set + // the stream they want the data written to as well? Hmm.... + + attribute nsIStreamListener mailboxParser; + + ///////////////////////////////////////////////////////////////////////// + // Copy/Move mailbox urls require a mailbox copy handler which actually + // performs the copy. + ///////////////////////////////////////////////////////////////////////// + attribute nsIStreamListener mailboxCopyHandler; + + // Some mailbox urls include a message key for the message in question. + readonly attribute nsMsgKey messageKey; + + // this is to support multiple msg move/copy in one url + void setMoveCopyMsgKeys(in Array<nsMsgKey> keysToFlag); + void getMoveCopyMsgHdrForIndex(in unsigned long msgIndex, out nsIMsgDBHdr msgHdr); + readonly attribute unsigned long numMoveCopyMsgs; + attribute unsigned long curMoveCopyMsgIndex; + // mailbox urls to fetch a mail message can specify the size of + // the message... + // this saves us the trouble of having to open up the msg db and ask + // ourselves... + attribute unsigned long messageSize; + + attribute nsMailboxAction mailboxAction; + + /* these are nsMailboxActions */ + const long ActionParseMailbox = 0; + const long ActionFetchMessage = 1; + const long ActionCopyMessage = 2; + const long ActionMoveMessage = 3; + const long ActionSaveMessageToDisk = 4; + const long ActionAppendMessageToDisk = 5; + const long ActionFetchPart = 6; +}; diff --git a/comm/mailnews/local/public/nsIMsgLocalMailFolder.idl b/comm/mailnews/local/public/nsIMsgLocalMailFolder.idl new file mode 100644 index 0000000000..80c7da02f7 --- /dev/null +++ b/comm/mailnews/local/public/nsIMsgLocalMailFolder.idl @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +interface nsIMsgWindow; +interface nsIUrlListener; +interface nsIMsgDatabase; +interface nsIMsgDBHdr; +interface nsIMsgFolder; +interface nsIMsgCopyServiceListener; + +[ptr] native nsLocalFolderScanState(nsLocalFolderScanState); + +%{C++ +/* flags for markMsgsOnPop3Server */ +#define POP3_NONE 0 +#define POP3_DELETE 1 +#define POP3_FETCH_BODY 2 +#define POP3_FORCE_DEL 3 + +struct nsLocalFolderScanState; +%} + +[scriptable, uuid(ebf7576c-e15f-4aba-b021-cc6e9266e90c)] +interface nsIMsgLocalMailFolder : nsISupports { + /** + * Set the default flags on the subfolders of this folder, such as + * Drafts, Templates, etc. + * @param flags bitwise OR matching the type of mailboxes you want to flag. + * This function will be smart and find the right names. + * E.g. nsMsgFolderFlags::Inbox | nsMsgFolderFlags::Drafts + */ + void setFlagsOnDefaultMailboxes(in unsigned long flags); + + /* + * This will return null if the db is out of date + */ + nsIMsgDatabase getDatabaseWOReparse(); + + /* + * If the db is out of date, this will return NS_ERROR_NOT_INITIALIZED + * and kick off an async url to reparse the messages. + * If aReparseUrlListener is null, folder will use itself as the listener. + */ + nsIMsgDatabase getDatabaseWithReparse(in nsIUrlListener aReparseUrlListener, in nsIMsgWindow aMsgWindow); + void parseFolder(in nsIMsgWindow aMsgWindow, in nsIUrlListener listener); + void copyFolderLocal(in nsIMsgFolder srcFolder, in boolean isMove, in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener); + + /** + * Does copy of same level subfolders of the srcFolder to the destination + * (this) local folder. If isMove is true, the messages in the subfolders are + * deleted (or marked deleted if source is imap) after the copy completes; so + * effectively, the folders are copied and only the messages are moved. + * + * @param srcFolder The folder one level above subfolders being copied + * @param msgWindow Window for notification callbacks, can be null + * @param listener Listener which receive operation notifications, can be null + * @param isMove If true, after copy completes, delete the source messages + */ + void copyAllSubFolders(in nsIMsgFolder srcFolder, in nsIMsgWindow msgWindow, + in nsIMsgCopyServiceListener listener, in boolean isMove); + + void onCopyCompleted(in nsISupports aSrcSupport, in boolean aMoveCopySucceeded); + attribute boolean checkForNewMessagesAfterParsing; + void markMsgsOnPop3Server(in Array<nsIMsgDBHdr> aMessages, in int32_t aMark); + + /** + * File size on disk has possibly changed - update and notify. + */ + void refreshSizeOnDisk(); + + /** + * Creates a subfolder to the current folder with the passed in folder name. + * @param aFolderName name of the folder to create. + * @return newly created folder. + */ + nsIMsgFolder createLocalSubfolder(in AString aFolderName); + + /** + * Adds a message to the end of the folder, parsing it as it goes, and + * applying filters, if applicable. + * @param aMessage string containing the entire body of the message to add + * @return the nsIMsgDBHdr of the added message + */ + nsIMsgDBHdr addMessage(in string aMessage); + + /** + * Add one or more messages to the end of the folder in a single batch. Each + * batch requires an fsync() on the mailbox file so it is a good idea to + * try and minimize the number of calls you make to this method or addMessage. + * + * Filters are applied, if applicable. + * + * @param aMessageCount The number of messages. + * @param aMessages An array of pointers to strings containing entire message + * bodies. + * @return an array of nsIMsgDBHdr of the added messages + */ + Array<nsIMsgDBHdr> addMessageBatch(in Array<ACString> aMessages); + + /** + * Functions for updating the UI while running downloadMessagesForOffline: + * delete the old message before adding its newly downloaded body, and + * select the new message after it has replaced the old one + */ + void deleteDownloadMsg(in nsIMsgDBHdr aMsgHdr); + void notifyDelete(); + + /** + * Functions for grubbing through a folder to find the Uidl for a + * given msgDBHdr. + */ + [noscript] void getFolderScanState(in nsLocalFolderScanState aState); + [noscript] void getUidlFromFolder(in nsLocalFolderScanState aState, in nsIMsgDBHdr aMsgHdr); + + + /** + * Shows warning if there is not enough space in the message store + * for a message of the given size. + */ + boolean warnIfLocalFileTooBig(in nsIMsgWindow aWindow, + [optional] in long long aSpaceRequested); + + /** + * Update properties on a new header from an old header, for cases where + * a partial message will be replaced with a full message. + * + * @param aOldHdr message header used as properties source + * @param aNewHdr message header used as properties destination + */ + void updateNewMsgHdr(in nsIMsgDBHdr aOldHdr, in nsIMsgDBHdr aNewHdr); +}; diff --git a/comm/mailnews/local/public/nsIMsgParseMailMsgState.idl b/comm/mailnews/local/public/nsIMsgParseMailMsgState.idl new file mode 100644 index 0000000000..77c92b72df --- /dev/null +++ b/comm/mailnews/local/public/nsIMsgParseMailMsgState.idl @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "MailNewsTypes2.idl" // for nsMsgKey typedef + +interface nsIMsgDatabase; +interface nsIMsgDBHdr; + +typedef long nsMailboxParseState; + +[scriptable, uuid(0d44646c-0759-43a2-954d-dc2a9a9660ec)] +interface nsIMsgParseMailMsgState : nsISupports { + void SetMailDB(in nsIMsgDatabase aDatabase); + /* + * Set a backup mail database, whose data will be read during parsing to + * attempt to recover message metadata + * + * @param aDatabase the backup database + */ + void SetBackupMailDB(in nsIMsgDatabase aDatabase); + void Clear(); + + void ParseAFolderLine(in string line, in unsigned long lineLength); + /// db header for message we're currently parsing + attribute nsIMsgDBHdr newMsgHdr; + void FinishHeader(); + + long GetAllHeaders(out string headers); + readonly attribute string headers; + attribute nsMailboxParseState state; + /* these are nsMailboxParseState */ + const long ParseEnvelopeState=0; + const long ParseHeadersState=1; + const long ParseBodyState=2; + + /** + * Set the key to be used for the new message header. + * + * @param aNewKey the new db key + * + */ + void setNewKey(in nsMsgKey aKey); +}; diff --git a/comm/mailnews/local/public/nsINewsBlogFeedDownloader.idl b/comm/mailnews/local/public/nsINewsBlogFeedDownloader.idl new file mode 100644 index 0000000000..c87320fb47 --- /dev/null +++ b/comm/mailnews/local/public/nsINewsBlogFeedDownloader.idl @@ -0,0 +1,32 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIMsgFolder; +interface nsIUrlListener; +interface nsIMsgWindow; + +[scriptable, uuid(86e5bd0e-c324-11e3-923a-00269e4fddc1)] +interface nsINewsBlogFeedDownloader : nsISupports +{ + void downloadFeed(in nsIMsgFolder aFolder, + in nsIUrlListener aUrlListener, + in bool aIsBiff, + in nsIMsgWindow aMsgWindow); + + /** + * Called when the RSS Incoming Server detects a change to an RSS folder name, + * such as delete (move to trash), move/copy, or rename. We then need to update + * the feeds.rdf subscriptions data source. + * + * @param nsIMsgFolder aFolder - the folder, new if rename or target of + * move/copy folder (new parent) + * @param nsIMsgFolder aOrigFolder - original folder + * @param string aAction - "move" or "copy" or "rename" + */ + void updateSubscriptionsDS(in nsIMsgFolder aFolder, + in nsIMsgFolder aOrigFolder, + in string aAction); +}; diff --git a/comm/mailnews/local/public/nsINoIncomingServer.idl b/comm/mailnews/local/public/nsINoIncomingServer.idl new file mode 100644 index 0000000000..717689f58b --- /dev/null +++ b/comm/mailnews/local/public/nsINoIncomingServer.idl @@ -0,0 +1,16 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, uuid(dacd4917-ddbe-47bb-8a49-6a8d91c49a86)] +interface nsINoIncomingServer : nsISupports { + /** + * Copy the default messages (e.g. Templates) from + * bin/defaults/messenger/<folderNameOnDisk> to <rootFolder>/<folderNameOnDisk>. + * This is useful when first creating the standard folders (like Templates). + */ + void copyDefaultMessages(in string folderNameOnDisk); +}; diff --git a/comm/mailnews/local/public/nsINoneService.idl b/comm/mailnews/local/public/nsINoneService.idl new file mode 100644 index 0000000000..045a018fff --- /dev/null +++ b/comm/mailnews/local/public/nsINoneService.idl @@ -0,0 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, uuid(14714890-1dd2-11b2-87de-d265839520d6)] +interface nsINoneService : nsISupports { + /* nothing yet, but soon. */ +}; diff --git a/comm/mailnews/local/public/nsIPop3IncomingServer.idl b/comm/mailnews/local/public/nsIPop3IncomingServer.idl new file mode 100644 index 0000000000..b1433f5676 --- /dev/null +++ b/comm/mailnews/local/public/nsIPop3IncomingServer.idl @@ -0,0 +1,33 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIPop3Protocol; +interface nsIMsgFolder; +interface nsIUrlListener; +interface nsIMsgWindow; + +[scriptable, uuid(8494584a-49b7-49df-9001-80ccdd0b50aa)] +interface nsIPop3IncomingServer : nsISupports { + attribute boolean leaveMessagesOnServer; + attribute boolean headersOnly; + attribute boolean deleteMailLeftOnServer; + attribute unsigned long pop3CapabilityFlags; + attribute boolean deleteByAgeFromServer; + attribute long numDaysToLeaveOnServer; + // client adds uidls to mark one by one, then calls markMessages + void addUidlToMark(in string aUidl, in int32_t newStatus); + // TODO: make this async. + void markMessages(); + /* account to which this server defers storage, for global inbox */ + attribute ACString deferredToAccount; + // whether get new mail in deferredToAccount gets + // new mail with this server. + attribute boolean deferGetNewMail; + void downloadMailFromServers( + in Array<nsIPop3IncomingServer> aServers, in nsIMsgWindow aMsgWindow, + in nsIMsgFolder aFolder, in nsIUrlListener aListener); +}; diff --git a/comm/mailnews/local/public/nsIPop3Protocol.idl b/comm/mailnews/local/public/nsIPop3Protocol.idl new file mode 100644 index 0000000000..8263f94a55 --- /dev/null +++ b/comm/mailnews/local/public/nsIPop3Protocol.idl @@ -0,0 +1,23 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[ptr] native Pop3UidlEntryArrayRef(nsTArray<Pop3UidlEntry*>); + +%{C++ +#include "nsTArray.h" +struct Pop3UidlEntry; +%} + +[scriptable, uuid(3aff0550-87de-4337-9bc1-c84eb5462afe)] +interface nsIPop3Protocol : nsISupports { + /* aUidl is an array of pointers to Pop3UidlEntry's. That structure is + * currently defined in nsPop3Protocol.h, perhaps it should be here + * instead... + */ + [noscript] void markMessages(in Pop3UidlEntryArrayRef aUidl); + boolean checkMessage(in string aUidl); +}; diff --git a/comm/mailnews/local/public/nsIPop3Service.idl b/comm/mailnews/local/public/nsIPop3Service.idl new file mode 100644 index 0000000000..4c3e9a28ee --- /dev/null +++ b/comm/mailnews/local/public/nsIPop3Service.idl @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIUrlListener.idl" +#include "nsIPop3IncomingServer.idl" +#include "nsIMsgFolder.idl" + +interface nsIURI; +interface nsIMsgWindow; +interface nsIMsgFolder; + +[scriptable, uuid(7302fd8e-946f-4ae3-9468-0fb3a7706c51)] +interface nsIPop3ServiceListener : nsISupports { + /** + * Notification that a pop3 download has started. + * + * @param aFolder folder in which the download is started. + */ + void onDownloadStarted(in nsIMsgFolder aFolder); + + /** + * Notification about download progress. + * + * @param aFolder folder in which the download is happening. + * @param aNumDownloaded number of the messages that have been downloaded. + * @param aTotalToDownload total number of messages to download. + */ + void onDownloadProgress(in nsIMsgFolder aFolder, + in unsigned long aNumDownloaded, + in unsigned long aTotalToDownload); + + /** + * Notification that a download has completed. + * + * @param aFolder folder to which the download has completed. + * @param aNumberOfMessages number of the messages that were downloaded. + */ + void onDownloadCompleted(in nsIMsgFolder aFolder, + in unsigned long aNumberOfMessages); +}; + +/* + * The Pop3 Service is an interface designed to make building and running + * pop3 urls easier. + */ +[scriptable, uuid(96d3cc14-a842-4cdf-98f8-a4cc695f8b3b)] +interface nsIPop3Service : nsISupports { + /* + * All of these functions build pop3 urls and run them. If you want + * a handle on the running task, pass in a valid nsIURI ptr. You can later + * interrupt this action by asking the netlib service manager to interrupt + * the url you are given back. Remember to release aURL when you are + * done with it. Pass nullptr in for aURL if you + * don't care about the returned URL. + */ + + /* + * right now getting new mail doesn't require any user specific data. + * We use the default current identity for this information. I suspect that + * we'll eventually pass in an identity to this call so you can get + * mail on different pop3 accounts.... + */ + + nsIURI GetNewMail(in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, + in nsIMsgFolder aInbox, in nsIPop3IncomingServer popServer); + + nsIURI CheckForNewMail(in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener, + in nsIMsgFolder inbox, in nsIPop3IncomingServer popServer); + + /** + * Verify that we can logon + * + * @param aServer - pop3 server we're logging on to. + * @param aUrlListener - gets called back with success or failure. + * @param aMsgWindow - nsIMsgWindow to use for notification callbacks. + * @return - the url that we run. + * + */ + nsIURI verifyLogon(in nsIMsgIncomingServer aServer, + in nsIUrlListener aUrlListener, + in nsIMsgWindow aMsgWindow); + + /** + * Add a listener for pop3 events like message download. This is + * used by the activity manager. + * + * @param aListener listener that gets notified of pop3 events. + */ + void addListener(in nsIPop3ServiceListener aListener); + + /** + * Remove a listener for pop3 events like message download. + * + * @param aListener listener to remove. + */ + void removeListener(in nsIPop3ServiceListener aListener); + + /** + * Send the notification that a pop3 download has started. + * This is called from the nsIPop3Sink code. + * + * @param aFolder folder in which the download is started. + */ + void notifyDownloadStarted(in nsIMsgFolder aFolder); + + /** + * Send notification about download progress. + * + * @param aFolder folder in which the download is happening. + * @param aNumDownloaded number of the messages that have been downloaded. + * @param aTotalToDownload total number of messages to download. + */ + void notifyDownloadProgress(in nsIMsgFolder aFolder, + in unsigned long aNumDownloaded, + in unsigned long aTotalToDownload); + /** + * Send the notification that a download has completed. + * This is called from the nsIPop3Sink code. + * + * @param aFolder folder to which the download has completed. + * @param aNumberOfMessages number of the messages that were downloaded. + */ + void notifyDownloadCompleted(in nsIMsgFolder aFolder, + in unsigned long aNumberOfMessages); +}; diff --git a/comm/mailnews/local/public/nsIPop3Sink.idl b/comm/mailnews/local/public/nsIPop3Sink.idl new file mode 100644 index 0000000000..0291329a2c --- /dev/null +++ b/comm/mailnews/local/public/nsIPop3Sink.idl @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIPop3IncomingServer.idl" +#include "nsIMsgFolder.idl" + +interface nsIURI; + +[scriptable, uuid(ceabfc6b-f139-4c25-890f-efb7c3069d40)] +interface nsIPop3Sink : nsISupports { + + attribute boolean buildMessageUri; + attribute AUTF8String messageUri; + attribute AUTF8String baseMessageUri; + + /// message uri for header-only message version + attribute AUTF8String origMessageUri; + + boolean beginMailDelivery(in boolean uidlDownload, in nsIMsgWindow msgWindow); + void endMailDelivery(in nsIPop3Protocol protocol); + void abortMailDelivery(in nsIPop3Protocol protocol); + + void incorporateBegin(in string uidlString, in unsigned long flags); + void incorporateWrite(in string block, in long length); + void incorporateComplete(in nsIMsgWindow aMsgWindow, in int32_t aSize); + void incorporateAbort(in boolean uidlDownload); + + /** + * Tell the pop3sink how many messages we're going to download. + * + * @param aNumMessages how many messages we're going to download. + */ + void setMsgsToDownload(in unsigned long aNumMessages); + + void setBiffStateAndUpdateFE(in unsigned long biffState, in long numNewMessages, in boolean notify); + + attribute nsIPop3IncomingServer popServer; + attribute nsIMsgFolder folder; +}; diff --git a/comm/mailnews/local/public/nsIPop3URL.idl b/comm/mailnews/local/public/nsIPop3URL.idl new file mode 100644 index 0000000000..3fcd66e1a3 --- /dev/null +++ b/comm/mailnews/local/public/nsIPop3URL.idl @@ -0,0 +1,19 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIPop3Sink.idl" + +[scriptable, uuid(5fb87ae7-a3a0-440a-8b49-6bca42fb7ff2)] +interface nsIPop3URL : nsISupports { + attribute nsIPop3Sink pop3Sink; + attribute AUTF8String messageUri; + + /// Constant for the default POP3 port number + const int32_t DEFAULT_POP3_PORT = 110; + + /// Constant for the default POP3 over ssl port number + const int32_t DEFAULT_POP3S_PORT = 995; +}; diff --git a/comm/mailnews/local/public/nsIRssIncomingServer.idl b/comm/mailnews/local/public/nsIRssIncomingServer.idl new file mode 100644 index 0000000000..aa5373126b --- /dev/null +++ b/comm/mailnews/local/public/nsIRssIncomingServer.idl @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIFile; + +[scriptable, uuid(6d744e7f-2218-45c6-8734-998a56cb3c6d)] +interface nsIRssIncomingServer : nsISupports { + // Path to the subscriptions file for this RSS server. + readonly attribute nsIFile subscriptionsPath; + + // Path to the feed items file for this RSS server. + readonly attribute nsIFile feedItemsPath; +}; diff --git a/comm/mailnews/local/public/nsIRssService.idl b/comm/mailnews/local/public/nsIRssService.idl new file mode 100644 index 0000000000..8f5e94af55 --- /dev/null +++ b/comm/mailnews/local/public/nsIRssService.idl @@ -0,0 +1,10 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, uuid(4b31bdd9-6f4c-46d4-a766-a94f11b599bc)] +interface nsIRssService : nsISupports +{ +}; |