Back to index

lightning-sunbird  0.9+nobinonly
nsIImportMail.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; 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 /*
00039 
00040   Interface for importing mail - ui provided by the import module.  If
00041   you wish to provide your own UI then implement the nsIImportGeneric
00042   interface.
00043 
00044 */
00045 
00046 /*
00047        If you support this interface then the standard mailbox import UI
00048        can be used to drive your import of mailboxes, which means you don't have
00049        to worry about anything other than implementing this interface 
00050        (and nsIImportModule) to import mailboxes.
00051 */
00052 
00053 /*
00054        The general process is:
00055        1) Do you know where the mail is located
00056        2) Do you want the user to "verify" this location and have
00057        the option of specifying a different mail directory?
00058        3) Given a directory (either specified in 1 or 2) build a list
00059        of all of the mailboxes to be imported.
00060        4) Import each mail box to the destination provided!
00061        5) Update the portion of the mailbox imported so far.  This should
00062        always be less than the mailbox size until you are done.  This
00063        is used for progress bar updating and MAY BE CALLED FROM ANOTHER
00064        THREAD!
00065               
00066 */
00067 
00068 #include "nsISupports.idl"
00069 
00070 interface     nsIFileSpec;
00071 interface     nsISupportsArray;
00072 interface     nsIImportMailboxDescriptor;
00073 interface     nsIOutputStream;
00074 
00075 [scriptable, uuid(c9e314c0-234e-11d3-a206-00a0cc26da63)]
00076 interface nsIImportMail : nsISupports
00077 {      
00078        
00079        /*
00080               If found and userVerify BOTH return false, then it is assumed that this
00081               means an error - mail cannot be found on this machine.
00082               If userVerify is true, the user will have an opportunity to specify
00083               a different location to import mail from.
00084        */
00085        void   GetDefaultLocation( out nsIFileSpec location,
00086                                                         out boolean   found,
00087                                                         out boolean   userVerify);  
00088        /*
00089               Returns an nsISupportsArray which contains an nsIImportMailboxID for each 
00090               mailbox.  The array is not sorted before display to the user.
00091        */
00092        nsISupportsArray FindMailboxes( in nsIFileSpec location);
00093        
00094        /*
00095               Import a specific mailbox into the destination file supplied.  If an error
00096               occurs that is non-fatal, the destination will be deleted and other mailbox's
00097               will be imported.  If a fatal error occurs, the destination will be deleted
00098               and the import operation will abort.
00099        */
00100        void   ImportMailbox( in nsIImportMailboxDescriptor source, 
00101                                              in nsIFileSpec destination,
00102                                              out wstring errorLog,
00103                                              out wstring successLog, 
00104                                              out boolean fatalError);
00105        
00106        /*
00107               Return the amount of the mailbox that has been imported so far.  This number
00108               is used to present progress information and must never be larger than the
00109               size specified in nsIImportMailboxID.GetSize();  May be called from
00110               a different thread than ImportMailbox()
00111        */
00112        unsigned long GetImportProgress();
00113 
00114     /* 
00115         * When migrating the local folders from the import source into mozilla,
00116         * we want to translate reserved folder names from the import source to
00117         * equivalent values for Mozilla. 
00118         * Localization Impact is unknown here. 
00119         */
00120        AString translateFolderName(in AString aFolderName);
00121 };
00122        
00123 
00124 
00125 %{ C++
00126 #define kDestTrashFolderName "Trash"
00127 #define kDestUnsentMessagesFolderName "Unsent Messages"
00128 #define kDestSentFolderName "Sent"
00129 #define kDestInboxFolderName "Inbox"
00130 %}