2001-02-24 01:23:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
2001-02-24 02:20:15 +03:00
|
|
|
* The Original Code is nsICacheVisitor.idl, released February 23, 2001.
|
2001-02-24 01:23:55 +03:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape Communications
|
|
|
|
* Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 2001 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2001-02-24 02:20:15 +03:00
|
|
|
* Gordon Sheridan <gordon@netscape.com>
|
|
|
|
* Patrick Beard <beard@netscape.com>
|
|
|
|
* Darin Fisher <darin@netscape.com>
|
2001-02-24 01:23:55 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2001-02-24 04:27:49 +03:00
|
|
|
/* XXX we should define device and entry info as well (stats, etc) */
|
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
interface nsICacheDeviceInfo;
|
|
|
|
interface nsICacheEntryInfo;
|
|
|
|
|
2001-02-24 01:23:55 +03:00
|
|
|
[scriptable, uuid(f8c08c4b-d778-49d1-a59b-866fdc500d95)]
|
|
|
|
interface nsICacheVisitor : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2001-02-24 04:27:49 +03:00
|
|
|
* Called to provide information about a cache device.
|
|
|
|
*
|
|
|
|
* @param deviceID - specifies the device being visited.
|
|
|
|
* @param deviceInfo - specifies information about this device.
|
|
|
|
*
|
|
|
|
* @return true to start visiting all entries for this device.
|
|
|
|
* @return false to advance to the next device.
|
2001-02-24 01:23:55 +03:00
|
|
|
*/
|
2001-03-08 23:58:11 +03:00
|
|
|
boolean visitDevice(in string deviceID,
|
|
|
|
in nsICacheDeviceInfo deviceInfo);
|
2001-02-24 01:23:55 +03:00
|
|
|
|
|
|
|
/**
|
2001-02-24 04:27:49 +03:00
|
|
|
* Called to provide information about a cache entry.
|
|
|
|
*
|
|
|
|
* @param deviceID - specifies the device being visited.
|
|
|
|
# @param clientID - specifies the client who created this entry.
|
|
|
|
* @param entryInfo - specifies information about this entry.
|
|
|
|
*
|
|
|
|
* @return true to visit the next entry on the current device, or if the
|
|
|
|
* end of the device has been reached, advance to the next device.
|
|
|
|
* @return false to advance to the next device.
|
2001-02-24 01:23:55 +03:00
|
|
|
*/
|
2001-03-08 23:58:11 +03:00
|
|
|
boolean visitEntry(in string deviceID,
|
|
|
|
in string clientID,
|
|
|
|
in nsICacheEntryInfo entryInfo);
|
|
|
|
};
|
|
|
|
|
|
|
|
[scriptable, uuid(31d1c294-1dd2-11b2-be3a-c79230dca297)]
|
|
|
|
interface nsICacheDeviceInfo : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get a human readable description of the cache device.
|
|
|
|
*/
|
|
|
|
readonly attribute string description;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a usage report, statistics, miscellaneous data about
|
|
|
|
* the cache device.
|
|
|
|
*/
|
|
|
|
readonly attribute string usageReport;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the number of stored cache entries.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long entryCount;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the total size of the stored cache entries.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long totalSize;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the upper limit of the size of the data the cache can store.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long maximumSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
[scriptable, uuid(72c64022-1dd2-11b2-b3a5-b8b859e0a1b2)]
|
|
|
|
interface nsICacheEntryInfo : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the client id associated with this cache entry.
|
|
|
|
*/
|
|
|
|
readonly attribute string clientID;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the key identifying the cache entry.
|
|
|
|
*/
|
|
|
|
readonly attribute string key;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the number of times the cache entry has been opened.
|
|
|
|
*/
|
|
|
|
readonly attribute long fetchCount;
|
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the last time the cache entry was opened (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 06:54:05 +03:00
|
|
|
readonly attribute PRUint32 lastFetched;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the last time the cache entry was modified (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 06:54:05 +03:00
|
|
|
readonly attribute PRUint32 lastModified;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the last time the cache entry was marked valid (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 06:54:05 +03:00
|
|
|
readonly attribute PRUint32 lastValidated;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the expiration time of the cache entry (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 06:54:05 +03:00
|
|
|
readonly attribute PRUint32 expirationTime;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 04:11:14 +03:00
|
|
|
* Get the cache entry data size.
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 04:11:14 +03:00
|
|
|
readonly attribute unsigned long dataSize;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 04:11:14 +03:00
|
|
|
* Find out whether or not the cache entry is stream based.
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 04:11:14 +03:00
|
|
|
boolean isStreamBased();
|
2001-02-24 01:23:55 +03:00
|
|
|
};
|