michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: interface imgIRequest; michael@0: interface nsIProperties; michael@0: michael@0: /** michael@0: * imgICache interface michael@0: * michael@0: * @author Stuart Parmenter michael@0: * @version 0.1 michael@0: * @see imagelib2 michael@0: */ michael@0: [scriptable, builtinclass, uuid(b06e0fa5-d6e2-4fa3-8fc0-7775aed96522)] michael@0: interface imgICache : nsISupports michael@0: { michael@0: /** michael@0: * Evict images from the cache. michael@0: * michael@0: * @param chrome If TRUE, evict only chrome images. michael@0: * If FALSE, evict everything except chrome images. michael@0: */ michael@0: void clearCache(in boolean chrome); michael@0: michael@0: /** michael@0: * Evict images from the cache. michael@0: * michael@0: * @param uri The URI to remove. michael@0: * @throws NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from the cache. michael@0: */ michael@0: void removeEntry(in nsIURI uri); michael@0: michael@0: /** michael@0: * Find Properties michael@0: * Used to get properties such as 'type' and 'content-disposition' michael@0: * 'type' is a nsISupportsCString containing the images' mime type such as 'image/png' michael@0: * 'content-disposition' will be a nsISupportsCString containing the header michael@0: * If you call this before any data has been loaded from a URI, it will succeed, michael@0: * but come back empty. michael@0: * michael@0: * Hopefully this will be removed with bug 805119 michael@0: * michael@0: * @param uri The URI to look up. michael@0: * @returns NULL if the URL was not found in the cache michael@0: */ michael@0: nsIProperties findEntryProperties(in nsIURI uri); michael@0: michael@0: /** michael@0: * Make this cache instance respect private browsing notifications. This entails clearing michael@0: * the chrome and content caches whenever the last-pb-context-exited notification is michael@0: * observed. michael@0: */ michael@0: void respectPrivacyNotifications(); michael@0: };