nsICacheVisitor.idl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  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. /* XXX we should define device and entry info as well (stats, etc) */
  8. interface nsICacheDeviceInfo;
  9. interface nsICacheEntryInfo;
  10. [scriptable, uuid(f8c08c4b-d778-49d1-a59b-866fdc500d95)]
  11. interface nsICacheVisitor : nsISupports
  12. {
  13. /**
  14. * Called to provide information about a cache device.
  15. *
  16. * @param deviceID - specifies the device being visited.
  17. * @param deviceInfo - specifies information about this device.
  18. *
  19. * @return true to start visiting all entries for this device.
  20. * @return false to advance to the next device.
  21. */
  22. boolean visitDevice(in string deviceID,
  23. in nsICacheDeviceInfo deviceInfo);
  24. /**
  25. * Called to provide information about a cache entry.
  26. *
  27. * @param deviceID - specifies the device being visited.
  28. * @param entryInfo - specifies information about this entry.
  29. *
  30. * @return true to visit the next entry on the current device, or if the
  31. * end of the device has been reached, advance to the next device.
  32. * @return false to advance to the next device.
  33. */
  34. boolean visitEntry(in string deviceID,
  35. in nsICacheEntryInfo entryInfo);
  36. };
  37. [scriptable, uuid(31d1c294-1dd2-11b2-be3a-c79230dca297)]
  38. interface nsICacheDeviceInfo : nsISupports
  39. {
  40. /**
  41. * Get a human readable description of the cache device.
  42. */
  43. readonly attribute string description;
  44. /**
  45. * Get a usage report, statistics, miscellaneous data about
  46. * the cache device.
  47. */
  48. readonly attribute string usageReport;
  49. /**
  50. * Get the number of stored cache entries.
  51. */
  52. readonly attribute unsigned long entryCount;
  53. /**
  54. * Get the total size of the stored cache entries.
  55. */
  56. readonly attribute unsigned long totalSize;
  57. /**
  58. * Get the upper limit of the size of the data the cache can store.
  59. */
  60. readonly attribute unsigned long maximumSize;
  61. };
  62. [scriptable, uuid(fab51c92-95c3-4468-b317-7de4d7588254)]
  63. interface nsICacheEntryInfo : nsISupports
  64. {
  65. /**
  66. * Get the client id associated with this cache entry.
  67. */
  68. readonly attribute string clientID;
  69. /**
  70. * Get the id for the device that stores this cache entry.
  71. */
  72. readonly attribute string deviceID;
  73. /**
  74. * Get the key identifying the cache entry.
  75. */
  76. readonly attribute ACString key;
  77. /**
  78. * Get the number of times the cache entry has been opened.
  79. */
  80. readonly attribute long fetchCount;
  81. /**
  82. * Get the last time the cache entry was opened (in seconds since the Epoch).
  83. */
  84. readonly attribute uint32_t lastFetched;
  85. /**
  86. * Get the last time the cache entry was modified (in seconds since the Epoch).
  87. */
  88. readonly attribute uint32_t lastModified;
  89. /**
  90. * Get the expiration time of the cache entry (in seconds since the Epoch).
  91. */
  92. readonly attribute uint32_t expirationTime;
  93. /**
  94. * Get the cache entry data size.
  95. */
  96. readonly attribute unsigned long dataSize;
  97. /**
  98. * Find out whether or not the cache entry is stream based.
  99. */
  100. boolean isStreamBased();
  101. };