Backed out changesets 5309d91dc590, b2afa18bea00, and 610b1e0c7562 (bug 951976) for...
[gecko.git] / toolkit / profile / nsIToolkitProfileService.idl
blob6d76c6151a2cd52b36947408b9c9ce699768c54e
1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsISimpleEnumerator;
9 interface nsIFile;
10 interface nsIToolkitProfile;
11 interface nsIProfileLock;
13 [scriptable, uuid(b81c33a6-1ce8-4695-856b-02b7f15cc114)]
14 interface nsIToolkitProfileService : nsISupports
16 attribute boolean startWithLastProfile;
17 attribute boolean startOffline;
19 readonly attribute nsISimpleEnumerator /*nsIToolkitProfile*/ profiles;
21 attribute nsIToolkitProfile selectedProfile;
23 /**
24 * Get a profile by name. This is mainly for use by the -P
25 * commandline flag.
27 * @param aName The profile name to find.
29 nsIToolkitProfile getProfileByName(in AUTF8String aName);
31 /**
32 * Lock an arbitrary path as a profile. If the path does not exist, it
33 * will be created and the defaults copied from the application directory.
35 nsIProfileLock lockProfilePath(in nsIFile aDirectory,
36 in nsIFile aTempDirectory);
38 /**
39 * Create a new profile.
41 * The profile temporary directory will be chosen based on where the
42 * profile directory is located.
44 * @param aRootDir
45 * The profile directory. May be null, in which case a suitable
46 * default will be chosen based on the profile name.
47 * @param aName
48 * The profile name.
50 nsIToolkitProfile createProfile(in nsIFile aRootDir,
51 in AUTF8String aName);
53 /**
54 * Create the default profile for an application.
56 * The profile will be typically in
57 * {Application Data}/.profilename/{salt}.default or
58 * {Application Data}/.appname/{salt}.default
59 * or if aVendorName is provided
60 * {Application Data}/.vendor/appname/{salt}.default
62 * @note Either aProfileName or aAppName must be non-empty
64 * The contents of aProfileDefaultsDir will be copied to the
65 * new profile directory.
67 * @param aProfileName
68 * The name of the profile
69 * @param aAppName
70 * The name of the application
71 * @param aVendorName
72 * The name of the vendor
73 * @param aProfileDefaultsDir
74 * The location where the profile defaults are.
75 * @return The created profile.
76 */
77 nsIToolkitProfile createDefaultProfileForApp(in AUTF8String aProfileName,
78 in AUTF8String aAppName,
79 in AUTF8String aVendorName,
80 [optional] in nsIFile aProfileDefaultsDir);
82 /**
83 * Returns the number of profiles.
84 * @return 0, 1, or 2. More than 2 profiles will always return 2.
86 readonly attribute unsigned long profileCount;
88 /**
89 * Flush the profiles list file.
91 void flush();
94 %{C++
95 #define NS_PROFILESERVICE_CONTRACTID "@mozilla.org/toolkit/profile-service;1"