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