/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIChannel.idl
 */

#ifndef __gen_nsIChannel_h__
#define __gen_nsIChannel_h__

#include "nsIRequest.h"

class nsIURI; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIOutputStream; /* forward declaration */

class nsIStreamObserver; /* forward declaration */

class nsIStreamListener; /* forward declaration */

class nsILoadGroup; /* forward declaration */

class nsIInterfaceRequestor; /* forward declaration */

class nsIFile; /* forward declaration */

class nsIStreamIO; /* forward declaration */

typedef PRUint32 nsLoadFlags;


/* starting interface:    nsIChannel */
#define NS_ICHANNEL_IID_STR "1788e79e-f947-11d3-8cda-0060b0fc14a3"

#define NS_ICHANNEL_IID \
  {0x1788e79e, 0xf947, 0x11d3, \
    { 0x8c, 0xda, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}

/**
 * The nsIChannel interface allows the user to construct I/O requests for
 * specific protocols, and manage them in a uniform way. Once a channel
 * is created (via nsIIOService::NewChannel), parameters for that request
 * may be set by using the channel attributes, or by QueryInterfacing to a
 * subclass of nsIChannel for protocol-specific parameters. Then the actual
 * request can be issued in one of several ways:
 *
 *      - AsyncRead and AsyncWrite allow for asynchronous requests, calling
 *        back the user's stream listener or observer,
 *      - OpenInputStream and OpenOutputStream allow for synchronous reads
 *        and writes on the underlying channel.
 *
 * After a request has been completed, the channel is still valid for
 * accessing protocol-specific results. For example, QueryInterfacing to 
 * nsIHTTPChannel allows response headers to be retrieved that result from
 * http transactions. 
 *
 * Note that a channel is really only valid for one request. Reusing a channel
 * after a request has completed for a subsequent request may have undefined
 * results, depending on the channel implementation.
 *
 * Also of note are a special kind of channel called "transports." Transports
 * also implement the nsIChannel interface, but operate at a lower level from
 * protocol channels. The socket and file transports are notable implementations
 * of transports and allow higher level channels to be implemented. The cache
 * may also behave as a transport, and possibly things like sound playing services
 * etc. Transports usually operate in a separate thread and often multiplex
 * multiple requests for the same kind of service or resources. 
 */
class NS_NO_VTABLE nsIChannel : public nsIRequest {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICHANNEL_IID)

  /**
     * Returns the original URL used to construct the channel.
     * This is used in the case of a redirect or URI "resolution" (e.g. 
     * resolving a resource: URI to a file: URI) so that the original
     * pre-redirect URI can still be obtained. 
     *
     * Note that this is distinctly different from the http referrer
     * (referring URI) which is typically the page that contained the 
     * original URI (accessible from nsIHTTPChannel).
     */
  /* attribute nsIURI originalURI; */
  NS_IMETHOD GetOriginalURI(nsIURI * *aOriginalURI) = 0;
  NS_IMETHOD SetOriginalURI(nsIURI * aOriginalURI) = 0;

  /**
     * Returns the URL to which the channel currently refers. If a redirect
     * or URI resolution occurs, this accessor returns the current location
     * to which the channel is referring.
     */
  /* attribute nsIURI URI; */
  NS_IMETHOD GetURI(nsIURI * *aURI) = 0;
  NS_IMETHOD SetURI(nsIURI * aURI) = 0;

  /**
     * Accesses the start offset from the beginning of the data from/to which
     * reads/writes will occur. Users may set the transferOffset before making
     * any of the following requests: asyncOpen, asyncRead, asyncWrite,
     * openInputStream, openOutputstream.
     */
  /* attribute unsigned long transferOffset; */
  NS_IMETHOD GetTransferOffset(PRUint32 *aTransferOffset) = 0;
  NS_IMETHOD SetTransferOffset(PRUint32 aTransferOffset) = 0;

  /**
     * Accesses the count of bytes to be transfered. For openInputStream and
     * asyncRead, this specifies the amount to read, for asyncWrite, this
     * specifies the amount to write (note that for openOutputStream, the
     * end of the data can be signified simply by closing the stream). 
     * If the transferCount is set after reading has been initiated, the
     * amount specified will become the current remaining amount to read
     * before the channel is closed (this can be useful if the content
     * length is encoded at the start of the stream).
     *
     * A transferCount value of -1 means the amount is unspecified, i.e. 
     * read or write all the data that is available.
     */
  /* attribute long transferCount; */
  NS_IMETHOD GetTransferCount(PRInt32 *aTransferCount) = 0;
  NS_IMETHOD SetTransferCount(PRInt32 aTransferCount) = 0;

  /**
     * Accesses the load attributes for the channel. E.g. setting the load 
     * attributes with the LOAD_QUIET bit set causes the loading process to
     * not deliver status notifications to the program performing the load,
     * and to not contribute to keeping any nsILoadGroup it may be contained
     * in from firing its OnLoadComplete notification.
     */
  /* attribute nsLoadFlags loadAttributes; */
  NS_IMETHOD GetLoadAttributes(nsLoadFlags *aLoadAttributes) = 0;
  NS_IMETHOD SetLoadAttributes(nsLoadFlags aLoadAttributes) = 0;

  /**
     * Returns the content MIME type of the channel if available. Note that the 
     * content type can often be wrongly specified (wrong file extension, wrong
     * MIME type, wrong document type stored on a server, etc.) and the caller
     * most likely wants to verify with the actual data. 
     */
  /* attribute string contentType; */
  NS_IMETHOD GetContentType(char * *aContentType) = 0;
  NS_IMETHOD SetContentType(const char * aContentType) = 0;

  /**
     * Returns the length of the data associated with the channel if available.
     * If the length is unknown then -1 is returned.
     */
  /* attribute long contentLength; */
  NS_IMETHOD GetContentLength(PRInt32 *aContentLength) = 0;
  NS_IMETHOD SetContentLength(PRInt32 aContentLength) = 0;

  /**
     * Accesses the owner corresponding to the entity that is 
     * responsible for this channel. Used by security code to grant
     * or deny privileges to mobile code loaded from this channel. 
     *
     * Note: This is a strong reference to the owner, so if the owner is also
     * holding a pointer to the channel, care must be taken to explicitly drop
     * its reference to the channel -- otherwise a leak will result.
     */
  /* attribute nsISupports owner; */
  NS_IMETHOD GetOwner(nsISupports * *aOwner) = 0;
  NS_IMETHOD SetOwner(nsISupports * aOwner) = 0;

  /**
     * Accesses the load group in which the channel is a currently a member.
     */
  /* attribute nsILoadGroup loadGroup; */
  NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) = 0;
  NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup) = 0;

  /**
     * Accesses the capabilities callbacks of the channel. This is set by clients
     * who wish to provide a means to receive progress, status and protocol-specific 
     * notifications.
     */
  /* attribute nsIInterfaceRequestor notificationCallbacks; */
  NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor * *aNotificationCallbacks) = 0;
  NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor * aNotificationCallbacks) = 0;

  /** 
     * Any security information about this channel.  This can be null.
     */
  /* readonly attribute nsISupports securityInfo; */
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) = 0;

  /**
     * Accesses the buffer segment size. The buffer segment size is used as
     * the initial size for any transfer buffers, and the increment size for
     * whenever the buffer space needs to be grown.
     * (Note this parameter is passed along to any underlying nsIPipe objects.)
     * If unspecified, the channel implementation picks a default.
     */
  /* attribute unsigned long bufferSegmentSize; */
  NS_IMETHOD GetBufferSegmentSize(PRUint32 *aBufferSegmentSize) = 0;
  NS_IMETHOD SetBufferSegmentSize(PRUint32 aBufferSegmentSize) = 0;

  /**
     * Accesses the buffer maximum size. The buffer maximum size is the limit
     * size that buffer will be grown to before suspending the channel.
     * (Note this parameter is passed along to any underlying nsIPipe objects.)
     * If unspecified, the channel implementation picks a default.
     */
  /* attribute unsigned long bufferMaxSize; */
  NS_IMETHOD GetBufferMaxSize(PRUint32 *aBufferMaxSize) = 0;
  NS_IMETHOD SetBufferMaxSize(PRUint32 aBufferMaxSize) = 0;

  /**
     * Returns a local file to the channel's data if one exists, null otherwise.
     */
  /* readonly attribute nsIFile localFile; */
  NS_IMETHOD GetLocalFile(nsIFile * *aLocalFile) = 0;

  /**
     * Setting pipeliningAllowed causes the load of a URL (issued via asyncOpen,
     * asyncRead or asyncWrite) to be deferred in order to allow the request to
     * be pipelined for greater throughput efficiency. Pipelined requests will
     * be forced to load when the first non-pipelined request is issued.
     */
  /* attribute boolean pipeliningAllowed; */
  NS_IMETHOD GetPipeliningAllowed(PRBool *aPipeliningAllowed) = 0;
  NS_IMETHOD SetPipeliningAllowed(PRBool aPipeliningAllowed) = 0;

  /**
     * Note that more will follow for each protocol's implementation of a channel, 
     * although channel writers have to be careful to not let the flag bits 
     * overlap. Otherwise, users won't be able to create a single flag word
     * of load attributes that applies to a number of different channel types.
     */
/**
     * No special load attributes -- use defaults:
     */
  enum { LOAD_NORMAL = 0U };

  /** 
     * Don't deliver status notifications to the nsIProgressEventSink, or keep 
     * this load from completing the nsILoadGroup it may belong to:
     */
  enum { LOAD_BACKGROUND = 1U };

  enum { LOAD_DOCUMENT_URI = 2U };

  /** 
     * If the end consumer for this load has been retargeted after discovering 
     * it's content, this flag will be set:
     */
  enum { LOAD_RETARGETED_DOCUMENT_URI = 4U };

  /**
     * The following flags control caching behavior.  Not all protocols pay
     * attention to all these flags, but they are applicable to more than one
     * protocol, so they are defined here.
     */
/**
     * Don't store data in the disk cache.  This can be used to preserve
     * privacy, e.g. so that no https transactions are recorded, or to avoid
     * caching a stream to disk that is already stored in a local file,
     * e.g. the mailbox: protocol.
     */
  enum { INHIBIT_PERSISTENT_CACHING = 256U };

  /**
     * Force an end-to-end download of content data from the origin server (and
     * any intervening proxies that sit between it and the client), e.g. this
     * flag is used for a shift-reload.
     */
  enum { FORCE_RELOAD = 512U };

  /**
     * Force revalidation with server (or proxy) to verify that cached content
     * is up-to-date, e.g. by comparing last-modified date on server with that
     * of the cached version.  For example, this flag is used when the reload
     * button is pressed.
     */
  enum { FORCE_VALIDATION = 1024U };

  /**
     * If the CACHE_AS_FILE flag is set, any stream content is stored in the
     * cache as a single disk file.  Content will not be cached in the memory
     * cache nor will it be stored in any other type of cache, e.g. a flat-file
     * cache database.  This is used to implement the jar protocol handler and
     * to provide the stream-as-file semantics required by the classic browser
     * plugin API.
     */
  enum { CACHE_AS_FILE = 2048U };

  /**
     * When cache data is potentially out of date, it can be revalidated with
     * the origin server to see if the content needs to be reloaded.  The
     * following four flags control how often this validation occurs.
     * These flags are commonly used for "normal" loading.  Note that
     * the VALIDATE_HEURISTICALLY and VALIDATE_ONCE_PER_SESSION flags can be
     * combined to validate heuristically but no more than once per session.
     */
  enum { VALIDATE_NEVER = 4096U };

  enum { VALIDATE_ALWAYS = 8192U };

  enum { VALIDATE_ONCE_PER_SESSION = 16384U };

  enum { VALIDATE_HEURISTICALLY = 32768U };

  /**
	 * This flag is used to tell the webshell not to cancel the load in cases
	 * when the channel is receiving multipart/replace document
	 */
  enum { LOAD_REPLACE = 65536U };

  /**
     * Opens a blocking input stream to the URL's specified source.
     * @param startPosition - The offset from the start of the data
     *   from which to read.
     * @param readCount - The number of bytes to read. If -1, everything
     *   up to the end of the data is read. If greater than the end of 
     *   the data, the amount available is returned in the stream.
     */
  /* nsIInputStream openInputStream (); */
  NS_IMETHOD OpenInputStream(nsIInputStream **_retval) = 0;

  /**
     * Opens a blocking output stream to the URL's specified destination.
     * @param startPosition - The offset from the start of the data
     *   from which to begin writing.
     */
  /* nsIOutputStream openOutputStream (); */
  NS_IMETHOD OpenOutputStream(nsIOutputStream **_retval) = 0;

  /**
     * Reads asynchronously from the URL's specified source. Notifications
     * are provided to the stream listener on the thread of the specified
     * event queue.
     * The startPosition argument designates the offset in the source where
     * the data will be read.
     * If the readCount == -1 then all the available data is delivered to
     * the stream listener.
     */
  /* void asyncRead (in nsIStreamListener listener, in nsISupports ctxt); */
  NS_IMETHOD AsyncRead(nsIStreamListener *listener, nsISupports *ctxt) = 0;

  /**
     * Writes asynchronously to the URL's specified destination. Notifications
     * are provided to the stream observer on the thread of the specified
     * event queue.
     * The startPosition argument designates the offset in the destination where
     * the data will be written.
     * If the writeCount == -1, then all the available data in the input
     * stream is written.
     */
  /* void asyncWrite (in nsIInputStream fromStream, in nsIStreamObserver observer, in nsISupports ctxt); */
  NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, nsIStreamObserver *observer, nsISupports *ctxt) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICHANNEL \
  NS_IMETHOD GetOriginalURI(nsIURI * *aOriginalURI); \
  NS_IMETHOD SetOriginalURI(nsIURI * aOriginalURI); \
  NS_IMETHOD GetURI(nsIURI * *aURI); \
  NS_IMETHOD SetURI(nsIURI * aURI); \
  NS_IMETHOD GetTransferOffset(PRUint32 *aTransferOffset); \
  NS_IMETHOD SetTransferOffset(PRUint32 aTransferOffset); \
  NS_IMETHOD GetTransferCount(PRInt32 *aTransferCount); \
  NS_IMETHOD SetTransferCount(PRInt32 aTransferCount); \
  NS_IMETHOD GetLoadAttributes(nsLoadFlags *aLoadAttributes); \
  NS_IMETHOD SetLoadAttributes(nsLoadFlags aLoadAttributes); \
  NS_IMETHOD GetContentType(char * *aContentType); \
  NS_IMETHOD SetContentType(const char * aContentType); \
  NS_IMETHOD GetContentLength(PRInt32 *aContentLength); \
  NS_IMETHOD SetContentLength(PRInt32 aContentLength); \
  NS_IMETHOD GetOwner(nsISupports * *aOwner); \
  NS_IMETHOD SetOwner(nsISupports * aOwner); \
  NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); \
  NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup); \
  NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor * *aNotificationCallbacks); \
  NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor * aNotificationCallbacks); \
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo); \
  NS_IMETHOD GetBufferSegmentSize(PRUint32 *aBufferSegmentSize); \
  NS_IMETHOD SetBufferSegmentSize(PRUint32 aBufferSegmentSize); \
  NS_IMETHOD GetBufferMaxSize(PRUint32 *aBufferMaxSize); \
  NS_IMETHOD SetBufferMaxSize(PRUint32 aBufferMaxSize); \
  NS_IMETHOD GetLocalFile(nsIFile * *aLocalFile); \
  NS_IMETHOD GetPipeliningAllowed(PRBool *aPipeliningAllowed); \
  NS_IMETHOD SetPipeliningAllowed(PRBool aPipeliningAllowed); \
  NS_IMETHOD OpenInputStream(nsIInputStream **_retval); \
  NS_IMETHOD OpenOutputStream(nsIOutputStream **_retval); \
  NS_IMETHOD AsyncRead(nsIStreamListener *listener, nsISupports *ctxt); \
  NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, nsIStreamObserver *observer, nsISupports *ctxt); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICHANNEL(_to) \
  NS_IMETHOD GetOriginalURI(nsIURI * *aOriginalURI) { return _to ## GetOriginalURI(aOriginalURI); } \
  NS_IMETHOD SetOriginalURI(nsIURI * aOriginalURI) { return _to ## SetOriginalURI(aOriginalURI); } \
  NS_IMETHOD GetURI(nsIURI * *aURI) { return _to ## GetURI(aURI); } \
  NS_IMETHOD SetURI(nsIURI * aURI) { return _to ## SetURI(aURI); } \
  NS_IMETHOD GetTransferOffset(PRUint32 *aTransferOffset) { return _to ## GetTransferOffset(aTransferOffset); } \
  NS_IMETHOD SetTransferOffset(PRUint32 aTransferOffset) { return _to ## SetTransferOffset(aTransferOffset); } \
  NS_IMETHOD GetTransferCount(PRInt32 *aTransferCount) { return _to ## GetTransferCount(aTransferCount); } \
  NS_IMETHOD SetTransferCount(PRInt32 aTransferCount) { return _to ## SetTransferCount(aTransferCount); } \
  NS_IMETHOD GetLoadAttributes(nsLoadFlags *aLoadAttributes) { return _to ## GetLoadAttributes(aLoadAttributes); } \
  NS_IMETHOD SetLoadAttributes(nsLoadFlags aLoadAttributes) { return _to ## SetLoadAttributes(aLoadAttributes); } \
  NS_IMETHOD GetContentType(char * *aContentType) { return _to ## GetContentType(aContentType); } \
  NS_IMETHOD SetContentType(const char * aContentType) { return _to ## SetContentType(aContentType); } \
  NS_IMETHOD GetContentLength(PRInt32 *aContentLength) { return _to ## GetContentLength(aContentLength); } \
  NS_IMETHOD SetContentLength(PRInt32 aContentLength) { return _to ## SetContentLength(aContentLength); } \
  NS_IMETHOD GetOwner(nsISupports * *aOwner) { return _to ## GetOwner(aOwner); } \
  NS_IMETHOD SetOwner(nsISupports * aOwner) { return _to ## SetOwner(aOwner); } \
  NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) { return _to ## GetLoadGroup(aLoadGroup); } \
  NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup) { return _to ## SetLoadGroup(aLoadGroup); } \
  NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor * *aNotificationCallbacks) { return _to ## GetNotificationCallbacks(aNotificationCallbacks); } \
  NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor * aNotificationCallbacks) { return _to ## SetNotificationCallbacks(aNotificationCallbacks); } \
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) { return _to ## GetSecurityInfo(aSecurityInfo); } \
  NS_IMETHOD GetBufferSegmentSize(PRUint32 *aBufferSegmentSize) { return _to ## GetBufferSegmentSize(aBufferSegmentSize); } \
  NS_IMETHOD SetBufferSegmentSize(PRUint32 aBufferSegmentSize) { return _to ## SetBufferSegmentSize(aBufferSegmentSize); } \
  NS_IMETHOD GetBufferMaxSize(PRUint32 *aBufferMaxSize) { return _to ## GetBufferMaxSize(aBufferMaxSize); } \
  NS_IMETHOD SetBufferMaxSize(PRUint32 aBufferMaxSize) { return _to ## SetBufferMaxSize(aBufferMaxSize); } \
  NS_IMETHOD GetLocalFile(nsIFile * *aLocalFile) { return _to ## GetLocalFile(aLocalFile); } \
  NS_IMETHOD GetPipeliningAllowed(PRBool *aPipeliningAllowed) { return _to ## GetPipeliningAllowed(aPipeliningAllowed); } \
  NS_IMETHOD SetPipeliningAllowed(PRBool aPipeliningAllowed) { return _to ## SetPipeliningAllowed(aPipeliningAllowed); } \
  NS_IMETHOD OpenInputStream(nsIInputStream **_retval) { return _to ## OpenInputStream(_retval); } \
  NS_IMETHOD OpenOutputStream(nsIOutputStream **_retval) { return _to ## OpenOutputStream(_retval); } \
  NS_IMETHOD AsyncRead(nsIStreamListener *listener, nsISupports *ctxt) { return _to ## AsyncRead(listener, ctxt); } \
  NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, nsIStreamObserver *observer, nsISupports *ctxt) { return _to ## AsyncWrite(fromStream, observer, ctxt); } 

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

/* Header file */
class nsChannel : public nsIChannel
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSICHANNEL

  nsChannel();
  virtual ~nsChannel();
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsChannel, nsIChannel)

nsChannel::nsChannel()
{
  NS_INIT_ISUPPORTS();
  /* member initializers and constructor code */
}

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

/* attribute nsIURI originalURI; */
NS_IMETHODIMP nsChannel::GetOriginalURI(nsIURI * *aOriginalURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetOriginalURI(nsIURI * aOriginalURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsIURI URI; */
NS_IMETHODIMP nsChannel::GetURI(nsIURI * *aURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetURI(nsIURI * aURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute unsigned long transferOffset; */
NS_IMETHODIMP nsChannel::GetTransferOffset(PRUint32 *aTransferOffset)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetTransferOffset(PRUint32 aTransferOffset)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute long transferCount; */
NS_IMETHODIMP nsChannel::GetTransferCount(PRInt32 *aTransferCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetTransferCount(PRInt32 aTransferCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsLoadFlags loadAttributes; */
NS_IMETHODIMP nsChannel::GetLoadAttributes(nsLoadFlags *aLoadAttributes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute string contentType; */
NS_IMETHODIMP nsChannel::GetContentType(char * *aContentType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetContentType(const char * aContentType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute long contentLength; */
NS_IMETHODIMP nsChannel::GetContentLength(PRInt32 *aContentLength)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetContentLength(PRInt32 aContentLength)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsISupports owner; */
NS_IMETHODIMP nsChannel::GetOwner(nsISupports * *aOwner)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetOwner(nsISupports * aOwner)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsILoadGroup loadGroup; */
NS_IMETHODIMP nsChannel::GetLoadGroup(nsILoadGroup * *aLoadGroup)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetLoadGroup(nsILoadGroup * aLoadGroup)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsIInterfaceRequestor notificationCallbacks; */
NS_IMETHODIMP nsChannel::GetNotificationCallbacks(nsIInterfaceRequestor * *aNotificationCallbacks)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetNotificationCallbacks(nsIInterfaceRequestor * aNotificationCallbacks)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsISupports securityInfo; */
NS_IMETHODIMP nsChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute unsigned long bufferSegmentSize; */
NS_IMETHODIMP nsChannel::GetBufferSegmentSize(PRUint32 *aBufferSegmentSize)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetBufferSegmentSize(PRUint32 aBufferSegmentSize)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute unsigned long bufferMaxSize; */
NS_IMETHODIMP nsChannel::GetBufferMaxSize(PRUint32 *aBufferMaxSize)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetBufferMaxSize(PRUint32 aBufferMaxSize)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIFile localFile; */
NS_IMETHODIMP nsChannel::GetLocalFile(nsIFile * *aLocalFile)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean pipeliningAllowed; */
NS_IMETHODIMP nsChannel::GetPipeliningAllowed(PRBool *aPipeliningAllowed)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetPipeliningAllowed(PRBool aPipeliningAllowed)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIInputStream openInputStream (); */
NS_IMETHODIMP nsChannel::OpenInputStream(nsIInputStream **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIOutputStream openOutputStream (); */
NS_IMETHODIMP nsChannel::OpenOutputStream(nsIOutputStream **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void asyncRead (in nsIStreamListener listener, in nsISupports ctxt); */
NS_IMETHODIMP nsChannel::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void asyncWrite (in nsIInputStream fromStream, in nsIStreamObserver observer, in nsISupports ctxt); */
NS_IMETHODIMP nsChannel::AsyncWrite(nsIInputStream *fromStream, nsIStreamObserver *observer, nsISupports *ctxt)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsIStreamIOChannel */
#define NS_ISTREAMIOCHANNEL_IID_STR "308362ce-0d06-11d4-986e-00c04fa0cf4a"

#define NS_ISTREAMIOCHANNEL_IID \
  {0x308362ce, 0x0d06, 0x11d4, \
    { 0x98, 0x6e, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}

/**
 * nsIStreamIOChannel specializes nsIChannel to allow a simple channel to be
 * constructed from an nsIStreamIO object and a URL.
 */
class NS_NO_VTABLE nsIStreamIOChannel : public nsIChannel {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMIOCHANNEL_IID)

  /* void init (in nsIURI uri, in nsIStreamIO io); */
  NS_IMETHOD Init(nsIURI *uri, nsIStreamIO *io) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMIOCHANNEL \
  NS_IMETHOD Init(nsIURI *uri, nsIStreamIO *io); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMIOCHANNEL(_to) \
  NS_IMETHOD Init(nsIURI *uri, nsIStreamIO *io) { return _to ## Init(uri, io); } 

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

/* Header file */
class nsStreamIOChannel : public nsIStreamIOChannel
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTREAMIOCHANNEL

  nsStreamIOChannel();
  virtual ~nsStreamIOChannel();
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsStreamIOChannel, nsIStreamIOChannel)

nsStreamIOChannel::nsStreamIOChannel()
{
  NS_INIT_ISUPPORTS();
  /* member initializers and constructor code */
}

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

/* void init (in nsIURI uri, in nsIStreamIO io); */
NS_IMETHODIMP nsStreamIOChannel::Init(nsIURI *uri, nsIStreamIO *io)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

#define NS_STREAMIOCHANNEL_CLASSNAME "Stream I/O Channel"
#define NS_STREAMIOCHANNEL_CONTRACTID    "@mozilla.org/network/stream-io-channel;1"
#define NS_STREAMIOCHANNEL_CID                       \
{ /* 6ddb050c-0d04-11d4-986e-00c04fa0cf4a */         \
    0x6ddb050c,                                      \
    0x0d04,                                          \
    0x11d4,                                          \
    {0x98, 0x6e, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \
}

/* starting interface:    nsIFileChannel */
#define NS_IFILECHANNEL_IID_STR "68a26506-f947-11d3-8cda-0060b0fc14a3"

#define NS_IFILECHANNEL_IID \
  {0x68a26506, 0xf947, 0x11d3, \
    { 0x8c, 0xda, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}

/**
 * nsIFileChannel is an interface that allows for the initialization
 * of a simple nsIChannel that is constructed from a single nsIFile and
 * associated content type. 
 */
class NS_NO_VTABLE nsIFileChannel : public nsIChannel {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILECHANNEL_IID)

  /** 
     * Values for ioFlags parameters to be or'd together. 
     * (From prio.h)
     */
  enum { NS_RDONLY = 1 };

  enum { NS_WRONLY = 2 };

  enum { NS_RDWR = 4 };

  enum { NS_CREATE_FILE = 8 };

  enum { NS_APPEND = 16 };

  enum { NS_TRUNCATE = 32 };

  enum { NS_SYNC = 64 };

  enum { NS_EXCL = 128 };

  /* void init (in nsIFile file, in long ioFlags, in long perm); */
  NS_IMETHOD Init(nsIFile *file, PRInt32 ioFlags, PRInt32 perm) = 0;

  /* readonly attribute nsIFile file; */
  NS_IMETHOD GetFile(nsIFile * *aFile) = 0;

  /* attribute long ioFlags; */
  NS_IMETHOD GetIoFlags(PRInt32 *aIoFlags) = 0;
  NS_IMETHOD SetIoFlags(PRInt32 aIoFlags) = 0;

  /* attribute long permissions; */
  NS_IMETHOD GetPermissions(PRInt32 *aPermissions) = 0;
  NS_IMETHOD SetPermissions(PRInt32 aPermissions) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFILECHANNEL \
  NS_IMETHOD Init(nsIFile *file, PRInt32 ioFlags, PRInt32 perm); \
  NS_IMETHOD GetFile(nsIFile * *aFile); \
  NS_IMETHOD GetIoFlags(PRInt32 *aIoFlags); \
  NS_IMETHOD SetIoFlags(PRInt32 aIoFlags); \
  NS_IMETHOD GetPermissions(PRInt32 *aPermissions); \
  NS_IMETHOD SetPermissions(PRInt32 aPermissions); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFILECHANNEL(_to) \
  NS_IMETHOD Init(nsIFile *file, PRInt32 ioFlags, PRInt32 perm) { return _to ## Init(file, ioFlags, perm); } \
  NS_IMETHOD GetFile(nsIFile * *aFile) { return _to ## GetFile(aFile); } \
  NS_IMETHOD GetIoFlags(PRInt32 *aIoFlags) { return _to ## GetIoFlags(aIoFlags); } \
  NS_IMETHOD SetIoFlags(PRInt32 aIoFlags) { return _to ## SetIoFlags(aIoFlags); } \
  NS_IMETHOD GetPermissions(PRInt32 *aPermissions) { return _to ## GetPermissions(aPermissions); } \
  NS_IMETHOD SetPermissions(PRInt32 aPermissions) { return _to ## SetPermissions(aPermissions); } 

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

/* Header file */
class nsFileChannel : public nsIFileChannel
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIFILECHANNEL

  nsFileChannel();
  virtual ~nsFileChannel();
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsFileChannel, nsIFileChannel)

nsFileChannel::nsFileChannel()
{
  NS_INIT_ISUPPORTS();
  /* member initializers and constructor code */
}

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

/* void init (in nsIFile file, in long ioFlags, in long perm); */
NS_IMETHODIMP nsFileChannel::Init(nsIFile *file, PRInt32 ioFlags, PRInt32 perm)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIFile file; */
NS_IMETHODIMP nsFileChannel::GetFile(nsIFile * *aFile)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute long ioFlags; */
NS_IMETHODIMP nsFileChannel::GetIoFlags(PRInt32 *aIoFlags)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFileChannel::SetIoFlags(PRInt32 aIoFlags)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute long permissions; */
NS_IMETHODIMP nsFileChannel::GetPermissions(PRInt32 *aPermissions)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFileChannel::SetPermissions(PRInt32 aPermissions)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

#define NS_LOCALFILECHANNEL_CLASSNAME "Local File Channel"
#define NS_LOCALFILECHANNEL_CONTRACTID "@mozilla.org/network/local-file-channel;1"
#define NS_LOCALFILECHANNEL_CID                      \
{ /* 6d5b2d44-f947-11d3-8cda-0060b0fc14a3 */         \
    0x6d5b2d44,                                      \
    0xf947,                                          \
    0x11d3,                                          \
    {0x8c, 0xda, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
}

#endif /* __gen_nsIChannel_h__ */
