1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 /*
39
40 Interface for importing mail - ui provided by the import module. If
41 you wish to provide your own UI then implement the nsIImportGeneric
42 interface.
43
44 */
45
46 /*
47 If you support this interface then the standard mailbox import UI
48 can be used to drive your import of mailboxes, which means you don't have
49 to worry about anything other than implementing this interface
50 (and nsIImportModule) to import mailboxes.
51 */
52
53 /*
54 The general process is:
55 1) Do you know where the mail is located
56 2) Do you want the user to "verify" this location and have
57 the option of specifying a different mail directory?
58 3) Given a directory (either specified in 1 or 2) build a list
59 of all of the mailboxes to be imported.
60 4) Import each mail box to the destination provided!
61 5) Update the portion of the mailbox imported so far. This should
62 always be less than the mailbox size until you are done. This
63 is used for progress bar updating and MAY BE CALLED FROM ANOTHER
64 THREAD!
65
66 */
67
68 #include "nsISupports.idl"
69
70 interface nsIFile;
71 interface nsISupportsArray;
72 interface nsIImportMailboxDescriptor;
73 interface nsIOutputStream;
74
75 [scriptable, uuid(c9e314c0-234e-11d3-a206-00a0cc26da63)]
76 interface nsIImportMail : nsISupports
77 {
78
79 /*
80 If found and userVerify BOTH return false, then it is assumed that this
81 means an error - mail cannot be found on this machine.
82 If userVerify is true, the user will have an opportunity to specify
83 a different location to import mail from.
84 */
85 void GetDefaultLocation( out nsIFile location,
86 out boolean found,
87 out boolean userVerify);
88 /*
89 Returns an nsISupportsArray which contains an nsIImportMailboxID for each
90 mailbox. The array is not sorted before display to the user.
91 */
92 nsISupportsArray FindMailboxes( in nsIFile location);
93
94 /*
95 Import a specific mailbox into the destination file supplied. If an error
96 occurs that is non-fatal, the destination will be deleted and other mailboxes
97 will be imported. If a fatal error occurs, the destination will be deleted
98 and the import operation will abort.
99 */
100 void ImportMailbox( in nsIImportMailboxDescriptor source,
101 in nsIFile destination,
102 out wstring errorLog,
103 out wstring successLog,
104 out boolean fatalError);
105
106 /*
107 Return the amount of the mailbox that has been imported so far. This number
108 is used to present progress information and must never be larger than the
109 size specified in nsIImportMailboxID.GetSize(); May be called from
110 a different thread than ImportMailbox()
111 */
112 unsigned long GetImportProgress();
113
114 /*
115 * When migrating the local folders from the import source into mozilla,
116 * we want to translate reserved folder names from the import source to
117 * equivalent values for Mozilla.
118 * Localization Impact is unknown here.
119 */
120 AString translateFolderName(in AString aFolderName);
121 };
122
123
124
125 %{ C++
126 #define kDestTrashFolderName "Trash"
127 #define kDestUnsentMessagesFolderName "Unsent Messages"
128 #define kDestSentFolderName "Sent"
129 #define kDestInboxFolderName "Inbox"
130 %}