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 Interface for importing anything. You are responsible for opening
40 up UI and doing all of the work to make it happen.
41
42 */
43
44 #include "nsISupports.idl"
45
46 interface nsIDOMWindowInternal;
47 interface nsISupportsString;
48
49 [scriptable, uuid(9b5c20c0-2348-11d3-a206-00a0cc26da63)]
50 interface nsIImportGeneric : nsISupports
51 {
52 /* Use these to prepare for the import */
53 /*
54 "mailInterface" - nsIImportMail interface
55 "mailBoxes" - nsISupportsArray of nsIImportMailboxDescriptors
56 "mailLocation" - nsIFile, source location for mail
57
58 "addressInterface" - nsIImportAddressBooks interface
59 "addressBooks" - nsISupportsArray of nsIImportABDescriptors
60 "addressLocation" - src location of address books (if needed!)
61 "addressDestination" - uri of destination address book or null if
62 new address books will be created.
63 */
64 nsISupports GetData( in string dataId);
65
66 void SetData( in string dataId, in nsISupports pData);
67
68 /*
69 "isInstalled" - if true then mail can be automatically located.
70 "canUserSetLocation" - if true then the user can specify the location
71 to look for mail. If both are false, then there is no way
72 to import mail from this format!
73 TBD: How to specify whether or not a file or a directory
74 should be specified?
75 "autoFind" - for address books, is the address book located without
76 using the file system - i.e. addressLocation is irrelevant.
77 "supportsMultiple" - 1 or 1..n address books are imported by this format?
78
79 */
80 long GetStatus( in string statusKind);
81
82 /*
83 When you are ready to import call this. If it returns TRUE then
84 you must call BeginImport and then repeatedly call GetProgress until
85 it returns 100 % done or until ContinueImport returns FALSE.
86 If this returns FALSE then BeginImport will begin and finish the import
87 before it returns.
88 */
89 boolean WantsProgress();
90
91 /* Use these for the actual import */
92 /* Begin import is expected to start a new thread UNLESS WantsProgress returned
93 FALSE. It is REQUIRED to call WantsProgress before calling BeginImport.
94 If WantsProgress was false then this will return the success or
95 failure of the import. Failure can be reported even if WantsProgress
96 returned TRUE.
97 */
98 boolean BeginImport( in nsISupportsString successLog, in nsISupportsString errorLog, in boolean isAddrLocHome);
99 /*
100 If WantsProgress returned TRUE then this will indicate if the import should
101 continue. If this returns FALSE then no other methods should be called
102 and the error log should be shown to the user.
103 */
104 boolean ContinueImport();
105 /*
106 Returns the percentage done. When this returns 100 then the import is done.
107 (only valid if WantsProgress returned true)
108 */
109 long GetProgress();
110 /*
111 Cancel an import in progress. Again, this is only valid if WantsProgress
112 returned true.
113 */
114 void CancelImport();
115 };
116
117
118
119 %{ C++
120
121 %}