Bug 1885580 - Add a MenuGroup component for the menu redesign r=android-reviewers,007
[gecko.git] / toolkit / profile / nsIToolkitProfile.idl
blobb194cd956382039f24844ded1f2b0edb2fbca2ee
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, builtinclass, 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 * Removes the profile from the registry of profiles.
79 * The profile directory is removed in the stream transport thread.
81 * @param removeFiles
82 * Indicates whether or not the profile directory should be
83 * removed in addition.
85 void removeInBackground(in boolean removeFiles);
87 /**
88 * Lock this profile using platform-specific locking methods.
90 * @param lockFile If locking fails, this may return a lockFile object
91 * which can be used in platform-specific ways to
92 * determine which process has the file locked. Null
93 * may be passed.
94 * @return An interface which holds a profile lock as long as you reference
95 * it.
96 * @throws NS_ERROR_FILE_ACCESS_DENIED if the profile was already locked.
98 nsIProfileLock lock(out nsIProfileUnlocker aUnlocker);