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

#ifndef __gen_nsITransfer_h__
#define __gen_nsITransfer_h__


#ifndef __gen_nsIWebProgressListener_h__
#include "nsIWebProgressListener.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIURI; /* forward declaration */

class nsIObserver; /* forward declaration */

class nsIWebBrowserPersist; /* forward declaration */

class nsIMIMEInfo; /* forward declaration */


/* starting interface:    nsITransfer */
#define NS_ITRANSFER_IID_STR "e57c27f8-2a4e-4d80-bf80-1ffd634c734e"

#define NS_ITRANSFER_IID \
  {0xe57c27f8, 0x2a4e, 0x4d80, \
    { 0xbf, 0x80, 0x1f, 0xfd, 0x63, 0x4c, 0x73, 0x4e }}

class NS_NO_VTABLE nsITransfer : public nsIWebProgressListener {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITRANSFER_IID)

  /**
     * Initializes the transfer with certain properties.  This function must
     * be called prior to accessing any properties on this interface.
     *
     * @param aSource The source URI of the transfer.
     *
     * @param aTarget The target URI of the transfer.
     *
     * @param aDisplayName The user-readable description of the transfer.
     *
     * @param aMIMEInfo The MIME info associated with the target,
     *                  including MIME type and helper app when appropriate.
     *                  This parameter is optional.
     *
     * @param aPersist The "persist" used for this transfer.  If set,
     *                 the manager will set its listener to the transfer item
     *                 and use it for cancellation.  If not set, the client
     *                 is expected to set the transfer item as the listener on
     *                 whatever transfer component is being used, and to
     *                 set an observer on the transfer item that listens for
     *                 the "oncancel" topic and cancels the transfer.
     */
  /* void init (in nsIURI aSource, in nsIURI aTarget, in wstring aDisplayName, in nsIMIMEInfo aMIMEInfo, in long long startTime, in nsIWebBrowserPersist aPersist); */
  NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName, nsIMIMEInfo *aMIMEInfo, PRInt64 startTime, nsIWebBrowserPersist *aPersist) = 0;

  /**
     * Optional; transferring information is passed to this listener and used to
     * update client UI.
     */
  /* attribute nsIWebProgressListener listener; */
  NS_IMETHOD GetListener(nsIWebProgressListener * *aListener) = 0;
  NS_IMETHOD SetListener(nsIWebProgressListener * aListener) = 0;

  /**
     * If set, receives notifications of events like cancel ("oncancel").
     * Must be set if no persist object is specified (see above).
     */
  /* attribute nsIObserver observer; */
  NS_IMETHOD GetObserver(nsIObserver * *aObserver) = 0;
  NS_IMETHOD SetObserver(nsIObserver * aObserver) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITRANSFER \
  NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName, nsIMIMEInfo *aMIMEInfo, PRInt64 startTime, nsIWebBrowserPersist *aPersist); \
  NS_IMETHOD GetListener(nsIWebProgressListener * *aListener); \
  NS_IMETHOD SetListener(nsIWebProgressListener * aListener); \
  NS_IMETHOD GetObserver(nsIObserver * *aObserver); \
  NS_IMETHOD SetObserver(nsIObserver * aObserver); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITRANSFER(_to) \
  NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName, nsIMIMEInfo *aMIMEInfo, PRInt64 startTime, nsIWebBrowserPersist *aPersist) { return _to Init(aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aPersist); } \
  NS_IMETHOD GetListener(nsIWebProgressListener * *aListener) { return _to GetListener(aListener); } \
  NS_IMETHOD SetListener(nsIWebProgressListener * aListener) { return _to SetListener(aListener); } \
  NS_IMETHOD GetObserver(nsIObserver * *aObserver) { return _to GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIObserver * aObserver) { return _to SetObserver(aObserver); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITRANSFER(_to) \
  NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName, nsIMIMEInfo *aMIMEInfo, PRInt64 startTime, nsIWebBrowserPersist *aPersist) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aPersist); } \
  NS_IMETHOD GetListener(nsIWebProgressListener * *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetListener(aListener); } \
  NS_IMETHOD SetListener(nsIWebProgressListener * aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetListener(aListener); } \
  NS_IMETHOD GetObserver(nsIObserver * *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIObserver * aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetObserver(aObserver); } 

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

/* Header file */
class nsTransfer : public nsITransfer
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSITRANSFER

  nsTransfer();

private:
  ~nsTransfer();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsTransfer, nsITransfer)

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

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

/* void init (in nsIURI aSource, in nsIURI aTarget, in wstring aDisplayName, in nsIMIMEInfo aMIMEInfo, in long long startTime, in nsIWebBrowserPersist aPersist); */
NS_IMETHODIMP nsTransfer::Init(nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName, nsIMIMEInfo *aMIMEInfo, PRInt64 startTime, nsIWebBrowserPersist *aPersist)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsIWebProgressListener listener; */
NS_IMETHODIMP nsTransfer::GetListener(nsIWebProgressListener * *aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsTransfer::SetListener(nsIWebProgressListener * aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsIObserver observer; */
NS_IMETHODIMP nsTransfer::GetObserver(nsIObserver * *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsTransfer::SetObserver(nsIObserver * aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

/**
 * A component with this contract ID will be created each time a download is
 * started, and nsITransfer::Init will be called on it and an observer will be set.
 *
 * Notifications of the download progress will happen via
 * nsIWebProgressListener.
 *
 * If nsIObserver is implemented, the component may get a notification with
 * topic "temp-file" and an nsILocalFile instance as subject, which indicates
 * the location of a temporary file; i.e. a file in which the received data will
 * be stored, but which is not equal to the target file.
 *
 * INTERFACES THAT MUST BE IMPLEMENTED:
 *   nsITransfer
 *   nsIWebProgressListener
 *
 * INTERFACES THAT MAY BE IMPLEMENTED:
 *   nsIObserver
 */
#define NS_TRANSFER_CONTRACTID "@mozilla.org/transfer;1"

#endif /* __gen_nsITransfer_h__ */
