Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / toolkit / profile / public / nsIToolkitProfile.idl
blob4b083aed66ebab5ec28803ef6cf61c18fdae903b
1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is the new Mozilla toolkit.
17 * The Initial Developer of the Original Code is
18 * Benjamin Smedberg <bsmedberg@covad.net>
19 * Portions created by the Initial Developer are Copyright (C) 2004
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsISupports.idl"
40 interface nsILocalFile;
41 interface nsIToolkitProfile;
42 interface nsIProfileUnlocker;
44 /**
45 * Hold on to a profile lock. Once you release the last reference to this
46 * interface, the profile lock is released.
48 [scriptable, uuid(50e07b0a-f338-4da3-bcdb-f4bb0db94dbe)]
49 interface nsIProfileLock : nsISupports
51 /**
52 * The main profile directory.
54 readonly attribute nsILocalFile directory;
56 /**
57 * A directory corresponding to the main profile directory that exists for
58 * the purpose of storing data on the local filesystem, including cache
59 * files or other data files that may not represent critical user data.
60 * (e.g., this directory may not be included as part of a backup scheme.)
62 * In some cases, this directory may just be the main profile directory.
64 readonly attribute nsILocalFile localDirectory;
66 /**
67 * Unlock the profile.
69 void unlock();
72 /**
73 * A interface representing a profile.
74 * @note THIS INTERFACE SHOULD BE IMPLEMENTED BY THE TOOLKIT CODE ONLY! DON'T
75 * EVEN THINK ABOUT IMPLEMENTING THIS IN JAVASCRIPT!
77 [scriptable, uuid(7422b090-4a86-4407-972e-75468a625388)]
78 interface nsIToolkitProfile : nsISupports
80 /**
81 * The location of the profile directory.
83 readonly attribute nsILocalFile rootDir;
85 /**
86 * The location of the profile local directory, which may be the same as
87 * the root directory. See nsIProfileLock::localDirectory.
89 readonly attribute nsILocalFile localDir;
91 /**
92 * The name of the profile.
94 attribute AUTF8String name;
96 /**
97 * Removes the profile from the registry of profiles.
99 * @param removeFiles
100 * Indicates whether or not the profile directory should be
101 * removed in addition.
103 void remove(in boolean removeFiles);
106 * Lock this profile using platform-specific locking methods.
108 * @param lockFile If locking fails, this may return a lockFile object
109 * which can be used in platform-specific ways to
110 * determine which process has the file locked. Null
111 * may be passed.
112 * @return An interface which holds a profile lock as long as you reference
113 * it.
114 * @throws NS_ERROR_FILE_ACCESS_DENIED if the profile was already locked.
116 nsIProfileLock lock(out nsIProfileUnlocker aUnlocker);