1999-07-08 08:17:16 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
1999-02-17 22:28:25 +03:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-02-17 22:28:25 +03:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-02-17 22:28:25 +03:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-02-17 22:28:25 +03:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-07-08 08:17:16 +04:00
|
|
|
*/
|
1999-02-17 22:28:25 +03:00
|
|
|
|
1999-07-08 08:17:16 +04:00
|
|
|
/*
|
|
|
|
* The nsIMsgSend method will create an RFC822 message and send it all in one operation
|
|
|
|
* as well as providing the ability to save disk files for later use. The mode of delivery
|
|
|
|
* can also be specified for the "Send Later", "Drafts" and "Templates" operations. (NOTE:
|
|
|
|
* This method could easily be broken in to a few different calls. Currently, this method
|
|
|
|
* does several functions depending on the arguments passed in, but this could easily lead
|
|
|
|
* to confusion. This is something that very well may change as time allows).
|
|
|
|
*/
|
1999-02-17 22:28:25 +03:00
|
|
|
#include "nsISupports.idl"
|
1999-07-08 08:17:16 +04:00
|
|
|
#include "nsISupportsArray.idl"
|
|
|
|
#include "nsrootidl.idl"
|
|
|
|
#include "nsIMsgIdentity.idl"
|
1999-02-17 22:28:25 +03:00
|
|
|
#include "nsIMsgCompFields.idl"
|
1999-07-08 08:17:16 +04:00
|
|
|
#include "nsIMsgSendListener.idl"
|
1999-07-22 00:17:07 +04:00
|
|
|
#include "nsIEditorShell.idl"
|
2001-05-05 01:13:25 +04:00
|
|
|
#include "nsIMsgProgress.idl"
|
2001-04-13 08:38:01 +04:00
|
|
|
#include "domstubs.idl"
|
|
|
|
#include "nsIPrompt.idl"
|
2001-05-01 07:17:47 +04:00
|
|
|
#include "MailNewsTypes2.idl"
|
1999-07-08 08:17:16 +04:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#include "nsIURL.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsString.h"
|
|
|
|
class nsFileSpec;
|
|
|
|
class nsOutputFileStream;
|
1999-07-08 08:17:16 +04:00
|
|
|
%}
|
|
|
|
|
2001-08-11 02:23:47 +04:00
|
|
|
interface nsIURI;
|
|
|
|
interface nsIRequest;
|
2001-03-17 04:59:34 +03:00
|
|
|
interface nsIMsgDBHdr;
|
1999-08-07 06:32:02 +04:00
|
|
|
interface nsIMsgHdr;
|
2000-05-13 00:41:19 +04:00
|
|
|
interface nsIDocShell;
|
2001-07-16 06:40:48 +04:00
|
|
|
interface nsIFileSpec;
|
1999-07-08 08:17:16 +04:00
|
|
|
|
2000-05-10 11:30:45 +04:00
|
|
|
typedef long nsMsgDeliverMode;
|
1999-07-08 08:17:16 +04:00
|
|
|
|
|
|
|
%{ C++
|
|
|
|
//
|
|
|
|
// Callback declarations for message delivery
|
|
|
|
//
|
|
|
|
// For completion of send/message creation operations...
|
|
|
|
typedef nsresult (*nsMsgSendCompletionCallback) (nsresult aExitCode, void *tagData, nsFileSpec *returnFileSpec);
|
|
|
|
|
|
|
|
// For completion of sending unsent messages operations...
|
|
|
|
typedef nsresult (*nsMsgSendUnsentMessagesCallback) (nsresult aExitCode, PRUint32 totalSentCount,
|
|
|
|
PRUint32 totalSentSuccessfully, void *tagData);
|
1999-06-10 04:52:47 +04:00
|
|
|
%}
|
1999-02-17 22:28:25 +03:00
|
|
|
|
1999-07-08 08:17:16 +04:00
|
|
|
%{ C++
|
2001-04-13 08:38:01 +04:00
|
|
|
// Forward declaration
|
|
|
|
class nsMsgAttachmentHandler;
|
|
|
|
|
1999-07-08 08:17:16 +04:00
|
|
|
// Attachment file/URL structures
|
|
|
|
struct nsMsgAttachmentData
|
|
|
|
{
|
2000-03-25 00:22:53 +03:00
|
|
|
nsIURI *url; // The URL to attach. This should be 0 to signify "end of list".
|
1999-07-08 08:17:16 +04:00
|
|
|
|
|
|
|
char *desired_type; // The type to which this document should be
|
|
|
|
// converted. Legal values are NULL, TEXT_PLAIN
|
|
|
|
// and APPLICATION_POSTSCRIPT (which are macros
|
|
|
|
// defined in net.h); other values are ignored.
|
|
|
|
|
|
|
|
char *real_type; // The type of the URL if known, otherwise NULL. For example, if
|
|
|
|
// you were attaching a temp file which was known to contain HTML data,
|
|
|
|
// you would pass in TEXT_HTML as the real_type, to override whatever type
|
|
|
|
// the name of the tmp file might otherwise indicate.
|
|
|
|
|
|
|
|
char *real_encoding; // Goes along with real_type
|
|
|
|
|
|
|
|
char *real_name; // The original name of this document, which will eventually show up in the
|
|
|
|
// Content-Disposition header. For example, if you had copied a document to a
|
|
|
|
// tmp file, this would be the original, human-readable name of the document.
|
|
|
|
|
|
|
|
char *description; // If you put a string here, it will show up as the Content-Description header.
|
|
|
|
// This can be any explanatory text; it's not a file name.
|
|
|
|
|
|
|
|
char *x_mac_type, *x_mac_creator; // Mac-specific data that should show up as optional parameters
|
|
|
|
// to the content-type header.
|
2000-03-25 00:22:53 +03:00
|
|
|
PRBool notDownloaded; // Flag for IMAP parts on demand status
|
1999-02-17 22:28:25 +03:00
|
|
|
};
|
|
|
|
|
1999-07-08 08:17:16 +04:00
|
|
|
|
|
|
|
//
|
|
|
|
// When we have downloaded a URL to a tmp file for attaching, this
|
|
|
|
// represents everything we learned about it (and did to it) in the
|
|
|
|
// process.
|
|
|
|
//
|
|
|
|
typedef struct nsMsgAttachedFile
|
|
|
|
{
|
|
|
|
nsIURI *orig_url; // Where it came from on the network (or even elsewhere on the local disk.)
|
|
|
|
|
|
|
|
nsFileSpec *file_spec; // The tmp file in which the (possibly converted) data now resides.
|
|
|
|
|
|
|
|
char *type; // The type of the data in file_name (not necessarily the same as the type of orig_url.)
|
|
|
|
|
|
|
|
char *encoding; // Likewise, the encoding of the tmp file. This will be set only if the original
|
|
|
|
// document had an encoding already; we don't do base64 encoding and so forth until
|
|
|
|
// it's time to assemble a full MIME message of all parts.
|
|
|
|
|
|
|
|
|
|
|
|
char *description; // For Content-Description header
|
|
|
|
char *x_mac_type; // mac-specific info
|
|
|
|
char *x_mac_creator; // mac-specific info
|
|
|
|
char *real_name; // The real name of the file.
|
|
|
|
|
|
|
|
// Some statistics about the data that was written to the file, so that when
|
|
|
|
// it comes time to compose a MIME message, we can make an informed decision
|
|
|
|
// about what Content-Transfer-Encoding would be best for this attachment.
|
|
|
|
// (If it's encoded already, we ignore this information and ship it as-is.)
|
|
|
|
PRUint32 size;
|
|
|
|
PRUint32 unprintable_count;
|
|
|
|
PRUint32 highbit_count;
|
|
|
|
PRUint32 ctl_count;
|
|
|
|
PRUint32 null_count;
|
|
|
|
PRUint32 max_line_length;
|
|
|
|
|
|
|
|
} nsMsgAttachedFile;
|
|
|
|
%}
|
|
|
|
|
2000-05-10 11:30:45 +04:00
|
|
|
|
1999-07-08 08:17:16 +04:00
|
|
|
[ptr] native nsMsgAttachmentData(nsMsgAttachmentData);
|
|
|
|
[ptr] native nsMsgAttachedFile(nsMsgAttachedFile);
|
2001-04-13 08:38:01 +04:00
|
|
|
[ptr] native nsMsgAttachmentHandler(nsMsgAttachmentHandler);
|
|
|
|
[ptr] native nsOutputFileStream(nsOutputFileStream);
|
|
|
|
[ptr] native nsCString(nsCString);
|
1999-07-08 08:17:16 +04:00
|
|
|
|
|
|
|
[scriptable, uuid(9E9BD970-C5D6-11d2-8297-000000000000)]
|
|
|
|
interface nsIMsgSend : nsISupports
|
|
|
|
{
|
1999-07-22 00:17:07 +04:00
|
|
|
//
|
|
|
|
// This is the primary interface for creating and sending RFC822 messages
|
|
|
|
// in the new architecture. Currently, this method supports many arguments
|
|
|
|
// that change the behavior of the operation. This will change in time to
|
|
|
|
// be separate calls that will be more singluar in nature.
|
|
|
|
//
|
|
|
|
// NOTE: when aEditor is non-null, a multipart related MHTML message will
|
|
|
|
// be created
|
|
|
|
//
|
2000-05-10 11:30:45 +04:00
|
|
|
|
|
|
|
const nsMsgDeliverMode nsMsgDeliverNow = 0;
|
|
|
|
|
|
|
|
const nsMsgDeliverMode nsMsgQueueForLater = 1;
|
|
|
|
const nsMsgDeliverMode nsMsgSave = 2;
|
|
|
|
const nsMsgDeliverMode nsMsgSaveAs = 3;
|
|
|
|
const nsMsgDeliverMode nsMsgSaveAsDraft = 4;
|
|
|
|
const nsMsgDeliverMode nsMsgSaveAsTemplate = 5;
|
|
|
|
|
|
|
|
[noscript]
|
2001-04-13 08:38:01 +04:00
|
|
|
void createAndSendMessage(in nsIEditorShell aEditor,
|
2000-05-10 11:30:45 +04:00
|
|
|
in nsIMsgIdentity aUserIdentity,
|
|
|
|
in nsIMsgCompFields fields,
|
|
|
|
in PRBool digest_p,
|
|
|
|
in PRBool dont_deliver_p,
|
|
|
|
in nsMsgDeliverMode mode,
|
2001-03-17 04:59:34 +03:00
|
|
|
in nsIMsgDBHdr msgToReplace,
|
2000-05-10 11:30:45 +04:00
|
|
|
in string attachment1_type,
|
|
|
|
in string attachment1_body,
|
|
|
|
in PRUint32 attachment1_body_length,
|
|
|
|
[const] in nsMsgAttachmentData attachments,
|
|
|
|
[const] in nsMsgAttachedFile preloaded_attachments,
|
2000-06-03 13:46:12 +04:00
|
|
|
in voidPtr relatedPart,
|
2001-04-13 08:38:01 +04:00
|
|
|
in nsIDOMWindowInternal parentWindow,
|
2001-05-05 01:13:25 +04:00
|
|
|
in nsIMsgProgress progress,
|
2001-08-16 02:40:14 +04:00
|
|
|
in nsIMsgSendListener aListener,
|
|
|
|
in string password
|
2001-04-13 08:38:01 +04:00
|
|
|
);
|
2000-05-10 11:30:45 +04:00
|
|
|
|
|
|
|
|
2001-04-13 08:38:01 +04:00
|
|
|
void sendMessageFile(in nsIMsgIdentity aUserIdentity,
|
2000-05-10 11:30:45 +04:00
|
|
|
in nsIMsgCompFields fields,
|
|
|
|
in nsIFileSpec sendIFileSpec,
|
|
|
|
in PRBool deleteSendFileOnCompletion,
|
|
|
|
in PRBool digest_p,
|
|
|
|
in nsMsgDeliverMode mode,
|
2001-03-17 04:59:34 +03:00
|
|
|
in nsIMsgDBHdr msgToReplace,
|
2001-08-16 02:40:14 +04:00
|
|
|
in nsIMsgSendListener aListener,
|
|
|
|
in string password
|
|
|
|
);
|
2001-04-13 08:38:01 +04:00
|
|
|
|
|
|
|
/* Abort current send/save operation */
|
|
|
|
void abort();
|
|
|
|
|
|
|
|
/* Report a send failure */
|
|
|
|
void fail(in nsresult failure_code, in wstring error_msg);
|
|
|
|
|
|
|
|
/* Disable UI notification (alert message) */
|
|
|
|
void setGUINotificationState(in PRBool aEnableFlag);
|
|
|
|
|
|
|
|
/* methods for send listener ... */
|
|
|
|
[noscript] void notifyListenerOnStartSending(in string aMsgID, in unsigned long aMsgSize);
|
|
|
|
[noscript] void notifyListenerOnProgress(in string aMsgID, in unsigned long aProgress, in unsigned long aProgressMax);
|
|
|
|
[noscript] void notifyListenerOnStatus(in string aMsgID, in wstring aMsg);
|
|
|
|
[noscript] void notifyListenerOnStopSending(in string aMsgID, in nsresult aStatus, in wstring aMsg, in nsIFileSpec returnFileSpec);
|
2001-04-18 03:41:29 +04:00
|
|
|
[noscript] void deliverAsMailExit(in nsIURI aUrl, in nsresult aExitCode);
|
|
|
|
[noscript] void deliverAsNewsExit(in nsIURI aUrl, in nsresult aExitCode);
|
2001-04-13 08:38:01 +04:00
|
|
|
|
|
|
|
/* methods for copy listener ... */
|
|
|
|
[noscript] void notifyListenerOnStartCopy();
|
|
|
|
[noscript] void notifyListenerOnProgressCopy(in unsigned long aProgress, in unsigned long aProgressMax);
|
|
|
|
[noscript] void notifyListenerOnStopCopy(in nsresult aStatus);
|
|
|
|
[noscript] void getMessageId(in nsCString messageID);
|
2001-05-01 07:17:47 +04:00
|
|
|
[noscript] attribute nsMsgKey messageKey;
|
2001-04-13 08:38:01 +04:00
|
|
|
|
|
|
|
[noscript] nsIPrompt getDefaultPrompt();
|
|
|
|
|
|
|
|
/* process attachment */
|
|
|
|
[noscript] void gatherMimeAttachments();
|
|
|
|
[noscript] boolean getProcessAttachmentsSynchronously();
|
|
|
|
[noscript] nsMsgAttachmentHandler getAttachmentHandlers();
|
|
|
|
[noscript] readonly attribute unsigned long attachmentCount;
|
|
|
|
[noscript] attribute unsigned long pendingAttachmentCount;
|
|
|
|
|
2001-05-05 01:13:25 +04:00
|
|
|
[noscript] nsIMsgProgress getProgress();
|
2001-04-13 08:38:01 +04:00
|
|
|
|
|
|
|
[noscript] nsOutputFileStream getOutputStream();
|
|
|
|
|
2001-08-11 02:23:47 +04:00
|
|
|
[noscript] attribute nsIRequest runningRequest;
|
|
|
|
|
2001-04-13 08:38:01 +04:00
|
|
|
[noscript] attribute nsresult status;
|
2000-05-10 11:30:45 +04:00
|
|
|
|
1999-07-08 08:17:16 +04:00
|
|
|
};
|