Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / toolkit / profile / public / nsIProfileMigrator.idl
blobac31671f217abd6d2f3faa00f17a75791c6eb672
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is The Browser Profile Migrator.
17 * The Initial Developer of the Original Code is Ben Goodger.
18 * Portions created by the Initial Developer are Copyright (C) 2004
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
22 * Ben Goodger <ben@bengoodger.com>
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsISupports.idl"
39 interface nsIFile;
41 /**
42 * Helper interface for nsIProfileMigrator.
44 * @provider Toolkit (Startup code)
45 * @client Application (Profile-migration code)
46 * @obtainable nsIProfileMigrator.migrate
48 [scriptable, uuid(048e5ca1-0eb7-4bb1-a9a2-a36f7d4e0e3c)]
49 interface nsIProfileStartup : nsISupports
51 /**
52 * The root directory of the semi-current profile, during profile migration.
53 * After nsIProfileMigrator.migrate has returned, this object will not be
54 * useful.
56 readonly attribute nsIFile directory;
58 /**
59 * Do profile-startup by setting NS_APP_USER_PROFILE_50_DIR in the directory
60 * service and notifying the profile-startup observer topics.
62 void doStartup();
65 /**
66 * Migrate application settings from an outside source.
68 * @provider Application (Profile-migration code)
69 * @client Toolkit (Startup code)
70 * @obtainable service, contractid("@mozilla.org/toolkit/profile-migrator;1")
72 [scriptable, uuid(24ce8b9d-b7ff-4279-aef4-26e158f03e34)]
73 interface nsIProfileMigrator : nsISupports
75 /**
76 * Import existing profile paths. When the app is started the first
77 * time, if there are no INI-style profiles, appstartup will call
78 * this method to import any registry- style profiles that may
79 * exist. When this method is called, there is no event queue
80 * service and this method should not attempt to use the network or
81 * show any GUI.
83 * @note You don't actually have to move the profile data. Just call
84 * nsIToolkitProfileService.create on the existing profile path(s).
86 void import();
88 /**
89 * Do profile migration.
91 * When this method is called, a default profile has been created;
92 * XPCOM has been initialized such that compreg.dat is in the
93 * profile; the directory service does *not* return a key for
94 * NS_APP_USER_PROFILE_50_DIR or any of the keys depending on an active
95 * profile. To figure out the directory of the "current" profile, use
96 * aStartup.directory.
98 * If your migrator needs to access services that use the profile (to
99 * set profile prefs or bookmarks, for example), use aStartup.doStartup.
101 * The startup code ignores COM exceptions thrown from this method.
103 void migrate(in nsIProfileStartup aStartup);
106 %{C++
107 #define NS_PROFILEMIGRATOR_CONTRACTID "@mozilla.org/toolkit/profile-migrator;1"