/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM e:/builds/tinderbox/XR-Trunk/WINNT_5.2_Depend/mozilla/netwerk/cache/public/nsIOfflineCacheSession.idl
 */

#ifndef __gen_nsIOfflineCacheSession_h__
#define __gen_nsIOfflineCacheSession_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#ifndef __gen_nsICache_h__
#include "nsICache.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    nsIOfflineCacheSession */
#define NS_IOFFLINECACHESESSION_IID_STR "de7875e5-a7e2-4d8d-ad01-807ef55ef8c0"

#define NS_IOFFLINECACHESESSION_IID \
  {0xde7875e5, 0xa7e2, 0x4d8d, \
    { 0xad, 0x01, 0x80, 0x7e, 0xf5, 0x5e, 0xf8, 0xc0 }}

/**
 * The offline cache is meant to reliably store resources for
 * offline use.  The expected semantics are:
 *
 * a) Once populated, the cache will not evict an application resource
 *    unless explicitly asked.
 *
 * b) Resources no longer in use by the application should be evicted.
 *
 * c) If the cache fills up, new entries should be rejected rather
 *    than throwing out old ones.
 *
 * The offline cache uses domains to concretely represent an
 * application.  It maintains a list of resources to be pinned for
 * each domain.  This list is separate from actual cache
 * population - the caller is still responsible for placing items
 * in the cache, and ownership can be declared without a
 * corresponding entry.
 *
 * A key can optionally be associated with a specific URI within
 * the domain.
 */
class NS_NO_VTABLE nsIOfflineCacheSession : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOFFLINECACHESESSION_IID)

  /**
     * Gets the list of owner domains in the cache.
     *
     * @param count
     *        The number of domains returned
     * @param uris
     *        The domains that own resources in the cache
     */
  /* void getOwnerDomains (out unsigned long count, [array, size_is (count)] out string domains); */
  NS_IMETHOD GetOwnerDomains(PRUint32 *count, char ***domains) = 0;

  /**
     * Gets the list of owner URIs associated with a domain.
     *
     * @param ownerDomain
     *        The domain to query
     * @param count
     *        The number of uris returned
     * @param uris
     *        The uris in this domain that own resources
     */
  /* void getOwnerURIs (in ACString ownerDomain, out unsigned long count, [array, size_is (count)] out string uris); */
  NS_IMETHOD GetOwnerURIs(const nsACString & ownerDomain, PRUint32 *count, char ***uris) = 0;

  /**
     * Sets the resources owned by a given domain/URI pair.
     *
     * Setting a list will remove any resources previously owned by this
     * domain/URI pair.
     *
     * A key can be added while there is no associated entry.  When
     * an entry is created with this key, it will be owned by the
     * domain/URI pair.
     *
     * @param ownerDomain
     *        The domain that owns the resources.
     * @param ownerURI
     *        The specific URI that owns the resources.  This can be empty if
     *        no URI specifically owns the resources.
     * @param count
     *        The number of keys in keys.
     * @param keys
     *        The keys that the domain/URI pair own.  This can be empty to
     *        clear ownership for the domain/URI pair.
     */
  /* void setOwnedKeys (in ACString ownerDomain, in ACString ownerURI, in unsigned long count, [array, size_is (count)] in string keys); */
  NS_IMETHOD SetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 count, const char **keys) = 0;

  /**
     * Gets the list of resources owned by a given domain/URI pair.
     *
     * @param ownerDomain
     *        The domain that owns the resources.
     * @param ownerURI
     *        The specific URI that owns the resources.  This can be empty
     *        if no URI specifically owns the resources.
     * @param count
     *        The number of keys in keys.
     * @param keys
     *        The keys that the domain/URI pair own.
     */
  /* void getOwnedKeys (in ACString ownerDomain, in ACString ownerURI, out unsigned long count, [array, size_is (count)] out string keys); */
  NS_IMETHOD GetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 *count, char ***keys) = 0;

  /**
     * Adds an owned key to a domain/URI pair.
     *
     * A key can be added while there is no associated entry.  When
     * an entry is created with this key, it will be owned by the
     * domain/URI pair.
     *
     * @param ownerDomain
     *        The domain that owns the resources.
     * @param ownerURI
     *        The specific URI that owns the resources.  This can be empty
     *        if no URI specifically owns the resources.
     * @param key
     *        The key to add.
     */
  /* void addOwnedKey (in ACString ownerDomain, in ACString ownerURI, in ACString key); */
  NS_IMETHOD AddOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key) = 0;

  /**
     * Removes an owned key from a domain/URI pair.
     *
     * If the key does not exist, an NS_ERROR_NOT_AVAILABLE exception
     * will be thrown.
     *
     * @param ownerDomain
     *        The domain that owns the resources.
     * @param ownerURI
     *        The specific URI that owns the resources.  This can be empty
     *        if no URI specifically owns the resources.
     * @param key The key to remove.
     */
  /* void removeOwnedKey (in ACString ownerDomain, in ACString ownerURI, in ACString key); */
  NS_IMETHOD RemoveOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key) = 0;

  /**
     * Checks whether a key is owned by a given domain/URI pair.
     *
     * @param ownerDomain
     *        The domain that owns the resources.
     * @param ownerURI
     *        The specific URI that owns the resources.  This can be empty
     *        if no URI specifically owns the resources.
     * @param key The key to check
     */
  /* boolean keyIsOwned (in ACString ownerDomain, in ACString ownerURI, in ACString key); */
  NS_IMETHOD KeyIsOwned(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key, PRBool *_retval) = 0;

  /**
     * Remove all keys owned by a domain, including keys owned by
     * a specific URI.
     *
     * @param domain The domain for which keys should be removed.
     */
  /* void clearKeysOwnedByDomain (in ACString ownerDomain); */
  NS_IMETHOD ClearKeysOwnedByDomain(const nsACString & ownerDomain) = 0;

  /**
     * Evict all entries that are not owned by a domain.
     */
  /* void evictUnownedEntries (); */
  NS_IMETHOD EvictUnownedEntries(void) = 0;

  /**
     * Merge the items from a temporary clientID in to this client.  This lets
     * offline cache updates accumulate in a temporary client and be moved
     * in all at once.
     *
     * Entries in the temporary client will replace any entries in this client
     * with the same cache key.
     *
     * Ownership lists for a given domain/URI pair from the temporary client
     * will replace ownership lists for the same domain/URI pair.
     */
  /* void mergeTemporaryClientID (in ACString temporaryClientID); */
  NS_IMETHOD MergeTemporaryClientID(const nsACString & temporaryClientID) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIOfflineCacheSession, NS_IOFFLINECACHESESSION_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOFFLINECACHESESSION \
  NS_IMETHOD GetOwnerDomains(PRUint32 *count, char ***domains); \
  NS_IMETHOD GetOwnerURIs(const nsACString & ownerDomain, PRUint32 *count, char ***uris); \
  NS_IMETHOD SetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 count, const char **keys); \
  NS_IMETHOD GetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 *count, char ***keys); \
  NS_IMETHOD AddOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key); \
  NS_IMETHOD RemoveOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key); \
  NS_IMETHOD KeyIsOwned(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key, PRBool *_retval); \
  NS_IMETHOD ClearKeysOwnedByDomain(const nsACString & ownerDomain); \
  NS_IMETHOD EvictUnownedEntries(void); \
  NS_IMETHOD MergeTemporaryClientID(const nsACString & temporaryClientID); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOFFLINECACHESESSION(_to) \
  NS_IMETHOD GetOwnerDomains(PRUint32 *count, char ***domains) { return _to GetOwnerDomains(count, domains); } \
  NS_IMETHOD GetOwnerURIs(const nsACString & ownerDomain, PRUint32 *count, char ***uris) { return _to GetOwnerURIs(ownerDomain, count, uris); } \
  NS_IMETHOD SetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 count, const char **keys) { return _to SetOwnedKeys(ownerDomain, ownerURI, count, keys); } \
  NS_IMETHOD GetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 *count, char ***keys) { return _to GetOwnedKeys(ownerDomain, ownerURI, count, keys); } \
  NS_IMETHOD AddOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key) { return _to AddOwnedKey(ownerDomain, ownerURI, key); } \
  NS_IMETHOD RemoveOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key) { return _to RemoveOwnedKey(ownerDomain, ownerURI, key); } \
  NS_IMETHOD KeyIsOwned(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key, PRBool *_retval) { return _to KeyIsOwned(ownerDomain, ownerURI, key, _retval); } \
  NS_IMETHOD ClearKeysOwnedByDomain(const nsACString & ownerDomain) { return _to ClearKeysOwnedByDomain(ownerDomain); } \
  NS_IMETHOD EvictUnownedEntries(void) { return _to EvictUnownedEntries(); } \
  NS_IMETHOD MergeTemporaryClientID(const nsACString & temporaryClientID) { return _to MergeTemporaryClientID(temporaryClientID); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIOFFLINECACHESESSION(_to) \
  NS_IMETHOD GetOwnerDomains(PRUint32 *count, char ***domains) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerDomains(count, domains); } \
  NS_IMETHOD GetOwnerURIs(const nsACString & ownerDomain, PRUint32 *count, char ***uris) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerURIs(ownerDomain, count, uris); } \
  NS_IMETHOD SetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 count, const char **keys) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOwnedKeys(ownerDomain, ownerURI, count, keys); } \
  NS_IMETHOD GetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 *count, char ***keys) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnedKeys(ownerDomain, ownerURI, count, keys); } \
  NS_IMETHOD AddOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddOwnedKey(ownerDomain, ownerURI, key); } \
  NS_IMETHOD RemoveOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveOwnedKey(ownerDomain, ownerURI, key); } \
  NS_IMETHOD KeyIsOwned(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->KeyIsOwned(ownerDomain, ownerURI, key, _retval); } \
  NS_IMETHOD ClearKeysOwnedByDomain(const nsACString & ownerDomain) { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearKeysOwnedByDomain(ownerDomain); } \
  NS_IMETHOD EvictUnownedEntries(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->EvictUnownedEntries(); } \
  NS_IMETHOD MergeTemporaryClientID(const nsACString & temporaryClientID) { return !_to ? NS_ERROR_NULL_POINTER : _to->MergeTemporaryClientID(temporaryClientID); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsOfflineCacheSession : public nsIOfflineCacheSession
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOFFLINECACHESESSION

  nsOfflineCacheSession();

private:
  ~nsOfflineCacheSession();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsOfflineCacheSession, nsIOfflineCacheSession)

nsOfflineCacheSession::nsOfflineCacheSession()
{
  /* member initializers and constructor code */
}

nsOfflineCacheSession::~nsOfflineCacheSession()
{
  /* destructor code */
}

/* void getOwnerDomains (out unsigned long count, [array, size_is (count)] out string domains); */
NS_IMETHODIMP nsOfflineCacheSession::GetOwnerDomains(PRUint32 *count, char ***domains)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getOwnerURIs (in ACString ownerDomain, out unsigned long count, [array, size_is (count)] out string uris); */
NS_IMETHODIMP nsOfflineCacheSession::GetOwnerURIs(const nsACString & ownerDomain, PRUint32 *count, char ***uris)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setOwnedKeys (in ACString ownerDomain, in ACString ownerURI, in unsigned long count, [array, size_is (count)] in string keys); */
NS_IMETHODIMP nsOfflineCacheSession::SetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 count, const char **keys)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getOwnedKeys (in ACString ownerDomain, in ACString ownerURI, out unsigned long count, [array, size_is (count)] out string keys); */
NS_IMETHODIMP nsOfflineCacheSession::GetOwnedKeys(const nsACString & ownerDomain, const nsACString & ownerURI, PRUint32 *count, char ***keys)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addOwnedKey (in ACString ownerDomain, in ACString ownerURI, in ACString key); */
NS_IMETHODIMP nsOfflineCacheSession::AddOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeOwnedKey (in ACString ownerDomain, in ACString ownerURI, in ACString key); */
NS_IMETHODIMP nsOfflineCacheSession::RemoveOwnedKey(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean keyIsOwned (in ACString ownerDomain, in ACString ownerURI, in ACString key); */
NS_IMETHODIMP nsOfflineCacheSession::KeyIsOwned(const nsACString & ownerDomain, const nsACString & ownerURI, const nsACString & key, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void clearKeysOwnedByDomain (in ACString ownerDomain); */
NS_IMETHODIMP nsOfflineCacheSession::ClearKeysOwnedByDomain(const nsACString & ownerDomain)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void evictUnownedEntries (); */
NS_IMETHODIMP nsOfflineCacheSession::EvictUnownedEntries()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void mergeTemporaryClientID (in ACString temporaryClientID); */
NS_IMETHODIMP nsOfflineCacheSession::MergeTemporaryClientID(const nsACString & temporaryClientID)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIOfflineCacheSession_h__ */
