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

#ifndef __gen_nsINetworkSeer_h__
#define __gen_nsINetworkSeer_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 nsILoadContext; /* forward declaration */

class nsINetworkSeerVerifier; /* forward declaration */

typedef uint32_t  SeerPredictReason;

typedef uint32_t  SeerLearnReason;


/* starting interface:    nsINetworkSeer */
#define NS_INETWORKSEER_IID_STR "884a39a0-a3ed-4855-826a-fabb73ae878d"

#define NS_INETWORKSEER_IID \
  {0x884a39a0, 0xa3ed, 0x4855, \
    { 0x82, 0x6a, 0xfa, 0xbb, 0x73, 0xae, 0x87, 0x8d }}

class NS_NO_VTABLE nsINetworkSeer : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INETWORKSEER_IID)

  enum {
    PREDICT_LINK = 0U,
    PREDICT_LOAD = 1U,
    PREDICT_STARTUP = 2U
  };

  /* void predict (in nsIURI targetURI, in nsIURI sourceURI, in SeerPredictReason reason, in nsILoadContext loadContext, in nsINetworkSeerVerifier verifier); */
  NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, SeerPredictReason reason, nsILoadContext *loadContext, nsINetworkSeerVerifier *verifier) = 0;

  enum {
    LEARN_LOAD_TOPLEVEL = 0U,
    LEARN_LOAD_SUBRESOURCE = 1U,
    LEARN_LOAD_REDIRECT = 2U,
    LEARN_STARTUP = 3U
  };

  /* void learn (in nsIURI targetURI, in nsIURI sourceURI, in SeerLearnReason reason, in nsILoadContext loadContext); */
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, SeerLearnReason reason, nsILoadContext *loadContext) = 0;

  /* void reset (); */
  NS_IMETHOD Reset(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsINetworkSeer, NS_INETWORKSEER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSINETWORKSEER \
  NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, SeerPredictReason reason, nsILoadContext *loadContext, nsINetworkSeerVerifier *verifier); \
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, SeerLearnReason reason, nsILoadContext *loadContext); \
  NS_IMETHOD Reset(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSINETWORKSEER(_to) \
  NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, SeerPredictReason reason, nsILoadContext *loadContext, nsINetworkSeerVerifier *verifier) { return _to Predict(targetURI, sourceURI, reason, loadContext, verifier); } \
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, SeerLearnReason reason, nsILoadContext *loadContext) { return _to Learn(targetURI, sourceURI, reason, loadContext); } \
  NS_IMETHOD Reset(void) { return _to Reset(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSINETWORKSEER(_to) \
  NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, SeerPredictReason reason, nsILoadContext *loadContext, nsINetworkSeerVerifier *verifier) { return !_to ? NS_ERROR_NULL_POINTER : _to->Predict(targetURI, sourceURI, reason, loadContext, verifier); } \
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, SeerLearnReason reason, nsILoadContext *loadContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->Learn(targetURI, sourceURI, reason, loadContext); } \
  NS_IMETHOD Reset(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Reset(); } 

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

/* Header file */
class nsNetworkSeer : public nsINetworkSeer
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSINETWORKSEER

  nsNetworkSeer();

private:
  ~nsNetworkSeer();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsNetworkSeer, nsINetworkSeer)

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

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

/* void predict (in nsIURI targetURI, in nsIURI sourceURI, in SeerPredictReason reason, in nsILoadContext loadContext, in nsINetworkSeerVerifier verifier); */
NS_IMETHODIMP nsNetworkSeer::Predict(nsIURI *targetURI, nsIURI *sourceURI, SeerPredictReason reason, nsILoadContext *loadContext, nsINetworkSeerVerifier *verifier)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void learn (in nsIURI targetURI, in nsIURI sourceURI, in SeerLearnReason reason, in nsILoadContext loadContext); */
NS_IMETHODIMP nsNetworkSeer::Learn(nsIURI *targetURI, nsIURI *sourceURI, SeerLearnReason reason, nsILoadContext *loadContext)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void reset (); */
NS_IMETHODIMP nsNetworkSeer::Reset()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

// Wrapper functions to make use of the seer easier and less invasive
class nsIChannel;
class nsIDocument;
class nsILoadContext;
class nsILoadGroup;
class nsINetworkSeerVerifier;
namespace mozilla {
namespace net {
nsresult SeerPredict(nsIURI *targetURI,
                     nsIURI *sourceURI,
                     SeerPredictReason reason,
                     nsILoadContext *loadContext,
                     nsINetworkSeerVerifier *verifier);
nsresult SeerLearn(nsIURI *targetURI,
                   nsIURI *sourceURI,
                   SeerLearnReason reason,
                   nsILoadContext *loadContext);
nsresult SeerLearn(nsIURI *targetURI,
                   nsIURI *sourceURI,
                   SeerLearnReason reason,
                   nsILoadGroup *loadGroup);
nsresult SeerLearn(nsIURI *targetURI,
                   nsIURI *sourceURI,
                   SeerLearnReason reason,
                   nsIDocument *document);
nsresult SeerLearnRedirect(nsIURI *targetURI,
                           nsIChannel *channel,
                           nsILoadContext *loadContext);
} // mozilla::net
} // mozilla

#endif /* __gen_nsINetworkSeer_h__ */
