Backed out changeset c3cca6dfcaa7 for landing with the wrong bug number.
[gecko.git] / toolkit / profile / nsIToolkitProfile.idl
blob8d0c07c51564f5bc1e30141d4d46b47cb931828e
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 nsIFile;
9 interface nsIProfileUnlocker;
11 /**
12 * Hold on to a profile lock. Once you release the last reference to this
13 * interface, the profile lock is released.
15 [scriptable, uuid(7c58c703-d245-4864-8d75-9648ca4a6139)]
16 interface nsIProfileLock : nsISupports
18 /**
19 * The main profile directory.
21 readonly attribute nsIFile directory;
23 /**
24 * A directory corresponding to the main profile directory that exists for
25 * the purpose of storing data on the local filesystem, including cache
26 * files or other data files that may not represent critical user data.
27 * (e.g., this directory may not be included as part of a backup scheme.)
29 * In some cases, this directory may just be the main profile directory.
31 readonly attribute nsIFile localDirectory;
33 /**
34 * The timestamp of an existing profile lock at lock time.
36 readonly attribute PRTime replacedLockTime;
38 /**
39 * Unlock the profile.
41 void unlock();
44 /**
45 * A interface representing a profile.
46 * @note THIS INTERFACE SHOULD BE IMPLEMENTED BY THE TOOLKIT CODE ONLY! DON'T
47 * EVEN THINK ABOUT IMPLEMENTING THIS IN JAVASCRIPT!
49 [scriptable, uuid(7422b090-4a86-4407-972e-75468a625388)]
50 interface nsIToolkitProfile : nsISupports
52 /**
53 * The location of the profile directory.
55 readonly attribute nsIFile rootDir;
57 /**
58 * The location of the profile local directory, which may be the same as
59 * the root directory. See nsIProfileLock::localDirectory.
61 readonly attribute nsIFile localDir;
63 /**
64 * The name of the profile.
66 attribute AUTF8String name;
68 /**
69 * Removes the profile from the registry of profiles.
71 * @param removeFiles
72 * Indicates whether or not the profile directory should be
73 * removed in addition.
75 void remove(in boolean removeFiles);
77 /**
78 * Lock this profile using platform-specific locking methods.
80 * @param lockFile If locking fails, this may return a lockFile object
81 * which can be used in platform-specific ways to
82 * determine which process has the file locked. Null
83 * may be passed.
84 * @return An interface which holds a profile lock as long as you reference
85 * it.
86 * @throws NS_ERROR_FILE_ACCESS_DENIED if the profile was already locked.
88 nsIProfileLock lock(out nsIProfileUnlocker aUnlocker);