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

#ifndef __gen_nsIWebBrowserPersist_h__
#define __gen_nsIWebBrowserPersist_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.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 nsIInputStream; /* forward declaration */

class nsIDOMDocument; /* forward declaration */

class nsIWebProgressListener; /* forward declaration */

class nsILocalFile; /* forward declaration */


/* starting interface:    nsIWebBrowserPersist */
#define NS_IWEBBROWSERPERSIST_IID_STR "814ba433-a816-4785-9f95-ad3ba0a43dab"

#define NS_IWEBBROWSERPERSIST_IID \
  {0x814ba433, 0xa816, 0x4785, \
    { 0x9f, 0x95, 0xad, 0x3b, 0xa0, 0xa4, 0x3d, 0xab }}

/**
 * @status UNDER_REVIEW
 */
/**
 * Interface for persisting DOM documents and URIs to local storage.
 */
class NS_NO_VTABLE nsIWebBrowserPersist : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSERPERSIST_IID)

  /** No special persistence behaviour. */
  enum { PERSIST_FLAGS_NONE = 0U };

  /** Only use cached data (could result in failure if data is not cached). */
  enum { PERSIST_FLAGS_FROM_CACHE = 1U };

  /** Bypass the cached data. */
  enum { PERSIST_FLAGS_BYPASS_CACHE = 2U };

  /** Ignore any redirected data (usually adverts). */
  enum { PERSIST_FLAGS_IGNORE_REDIRECTED_DATA = 4U };

  /** Ignore IFRAME content (usually adverts). */
  enum { PERSIST_FLAGS_IGNORE_IFRAMES = 8U };

  /** Do not run the incoming data through a content converter e.g. to decompress it */
  enum { PERSIST_FLAGS_NO_CONVERSION = 16U };

  /** Flags governing how data is fetched from the network. */
  /* attribute unsigned long persistFlags; */
  NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags) = 0;
  NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags) = 0;

  /** Persister is ready to save data */
  enum { PERSIST_STATE_READY = 1U };

  /** Persister is saving data */
  enum { PERSIST_STATE_SAVING = 2U };

  /** Persister has finished saving data */
  enum { PERSIST_STATE_FINISHED = 3U };

  /**
   * Current state of the persister object.
   */
  /* readonly attribute unsigned long currentState; */
  NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState) = 0;

  /**
   * Value indicating the success or failure of the persist
   * operation.
   *
   * @return NS_OK Operation was successful or is still ongoing.
   * @return NS_BINDING_ABORTED Operation cancelled.
   * @return NS_ERROR_FAILURE Non-specific failure.
   */
  /* readonly attribute unsigned long result; */
  NS_IMETHOD GetResult(PRUint32 *aResult) = 0;

  /**
   * Callback listener for progress notifications.
   */
  /* attribute nsIWebProgressListener progressListener; */
  NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener) = 0;
  NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener) = 0;

  /**
   * Save the specified URI to file.
   *
   * @param aURI       URI to save to file or <CODE>nsnull</CODE> 
   *                   to use current URI if the implementation supports such
   *                   a concept.
   * @param aPostData  Data to pass with in an HTTP request or nsnull.
   * @param aFile      Target local file.
   *
   * @return NS_OK Operation has been started.
   * @return NS_ERROR_INVALID_ARG One or more arguments was invalid.
   */
  /* void saveURI (in nsIURI aURI, in nsIInputStream aPostData, in nsILocalFile aFile); */
  NS_IMETHOD SaveURI(nsIURI *aURI, nsIInputStream *aPostData, nsILocalFile *aFile) = 0;

  /**
   * Save the specified DOM document to file and optionally all linked files
   * (e.g. images, CSS, JS & subframes). Do not call this method until the
   * document has finished loading!
   *
   * @param aDocument  Document to save to file.
   * @param aFile      Target local file.
   * @param aDataPath  Path to folder (which must already exist) to save
   *                   linked files to or nsnull.
   *
   * @return NS_OK Operation has been started.
   * @return NS_ERROR_INVALID_ARG One or more arguments was invalid.
   */
  /* void saveDocument (in nsIDOMDocument aDocument, in nsILocalFile aFile, in nsILocalFile aDataPath); */
  NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsILocalFile *aFile, nsILocalFile *aDataPath) = 0;

  /**
   * Cancels the current operation. The caller is responsible for cleaning up
   * partially written files or directories.
   */
  /* void cancelSave (); */
  NS_IMETHOD CancelSave(void) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWEBBROWSERPERSIST \
  NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags); \
  NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags); \
  NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState); \
  NS_IMETHOD GetResult(PRUint32 *aResult); \
  NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener); \
  NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener); \
  NS_IMETHOD SaveURI(nsIURI *aURI, nsIInputStream *aPostData, nsILocalFile *aFile); \
  NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsILocalFile *aFile, nsILocalFile *aDataPath); \
  NS_IMETHOD CancelSave(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWEBBROWSERPERSIST(_to) \
  NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags) { return _to GetPersistFlags(aPersistFlags); } \
  NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags) { return _to SetPersistFlags(aPersistFlags); } \
  NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState) { return _to GetCurrentState(aCurrentState); } \
  NS_IMETHOD GetResult(PRUint32 *aResult) { return _to GetResult(aResult); } \
  NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener) { return _to GetProgressListener(aProgressListener); } \
  NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener) { return _to SetProgressListener(aProgressListener); } \
  NS_IMETHOD SaveURI(nsIURI *aURI, nsIInputStream *aPostData, nsILocalFile *aFile) { return _to SaveURI(aURI, aPostData, aFile); } \
  NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsILocalFile *aFile, nsILocalFile *aDataPath) { return _to SaveDocument(aDocument, aFile, aDataPath); } \
  NS_IMETHOD CancelSave(void) { return _to CancelSave(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIWEBBROWSERPERSIST(_to) \
  NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPersistFlags(aPersistFlags); } \
  NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPersistFlags(aPersistFlags); } \
  NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentState(aCurrentState); } \
  NS_IMETHOD GetResult(PRUint32 *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResult(aResult); } \
  NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProgressListener(aProgressListener); } \
  NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetProgressListener(aProgressListener); } \
  NS_IMETHOD SaveURI(nsIURI *aURI, nsIInputStream *aPostData, nsILocalFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveURI(aURI, aPostData, aFile); } \
  NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsILocalFile *aFile, nsILocalFile *aDataPath) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveDocument(aDocument, aFile, aDataPath); } \
  NS_IMETHOD CancelSave(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CancelSave(); } 

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

/* Header file */
class nsWebBrowserPersist : public nsIWebBrowserPersist
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIWEBBROWSERPERSIST

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsWebBrowserPersist, nsIWebBrowserPersist)

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

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

/* attribute unsigned long persistFlags; */
NS_IMETHODIMP nsWebBrowserPersist::GetPersistFlags(PRUint32 *aPersistFlags)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsWebBrowserPersist::SetPersistFlags(PRUint32 aPersistFlags)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long currentState; */
NS_IMETHODIMP nsWebBrowserPersist::GetCurrentState(PRUint32 *aCurrentState)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long result; */
NS_IMETHODIMP nsWebBrowserPersist::GetResult(PRUint32 *aResult)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute nsIWebProgressListener progressListener; */
NS_IMETHODIMP nsWebBrowserPersist::GetProgressListener(nsIWebProgressListener * *aProgressListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsWebBrowserPersist::SetProgressListener(nsIWebProgressListener * aProgressListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void saveURI (in nsIURI aURI, in nsIInputStream aPostData, in nsILocalFile aFile); */
NS_IMETHODIMP nsWebBrowserPersist::SaveURI(nsIURI *aURI, nsIInputStream *aPostData, nsILocalFile *aFile)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void saveDocument (in nsIDOMDocument aDocument, in nsILocalFile aFile, in nsILocalFile aDataPath); */
NS_IMETHODIMP nsWebBrowserPersist::SaveDocument(nsIDOMDocument *aDocument, nsILocalFile *aFile, nsILocalFile *aDataPath)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void cancelSave (); */
NS_IMETHODIMP nsWebBrowserPersist::CancelSave()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIWebBrowserPersist_h__ */
