1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/profile/nsIProfileMigrator.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,67 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 +interface nsIFile; 1.11 + 1.12 +/** 1.13 + * Helper interface for nsIProfileMigrator. 1.14 + * 1.15 + * @provider Toolkit (Startup code) 1.16 + * @client Application (Profile-migration code) 1.17 + * @obtainable nsIProfileMigrator.migrate 1.18 + */ 1.19 +[scriptable, uuid(048e5ca1-0eb7-4bb1-a9a2-a36f7d4e0e3c)] 1.20 +interface nsIProfileStartup : nsISupports 1.21 +{ 1.22 + /** 1.23 + * The root directory of the semi-current profile, during profile migration. 1.24 + * After nsIProfileMigrator.migrate has returned, this object will not be 1.25 + * useful. 1.26 + */ 1.27 + readonly attribute nsIFile directory; 1.28 + 1.29 + /** 1.30 + * Do profile-startup by setting NS_APP_USER_PROFILE_50_DIR in the directory 1.31 + * service and notifying the profile-startup observer topics. 1.32 + */ 1.33 + void doStartup(); 1.34 +}; 1.35 + 1.36 +/** 1.37 + * Migrate application settings from an outside source. 1.38 + * 1.39 + * @provider Application (Profile-migration code) 1.40 + * @client Toolkit (Startup code) 1.41 + * @obtainable service, contractid("@mozilla.org/toolkit/profile-migrator;1") 1.42 + */ 1.43 +[scriptable, uuid(3df284a5-2258-4d46-a664-761ecdc04c22)] 1.44 +interface nsIProfileMigrator : nsISupports 1.45 +{ 1.46 + /** 1.47 + * Migrate data from an outside source, if possible. Does nothing 1.48 + * otherwise. 1.49 + * 1.50 + * When this method is called, a default profile has been created; 1.51 + * XPCOM has been initialized such that compreg.dat is in the 1.52 + * profile; the directory service does *not* return a key for 1.53 + * NS_APP_USER_PROFILE_50_DIR or any of the keys depending on an active 1.54 + * profile. To figure out the directory of the "current" profile, use 1.55 + * aStartup.directory. 1.56 + * 1.57 + * If your migrator needs to access services that use the profile (to 1.58 + * set profile prefs or bookmarks, for example), use aStartup.doStartup. 1.59 + * 1.60 + * @param aStartup nsIProfileStartup object to use during migration. 1.61 + * @param aKey optional key of a migrator to use to skip source selection. 1.62 + * 1.63 + * @note The startup code ignores COM exceptions thrown from this method. 1.64 + */ 1.65 + void migrate(in nsIProfileStartup aStartup, in ACString aKey); 1.66 +}; 1.67 + 1.68 +%{C++ 1.69 +#define NS_PROFILEMIGRATOR_CONTRACTID "@mozilla.org/toolkit/profile-migrator;1" 1.70 +%}