michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: interface nsIFile; michael@0: michael@0: /** michael@0: * Helper interface for nsIProfileMigrator. michael@0: * michael@0: * @provider Toolkit (Startup code) michael@0: * @client Application (Profile-migration code) michael@0: * @obtainable nsIProfileMigrator.migrate michael@0: */ michael@0: [scriptable, uuid(048e5ca1-0eb7-4bb1-a9a2-a36f7d4e0e3c)] michael@0: interface nsIProfileStartup : nsISupports michael@0: { michael@0: /** michael@0: * The root directory of the semi-current profile, during profile migration. michael@0: * After nsIProfileMigrator.migrate has returned, this object will not be michael@0: * useful. michael@0: */ michael@0: readonly attribute nsIFile directory; michael@0: michael@0: /** michael@0: * Do profile-startup by setting NS_APP_USER_PROFILE_50_DIR in the directory michael@0: * service and notifying the profile-startup observer topics. michael@0: */ michael@0: void doStartup(); michael@0: }; michael@0: michael@0: /** michael@0: * Migrate application settings from an outside source. michael@0: * michael@0: * @provider Application (Profile-migration code) michael@0: * @client Toolkit (Startup code) michael@0: * @obtainable service, contractid("@mozilla.org/toolkit/profile-migrator;1") michael@0: */ michael@0: [scriptable, uuid(3df284a5-2258-4d46-a664-761ecdc04c22)] michael@0: interface nsIProfileMigrator : nsISupports michael@0: { michael@0: /** michael@0: * Migrate data from an outside source, if possible. Does nothing michael@0: * otherwise. michael@0: * michael@0: * When this method is called, a default profile has been created; michael@0: * XPCOM has been initialized such that compreg.dat is in the michael@0: * profile; the directory service does *not* return a key for michael@0: * NS_APP_USER_PROFILE_50_DIR or any of the keys depending on an active michael@0: * profile. To figure out the directory of the "current" profile, use michael@0: * aStartup.directory. michael@0: * michael@0: * If your migrator needs to access services that use the profile (to michael@0: * set profile prefs or bookmarks, for example), use aStartup.doStartup. michael@0: * michael@0: * @param aStartup nsIProfileStartup object to use during migration. michael@0: * @param aKey optional key of a migrator to use to skip source selection. michael@0: * michael@0: * @note The startup code ignores COM exceptions thrown from this method. michael@0: */ michael@0: void migrate(in nsIProfileStartup aStartup, in ACString aKey); michael@0: }; michael@0: michael@0: %{C++ michael@0: #define NS_PROFILEMIGRATOR_CONTRACTID "@mozilla.org/toolkit/profile-migrator;1" michael@0: %}