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
;
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
;
24 * Get a profile by name. This is mainly for use by the -P
27 * @param aName The profile name to find.
29 nsIToolkitProfile getProfileByName
(in AUTF8String aName
);
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
);
39 * Create a new profile.
41 * The profile temporary directory will be chosen based on where the
42 * profile directory is located.
45 * The profile directory. May be null, in which case a suitable
46 * default will be chosen based on the profile name.
50 nsIToolkitProfile createProfile
(in nsIFile aRootDir
,
51 in AUTF8String aName
);
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.
68 * The name of the profile
70 * The name of the application
72 * The name of the vendor
73 * @param aProfileDefaultsDir
74 * The location where the profile defaults are.
75 * @return The created profile.
77 nsIToolkitProfile createDefaultProfileForApp
(in AUTF8String aProfileName
,
78 in AUTF8String aAppName
,
79 in AUTF8String aVendorName
,
80 [optional] in nsIFile aProfileDefaultsDir
);
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
;
89 * Flush the profiles list file.
95 #define NS_PROFILESERVICE_CONTRACTID
"@mozilla.org/toolkit/profile-service;1"