1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is nsICacheService.idl, released
19 * The Initial Developer of the Original Code is
20 * Netscape Communications Corporation.
21 * Portions created by the Initial Developer are Copyright (C) 2001
22 * the Initial Developer. All Rights Reserved.
25 * Gordon Sheridan <gordon@netscape.com>
26 * Patrick Beard <beard@netscape.com>
27 * Darin Fisher <darin@netscape.com>
29 * Alternatively, the contents of this file may be used under the terms of
30 * either the GNU General Public License Version 2 or later (the "GPL"), or
31 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 * in which case the provisions of the GPL or the LGPL are applicable instead
33 * of those above. If you wish to allow use of your version of this file only
34 * under the terms of either the GPL or the LGPL, and not to allow others to
35 * use your version of this file under the terms of the MPL, indicate your
36 * decision by deleting the provisions above and replace them with the notice
37 * and other provisions required by the GPL or the LGPL. If you do not delete
38 * the provisions above, a recipient may use your version of this file under
39 * the terms of any one of the MPL, the GPL or the LGPL.
41 * ***** END LICENSE BLOCK ***** */
43 #include
"nsISupports.idl"
44 #include
"nsICache.idl"
46 interface nsISimpleEnumerator
;
47 interface nsICacheListener
;
48 interface nsICacheSession
;
49 interface nsICacheVisitor
;
51 [scriptable
, uuid(98dd0187
-aad4
-4cab
-82c5
-1adddef3629d
)]
52 interface nsICacheService
: nsISupports
55 * Create a cache session
57 * A cache session represents a client's access into the cache. The cache
58 * session is not "owned" by the cache service. Hence, it is possible to
59 * create duplicate cache sessions. Entries created by a cache session
60 * are invisible to other cache sessions, unless the cache sessions are
63 * @param clientID - Specifies the name of the client using the cache.
64 * @param storagePolicy - Limits the storage policy for all entries
65 * accessed via the returned session. As a result, devices excluded
66 * by the storage policy will not be searched when opening entries
67 * from the returned session.
68 * @param streamBased - Indicates whether or not the data being cached
69 * can be represented as a stream. The storagePolicy must be
70 * consistent with the value of this field. For example, a non-stream-
71 * based cache entry can only have a storage policy of STORE_IN_MEMORY.
72 * @return new cache session.
74 nsICacheSession createSession
(in string clientID
,
75 in nsCacheStoragePolicy storagePolicy
,
76 in boolean streamBased
);
79 * Visit entries stored in the cache. Used to implement about:cache.
81 void visitEntries
(in nsICacheVisitor visitor
);
84 * Evicts all entries in all devices implied by the storage policy.
86 void evictEntries
(in nsCacheStoragePolicy storagePolicy
);
89 * This method is deprecated and will throw NS_ERROR_NOT_IMPLEMENTED.
91 ACString createTemporaryClientID
(in nsCacheStoragePolicy storagePolicy
);
96 * Observer service notification that is sent when
97 * nsICacheService::evictEntries() or nsICacheSession::evictEntries()
100 #define NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID
"cacheservice:empty-cache"