Back to index

lightning-sunbird  0.9+nobinonly
nsIMessenger.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "nsISupports.idl"
00039 #include "nsrootidl.idl"
00040 #include "nsIRDFCompositeDataSource.idl"
00041 #include "nsIMsgWindow.idl"
00042 #include "nsIMsgIdentity.idl"
00043 #include "nsIMsgThread.idl"
00044 #include "nsIMsgFolder.idl"
00045 
00046 interface nsIMsgDBHdr;
00047 interface nsIDOMWindowInternal;
00048 interface nsITransactionManager;
00049 interface nsIMsgMessageService;
00050 
00051 [scriptable, uuid(0F6D0A77-AED8-4658-BEDD-8753A008F0D8)]
00052 interface nsIMessenger : nsISupports {
00053 
00054     const long eUnknown = 0;
00055     const long eDeleteMsg = 1;
00056     const long eMoveMsg = 2;
00057     const long eCopyMsg = 3;
00058 
00059     void setDisplayCharset(in string aCharset);
00060 
00061     readonly attribute nsITransactionManager transactionManager;
00062 
00063     void SetWindow(in nsIDOMWindowInternal ptr, in nsIMsgWindow msgWindow);
00064 
00065     void DeleteFolders(in nsIRDFCompositeDataSource db,
00066                        in nsIRDFResource parentFolder,
00067                        in nsIRDFResource folder);
00068     void CopyMessages(in nsIRDFCompositeDataSource database,
00069                    in nsIRDFResource srcResource,
00070                    in nsIRDFResource dstResource,
00071                    in nsISupportsArray messages,
00072                    in boolean isMove);
00073 
00074     void CopyFolders(in nsIRDFCompositeDataSource database,
00075                    in nsIRDFResource dstResource,
00076                    in nsISupportsArray folders,
00077                    in boolean isMoveFolder);
00078     
00079 
00080     void OpenURL(in string aURL);
00081 
00084     void loadURL(in nsIDOMWindowInternal ptr, in string aURL); 
00085 
00086     void launchExternalURL(in string aURL);
00087 
00088     void RenameFolder(in nsIRDFCompositeDataSource db, 
00089                       in nsIRDFResource folder, in wstring name);
00090     void CompactFolder(in nsIRDFCompositeDataSource db,
00091                        in nsIRDFResource folder, 
00092                        in boolean forAll);
00093     void EmptyTrash(in nsIRDFCompositeDataSource db,
00094                     in nsIRDFResource folder);
00095 
00096     boolean CanUndo();
00097     boolean CanRedo();
00098     unsigned long GetUndoTransactionType();
00099     unsigned long GetRedoTransactionType();
00100     void Undo(in nsIMsgWindow msgWindow);
00101     void Redo(in nsIMsgWindow msgWindow);
00102     void sendUnsentMessages(in nsIMsgIdentity aIdentity, in nsIMsgWindow aMsgWindow);
00103     void SetDocumentCharset(in string characterSet);
00104     void saveAs(in string aURI, in boolean aAsFile, in nsIMsgIdentity aIdentity, in wstring aMsgFilename);
00105     void openAttachment(in string contentTpe, in string url, in string displayName, in string messageUri, in boolean isExternalAttachment);
00106     void saveAttachment(in string contentTpe, in string url, in string displayName, in string messageUri, in boolean isExternalAttachment);
00107     void saveAllAttachments(in unsigned long count, [array, size_is(count)] in string contentTypeArray,
00108                             [array, size_is(count)] in string urlArray, [array, size_is(count)] in string displayNameArray,
00109                             [array, size_is(count)] in string messageUriArray);
00110     void detachAttachment(in string contentTpe, in string url, in string displayName, in string messageUri, in boolean saveFirst);
00111     void detachAllAttachments(in unsigned long count, [array, size_is(count)] in string contentTypeArray,
00112                              [array, size_is(count)] in string urlArray, [array, size_is(count)] in string displayNameArray,
00113                              [array, size_is(count)] in string messageUriArray, in boolean saveFirst);
00114     // saveAttachmentToFolder is used by the drag and drop code to drop an attachment to a destination folder
00115        // we need to return the actual file path (including the filename).
00116     nsILocalFile saveAttachmentToFolder(in string contentType, in string url, in string displayName, in string messageUri, in nsILocalFile aDestFolder);
00117 
00118     attribute boolean sendingUnsentMsgs;
00119 
00120     readonly attribute string lastDisplayedMessageUri;
00121 
00122     nsIMsgMessageService messageServiceFromURI(in string aUri);
00123     nsIMsgDBHdr msgHdrFromURI(in string aUri);
00124     // for back forward history, we need a list of visited messages,
00125     // and where we are in the list.
00126     
00127     // aPos is relative to the current history cursor - 1 is forward, -1 is back.
00128     // Unfortunately, you must call this before navigating to this position,
00129     // because calling this has the side effect of making us adjust our current
00130     // history pos, and *not* adding the loaded message to the history queue.
00131     string getMsgUriAtNavigatePos(in long aPos);
00132     string getFolderUriAtNavigatePos(in long aPos);
00133     attribute long navigatePos;
00134     // if caller just wants the count and cur pos, they can pass in a null history pointer, which will be more efficent
00135     // if they want a list suitable for display in a back/forward menu drop down, they should pass in a aHistory pointer,
00136     // and they'll get returned an array with strings containing something like subject and sender of the message - 
00137     // other possible info is the folder containing the message, and the preview text, if available.
00138     void getNavigateHistory(out unsigned long aCurPos, out unsigned long aCount, [array, size_is(aCount)] out string aHistory);
00139 };
00140