Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
nsProfileMigratorBase Class Reference

#include <nsProfileMigratorBase.h>

Inheritance diagram for nsProfileMigratorBase:
Inheritance graph
[legend]
Collaboration diagram for nsProfileMigratorBase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsProfileMigratorBase ()
virtual ~nsProfileMigratorBase ()
virtual nsresult ContinueImport ()=0

Protected Member Functions

nsresult ImportSettings (nsIImportModule *aImportModule)
nsresult ImportAddressBook (nsIImportModule *aImportModule)
nsresult ImportMailData (nsIImportModule *aImportModule)
nsresult FinishCopyingAddressBookData ()
nsresult FinishCopyingMailFolders ()

Protected Attributes

nsCOMPtr< nsIObserverServicemObserverService
nsCOMPtr< nsITimermFileIOTimer
nsCOMPtr< nsIImportGenericmGenericImporter
nsCOMPtr< nsIImportModulemImportModule
nsCOMPtr< nsIMsgAccountmLocalFolderAccount
PRBool mProcessingMailFolders

Detailed Description

Definition at line 50 of file nsProfileMigratorBase.h.


Constructor & Destructor Documentation

Definition at line 59 of file nsProfileMigratorBase.cpp.

{
  mObserverService = do_GetService("@mozilla.org/observer-service;1");
  mProcessingMailFolders = PR_FALSE;
}

Here is the call graph for this function:

Definition at line 65 of file nsProfileMigratorBase.cpp.

{           
  if (mFileIOTimer)
    mFileIOTimer->Cancel();
}

Member Function Documentation

virtual nsresult nsProfileMigratorBase::ContinueImport ( ) [pure virtual]

Implemented in nsEudoraProfileMigrator, nsOEProfileMigrator, and nsOutlookProfileMigrator.

Here is the caller graph for this function:

Definition at line 123 of file nsProfileMigratorBase.cpp.

{
  nsAutoString index;
  index.AppendInt(nsIMailProfileMigrator::ADDRESSBOOK_DATA); 
  NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get());

  // now kick off the mail migration code
  ImportMailData(mImportModule);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 169 of file nsProfileMigratorBase.cpp.

{
  nsAutoString index;
  index.AppendInt(nsIMailProfileMigrator::MAILDATA); 
  NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get());

  // migration is now done...notify the UI.
  NOTIFY_OBSERVERS(MIGRATION_ENDED, nsnull);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 92 of file nsProfileMigratorBase.cpp.

{  
  nsresult rv; 
  
  nsAutoString index;
  index.AppendInt(nsIMailProfileMigrator::ADDRESSBOOK_DATA); 
  NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());

  rv = aImportModule->GetImportInterface(NS_IMPORT_ADDRESS_STR, getter_AddRefs(mGenericImporter));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsISupportsCString> pabString = do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  // we want to migrate the outlook express addressbook into our personal address book
  pabString->SetData(nsDependentCString(kPersonalAddressbookUri));
  mGenericImporter->SetData("addressDestination", pabString);

  PRBool importResult;
  PRBool wantsProgress;
  mGenericImporter->WantsProgress(&wantsProgress);
  rv = mGenericImporter->BeginImport(nsnull, nsnull, PR_TRUE, &importResult);

  if (wantsProgress)
    ContinueImport();
  else
    FinishCopyingAddressBookData();

  return rv;
}

Here is the call graph for this function:

Definition at line 135 of file nsProfileMigratorBase.cpp.

{
  nsresult rv; 
  
  nsAutoString index;
  index.AppendInt(nsIMailProfileMigrator::MAILDATA); 
  NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());

  rv = aImportModule->GetImportInterface(NS_IMPORT_MAIL_STR, getter_AddRefs(mGenericImporter));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsISupportsPRBool> migrating = do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  // by setting the migration flag, we force the import utility to install local folders from OE
  // directly into Local Folders and not as a subfolder
  migrating->SetData(PR_TRUE);
  mGenericImporter->SetData("migration", migrating);

  PRBool importResult;
  PRBool wantsProgress;
  mGenericImporter->WantsProgress(&wantsProgress);
  rv = mGenericImporter->BeginImport(nsnull, nsnull, PR_TRUE, &importResult);

  mProcessingMailFolders = PR_TRUE;

  if (wantsProgress)
    ContinueImport();
  else
    FinishCopyingMailFolders();

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 71 of file nsProfileMigratorBase.cpp.

{  
  nsresult rv; 
  
  nsAutoString index;
  index.AppendInt(nsIMailProfileMigrator::ACCOUNT_SETTINGS); 
  NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());

  nsCOMPtr<nsIImportSettings> importSettings;
  rv = aImportModule->GetImportInterface(NS_IMPORT_SETTINGS_STR, getter_AddRefs(importSettings));
  NS_ENSURE_SUCCESS(rv, rv);

  PRBool importedSettings = PR_FALSE;

  rv = importSettings->Import(getter_AddRefs(mLocalFolderAccount), &importedSettings);

  NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get());

  return rv;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 65 of file nsProfileMigratorBase.h.

Definition at line 66 of file nsProfileMigratorBase.h.

Definition at line 67 of file nsProfileMigratorBase.h.

Definition at line 68 of file nsProfileMigratorBase.h.

Definition at line 64 of file nsProfileMigratorBase.h.

Definition at line 69 of file nsProfileMigratorBase.h.


The documentation for this class was generated from the following files: