imgICache.idl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #include "nsISupports.idl"
  7. interface imgIRequest;
  8. interface nsIDocument;
  9. interface nsIDOMDocument;
  10. interface nsIProperties;
  11. interface nsIURI;
  12. /**
  13. * imgICache interface
  14. *
  15. * @author Stuart Parmenter <pavlov@netscape.com>
  16. * @version 0.1
  17. * @see imagelib2
  18. */
  19. [scriptable, builtinclass, uuid(bfdf23ff-378e-402e-8a6c-840f0c82b6c3)]
  20. interface imgICache : nsISupports
  21. {
  22. /**
  23. * Evict images from the cache.
  24. *
  25. * @param chrome If TRUE, evict only chrome images.
  26. * If FALSE, evict everything except chrome images.
  27. */
  28. void clearCache(in boolean chrome);
  29. /**
  30. * Find Properties
  31. * Used to get properties such as 'type' and 'content-disposition'
  32. * 'type' is a nsISupportsCString containing the images' mime type such as
  33. * 'image/png'
  34. * 'content-disposition' will be a nsISupportsCString containing the header
  35. * If you call this before any data has been loaded from a URI, it will
  36. * succeed, but come back empty.
  37. *
  38. * Hopefully this will be removed with bug 805119
  39. *
  40. * @param uri The URI to look up.
  41. * @param doc Optional pointer to the document that the cache entry belongs to.
  42. * @returns NULL if the URL was not found in the cache
  43. */
  44. [must_use]
  45. nsIProperties findEntryProperties(in nsIURI uri,
  46. [optional] in nsIDOMDocument doc);
  47. /**
  48. * Make this cache instance respect private browsing notifications. This
  49. * entails clearing the chrome and content caches whenever the
  50. * last-pb-context-exited notification is observed.
  51. */
  52. void respectPrivacyNotifications();
  53. /**
  54. * Clear the image cache for a document. Controlled documents are responsible
  55. * for doing this manually when they get destroyed.
  56. */
  57. [noscript, notxpcom]
  58. void clearCacheForControlledDocument(in nsIDocument doc);
  59. };