2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 18:33:16 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-09-06 18:24:10 +00:00
|
|
|
*
|
2004-04-17 18:33:16 +00:00
|
|
|
* The contents of this file are subject to the Mozilla 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/MPL/
|
1999-09-06 18:24:10 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00: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-09-06 18:24:10 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 18:33:16 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-28 20:14:13 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:43:54 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 18:33:16 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-28 20:14:13 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-17 18:33:16 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-28 20:14:13 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-17 18:33:16 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-09-06 18:24:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Interface for importing anything. You are responsible for opening
|
|
|
|
up UI and doing all of the work to make it happen.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2000-09-01 01:54:35 +00:00
|
|
|
interface nsIDOMWindowInternal;
|
2002-08-06 00:53:19 +00:00
|
|
|
interface nsISupportsString;
|
1999-09-06 18:24:10 +00:00
|
|
|
|
|
|
|
[scriptable, uuid(9b5c20c0-2348-11d3-a206-00a0cc26da63)]
|
|
|
|
interface nsIImportGeneric : nsISupports
|
|
|
|
{
|
|
|
|
/* Use these to prepare for the import */
|
|
|
|
/*
|
|
|
|
"mailInterface" - nsIImportMail interface
|
|
|
|
"mailBoxes" - nsISupportsArray of nsIImportMailboxDescriptors
|
|
|
|
"mailLocation" - nsIFileSpec, source location for mail
|
|
|
|
|
|
|
|
"addressInterface" - nsIImportAddressBooks interface
|
|
|
|
"addressBooks" - nsISupportsArray of nsIImportABDescriptors
|
|
|
|
"addressLocation" - src location of address books (if needed!)
|
|
|
|
"addressDestination" - uri of destination address book or null if
|
|
|
|
new address books will be created.
|
|
|
|
*/
|
|
|
|
nsISupports GetData( in string dataId);
|
|
|
|
|
|
|
|
void SetData( in string dataId, in nsISupports pData);
|
|
|
|
|
|
|
|
/*
|
|
|
|
"isInstalled" - if true then mail can be automatically located.
|
|
|
|
"canUserSetLocation" - if true then the user can specify the location
|
|
|
|
to look for mail. If both are false, then there is no way
|
|
|
|
to import mail from this format!
|
|
|
|
TBD: How to specify whether or not a file or a directory
|
|
|
|
should be specified?
|
|
|
|
"autoFind" - for address books, is the address book located without
|
|
|
|
using the file system - i.e. addressLocation is irrelevant.
|
|
|
|
"supportsMultiple" - 1 or 1..n address books are imported by this format?
|
|
|
|
|
|
|
|
*/
|
|
|
|
long GetStatus( in string statusKind);
|
|
|
|
|
|
|
|
/*
|
|
|
|
When you are ready to import call this. If it returns TRUE then
|
|
|
|
you must call BeginImport and then repeatedly call GetProgress until
|
|
|
|
it returns 100 % done or until ContinueImport returns FALSE.
|
|
|
|
If this returns FALSE then BeginImport will begin and finish the import
|
|
|
|
before it returns.
|
|
|
|
*/
|
|
|
|
boolean WantsProgress();
|
|
|
|
|
|
|
|
/* Use these for the actual import */
|
|
|
|
/* Begin import is expected to start a new thread UNLESS WantsProgress returned
|
|
|
|
FALSE. It is REQUIRED to call WantsProgress before calling BeginImport.
|
|
|
|
If WantsProgress was false then this will return the success or
|
|
|
|
failure of the import. Failure can be reported even if WantsProgress
|
|
|
|
returned TRUE.
|
|
|
|
*/
|
2002-08-06 00:53:19 +00:00
|
|
|
boolean BeginImport( in nsISupportsString successLog, in nsISupportsString errorLog, in boolean isAddrLocHome);
|
1999-09-06 18:24:10 +00:00
|
|
|
/*
|
|
|
|
If WantsProgress returned TRUE then this will indicate if the import should
|
|
|
|
continue. If this returns FALSE then no other methods should be called
|
|
|
|
and the error log should be shown to the user.
|
|
|
|
*/
|
|
|
|
boolean ContinueImport();
|
|
|
|
/*
|
|
|
|
Returns the percentage done. When this returns 100 then the import is done.
|
|
|
|
(only valid if WantsProgress returned true)
|
|
|
|
*/
|
|
|
|
long GetProgress();
|
|
|
|
/*
|
|
|
|
Cancel an import in progress. Again, this is only valid if WantsProgress
|
|
|
|
returned true.
|
|
|
|
*/
|
|
|
|
void CancelImport();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%{ C++
|
|
|
|
|
|
|
|
%}
|