michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 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: /* XXX we should define device and entry info as well (stats, etc) */ michael@0: michael@0: interface nsICacheDeviceInfo; michael@0: interface nsICacheEntryInfo; michael@0: michael@0: michael@0: [scriptable, uuid(f8c08c4b-d778-49d1-a59b-866fdc500d95)] michael@0: interface nsICacheVisitor : nsISupports michael@0: { michael@0: /** michael@0: * Called to provide information about a cache device. michael@0: * michael@0: * @param deviceID - specifies the device being visited. michael@0: * @param deviceInfo - specifies information about this device. michael@0: * michael@0: * @return true to start visiting all entries for this device. michael@0: * @return false to advance to the next device. michael@0: */ michael@0: boolean visitDevice(in string deviceID, michael@0: in nsICacheDeviceInfo deviceInfo); michael@0: michael@0: /** michael@0: * Called to provide information about a cache entry. michael@0: * michael@0: * @param deviceID - specifies the device being visited. michael@0: * @param entryInfo - specifies information about this entry. michael@0: * michael@0: * @return true to visit the next entry on the current device, or if the michael@0: * end of the device has been reached, advance to the next device. michael@0: * @return false to advance to the next device. michael@0: */ michael@0: boolean visitEntry(in string deviceID, michael@0: in nsICacheEntryInfo entryInfo); michael@0: }; michael@0: michael@0: michael@0: [scriptable, uuid(31d1c294-1dd2-11b2-be3a-c79230dca297)] michael@0: interface nsICacheDeviceInfo : nsISupports michael@0: { michael@0: /** michael@0: * Get a human readable description of the cache device. michael@0: */ michael@0: readonly attribute string description; michael@0: michael@0: /** michael@0: * Get a usage report, statistics, miscellaneous data about michael@0: * the cache device. michael@0: */ michael@0: readonly attribute string usageReport; michael@0: michael@0: /** michael@0: * Get the number of stored cache entries. michael@0: */ michael@0: readonly attribute unsigned long entryCount; michael@0: michael@0: /** michael@0: * Get the total size of the stored cache entries. michael@0: */ michael@0: readonly attribute unsigned long totalSize; michael@0: michael@0: /** michael@0: * Get the upper limit of the size of the data the cache can store. michael@0: */ michael@0: readonly attribute unsigned long maximumSize; michael@0: }; michael@0: michael@0: michael@0: [scriptable, uuid(fab51c92-95c3-4468-b317-7de4d7588254)] michael@0: interface nsICacheEntryInfo : nsISupports michael@0: { michael@0: /** michael@0: * Get the client id associated with this cache entry. michael@0: */ michael@0: readonly attribute string clientID; michael@0: michael@0: /** michael@0: * Get the id for the device that stores this cache entry. michael@0: */ michael@0: readonly attribute string deviceID; michael@0: michael@0: /** michael@0: * Get the key identifying the cache entry. michael@0: */ michael@0: readonly attribute ACString key; michael@0: michael@0: /** michael@0: * Get the number of times the cache entry has been opened. michael@0: */ michael@0: readonly attribute long fetchCount; michael@0: michael@0: /** michael@0: * Get the last time the cache entry was opened (in seconds since the Epoch). michael@0: */ michael@0: readonly attribute uint32_t lastFetched; michael@0: michael@0: /** michael@0: * Get the last time the cache entry was modified (in seconds since the Epoch). michael@0: */ michael@0: readonly attribute uint32_t lastModified; michael@0: michael@0: /** michael@0: * Get the expiration time of the cache entry (in seconds since the Epoch). michael@0: */ michael@0: readonly attribute uint32_t expirationTime; michael@0: michael@0: /** michael@0: * Get the cache entry data size. michael@0: */ michael@0: readonly attribute unsigned long dataSize; michael@0: michael@0: /** michael@0: * Find out whether or not the cache entry is stream based. michael@0: */ michael@0: boolean isStreamBased(); michael@0: };