|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 interface nsIURI; |
|
10 interface imgIRequest; |
|
11 interface nsIProperties; |
|
12 |
|
13 /** |
|
14 * imgICache interface |
|
15 * |
|
16 * @author Stuart Parmenter <pavlov@netscape.com> |
|
17 * @version 0.1 |
|
18 * @see imagelib2 |
|
19 */ |
|
20 [scriptable, builtinclass, uuid(b06e0fa5-d6e2-4fa3-8fc0-7775aed96522)] |
|
21 interface imgICache : nsISupports |
|
22 { |
|
23 /** |
|
24 * Evict images from the cache. |
|
25 * |
|
26 * @param chrome If TRUE, evict only chrome images. |
|
27 * If FALSE, evict everything except chrome images. |
|
28 */ |
|
29 void clearCache(in boolean chrome); |
|
30 |
|
31 /** |
|
32 * Evict images from the cache. |
|
33 * |
|
34 * @param uri The URI to remove. |
|
35 * @throws NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from the cache. |
|
36 */ |
|
37 void removeEntry(in nsIURI uri); |
|
38 |
|
39 /** |
|
40 * Find Properties |
|
41 * Used to get properties such as 'type' and 'content-disposition' |
|
42 * 'type' is a nsISupportsCString containing the images' mime type such as 'image/png' |
|
43 * 'content-disposition' will be a nsISupportsCString containing the header |
|
44 * If you call this before any data has been loaded from a URI, it will succeed, |
|
45 * but come back empty. |
|
46 * |
|
47 * Hopefully this will be removed with bug 805119 |
|
48 * |
|
49 * @param uri The URI to look up. |
|
50 * @returns NULL if the URL was not found in the cache |
|
51 */ |
|
52 nsIProperties findEntryProperties(in nsIURI uri); |
|
53 |
|
54 /** |
|
55 * Make this cache instance respect private browsing notifications. This entails clearing |
|
56 * the chrome and content caches whenever the last-pb-context-exited notification is |
|
57 * observed. |
|
58 */ |
|
59 void respectPrivacyNotifications(); |
|
60 }; |