/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*

  The import service.

 */

#include "nsISupports.idl"
#include "nsIMsgSend.idl"

interface nsIImportModule;
interface nsIImportMailboxDescriptor;
interface nsIImportABDescriptor;
interface nsIImportGeneric;
interface nsIImportFieldMap;
interface nsIMsgSendListener;
interface nsIMsgCompFields;
interface nsIMsgSendListener;
interface nsIArray;

[scriptable, uuid(376fc4c2-76d3-4b47-8095-406260cb9b1f)]
interface nsIImportService : nsISupports
{
    void DiscoverModules();

  long GetModuleCount( in string filter);
  void GetModuleInfo( in string filter, in long index, out wstring name, out wstring description);
  wstring GetModuleName( in string filter, in long index);
  wstring GetModuleDescription( in string filter, in long index);
  nsIImportModule  GetModule( in string filter, in long index);
  nsIImportModule GetModuleWithCID( in nsCIDRef cid);

  nsIImportFieldMap      CreateNewFieldMap();
  nsIImportMailboxDescriptor  CreateNewMailboxDescriptor();
  nsIImportABDescriptor    CreateNewABDescriptor();
  nsIImportGeneric      CreateNewGenericMail();
  nsIImportGeneric      CreateNewGenericAddressBooks();
  void CreateRFC822Message(in nsIMsgIdentity aIdentity,
                           in nsIMsgCompFields aMsgFields,
                           in string aBodytype,
                           in string aBody,
                           in unsigned long aBodyLength,
                           in boolean aCreateAsDraft,
                           in nsIArray aLoadedAttachments,
                           in nsISupportsArray aEmbeddedObjects,
                           in nsIMsgSendListener aListener);

};

%{ C++
#define NS_IMPORTSERVICE_CID              \
{ /* 5df96d60-1726-11d3-a206-00a0cc26da63 */      \
   0x5df96d60, 0x1726, 0x11d3,                   \
   {0xa2, 0x06, 0x0, 0xa0, 0xcc, 0x26, 0xda, 0x63}}

#define NS_IMPORTSERVICE_CONTRACTID "@mozilla.org/import/import-service;1"
%}
