Back to index

lightning-sunbird  0.9+nobinonly
nsIImportGeneric.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        Interface for importing anything.  You are responsible for opening
00040        up UI and doing all of the work to make it happen.
00041   
00042 */
00043 
00044 #include "nsISupports.idl"
00045 
00046 interface nsIDOMWindowInternal;
00047 interface nsISupportsString;
00048 
00049 [scriptable, uuid(9b5c20c0-2348-11d3-a206-00a0cc26da63)]
00050 interface nsIImportGeneric : nsISupports
00051 {      
00052        /* Use these to prepare for the import */
00053               /*
00054                      "mailInterface" - nsIImportMail interface
00055                      "mailBoxes" - nsISupportsArray of nsIImportMailboxDescriptors
00056                      "mailLocation" - nsIFileSpec, source location for mail
00057 
00058                      "addressInterface" - nsIImportAddressBooks interface
00059                      "addressBooks" - nsISupportsArray of nsIImportABDescriptors
00060                      "addressLocation" - src location of address books (if needed!)
00061                      "addressDestination" - uri of destination address book or null if
00062                                                         new address books will be created.
00063               */
00064        nsISupports   GetData( in string dataId);
00065 
00066        void          SetData( in string dataId, in nsISupports pData);
00067        
00068               /*
00069                      "isInstalled" - if true then mail can be automatically located.
00070                      "canUserSetLocation" - if true then the user can specify the location
00071                             to look for mail.  If both are false, then there is no way
00072                             to import mail from this format!  
00073                             TBD: How to specify whether or not a file or a directory
00074                             should be specified?
00075                      "autoFind" - for address books, is the address book located without
00076                             using the file system - i.e. addressLocation is irrelevant.
00077                      "supportsMultiple" - 1 or 1..n address books are imported by this format?
00078 
00079               */
00080        long          GetStatus( in string statusKind);
00081 
00082        /*
00083               When you are ready to import call this.  If it returns TRUE then
00084               you must call BeginImport and then repeatedly call GetProgress until
00085               it returns 100 % done or until ContinueImport returns FALSE.
00086               If this returns FALSE then BeginImport will begin and finish the import
00087               before it returns.
00088        */
00089        boolean              WantsProgress();
00090 
00091        /* Use these for the actual import */
00092               /* Begin import is expected to start a new thread UNLESS WantsProgress returned
00093                      FALSE.  It is REQUIRED to call WantsProgress before calling BeginImport.
00094                      If WantsProgress was false then this will return the success or
00095                      failure of the import.  Failure can be reported even if WantsProgress
00096                      returned TRUE. 
00097                */
00098        boolean         BeginImport( in nsISupportsString successLog, in nsISupportsString errorLog, in boolean isAddrLocHome);       
00099               /*
00100                      If WantsProgress returned TRUE then this will indicate if the import should
00101                      continue.  If this returns FALSE then no other methods should be called
00102                      and the error log should be shown to the user.
00103               */
00104        boolean              ContinueImport();
00105               /*
00106                      Returns the percentage done.  When this returns 100 then the import is done.
00107                      (only valid if WantsProgress returned true)
00108               */
00109        long          GetProgress();
00110               /*
00111                      Cancel an import in progress.  Again, this is only valid if WantsProgress
00112                      returned true.
00113               */
00114        void          CancelImport();
00115 };
00116        
00117 
00118 
00119 %{ C++
00120 
00121 %}