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

#ifndef __gen_nsIUrlClassifierDBService_h__
#define __gen_nsIUrlClassifierDBService_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

/* starting interface:    nsIUrlClassifierCallback */
#define NS_IURLCLASSIFIERCALLBACK_IID_STR "4ca27b6b-a674-4b3d-ab30-d21e2da2dffb"

#define NS_IURLCLASSIFIERCALLBACK_IID \
  {0x4ca27b6b, 0xa674, 0x4b3d, \
    { 0xab, 0x30, 0xd2, 0x1e, 0x2d, 0xa2, 0xdf, 0xfb }}

class NS_NO_VTABLE nsIUrlClassifierCallback : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IURLCLASSIFIERCALLBACK_IID)

  /* void handleEvent (in ACString value); */
  NS_IMETHOD HandleEvent(const nsACString & value) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIURLCLASSIFIERCALLBACK \
  NS_IMETHOD HandleEvent(const nsACString & value); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIURLCLASSIFIERCALLBACK(_to) \
  NS_IMETHOD HandleEvent(const nsACString & value) { return _to HandleEvent(value); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIURLCLASSIFIERCALLBACK(_to) \
  NS_IMETHOD HandleEvent(const nsACString & value) { return !_to ? NS_ERROR_NULL_POINTER : _to->HandleEvent(value); } 

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

/* Header file */
class nsUrlClassifierCallback : public nsIUrlClassifierCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIURLCLASSIFIERCALLBACK

  nsUrlClassifierCallback();

private:
  ~nsUrlClassifierCallback();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsUrlClassifierCallback, nsIUrlClassifierCallback)

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

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

/* void handleEvent (in ACString value); */
NS_IMETHODIMP nsUrlClassifierCallback::HandleEvent(const nsACString & value)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsIUrlClassifierDBService */
#define NS_IURLCLASSIFIERDBSERVICE_IID_STR "211d5360-4af6-4a1d-99c1-926d35861eaf"

#define NS_IURLCLASSIFIERDBSERVICE_IID \
  {0x211d5360, 0x4af6, 0x4a1d, \
    { 0x99, 0xc1, 0x92, 0x6d, 0x35, 0x86, 0x1e, 0xaf }}

/**
 * This is a proxy class that is instantiated and called from the JS thread.
 * It provides async methods for querying and updating the database.  As the
 * methods complete, they call the callback function.
 */
class NS_NO_VTABLE nsIUrlClassifierDBService : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IURLCLASSIFIERDBSERVICE_IID)

  /**
   * Looks up a key in the database.  After it finds a value, it calls
   * callback with the value as the first param.  If the key is not in
   * the db or the table does not exist, the callback is called with
   * an empty string parameter.
   */
  /* void exists (in ACString tableName, in ACString key, in nsIUrlClassifierCallback c); */
  NS_IMETHOD Exists(const nsACString & tableName, const nsACString & key, nsIUrlClassifierCallback *c) = 0;

  /**
   * Checks to see if the tables exist.  tableNames is a comma separated list
   * of table names to check.  The callback is called with a comma separated
   * list of tables that no longer exist (either the db is corrupted or the
   * user deleted the file).
   */
  /* void checkTables (in ACString tableNames, in nsIUrlClassifierCallback c); */
  NS_IMETHOD CheckTables(const nsACString & tableNames, nsIUrlClassifierCallback *c) = 0;

  /**
   * Updates the table in the background.  Calls callback after each table
   * completes processing with the new table line as the parameter.  This
   * allows us to keep track of the table version in our main thread.
   */
  /* void updateTables (in ACString updateString, in nsIUrlClassifierCallback c); */
  NS_IMETHOD UpdateTables(const nsACString & updateString, nsIUrlClassifierCallback *c) = 0;

  /**
   * Update the table incrementally.
   */
  /* void update (in ACString updateChunk); */
  NS_IMETHOD Update(const nsACString & updateChunk) = 0;

  /**
   * Finish an incremental update.  This commits any pending tables and
   * calls the callback for each completed table.
   */
  /* void finish (in nsIUrlClassifierCallback c); */
  NS_IMETHOD Finish(nsIUrlClassifierCallback *c) = 0;

  /**
   * Cancel an incremental update.  This rolls back and pending changes.
   * and resets the stream interface.
   */
  /* void cancelStream (); */
  NS_IMETHOD CancelStream(void) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIURLCLASSIFIERDBSERVICE \
  NS_IMETHOD Exists(const nsACString & tableName, const nsACString & key, nsIUrlClassifierCallback *c); \
  NS_IMETHOD CheckTables(const nsACString & tableNames, nsIUrlClassifierCallback *c); \
  NS_IMETHOD UpdateTables(const nsACString & updateString, nsIUrlClassifierCallback *c); \
  NS_IMETHOD Update(const nsACString & updateChunk); \
  NS_IMETHOD Finish(nsIUrlClassifierCallback *c); \
  NS_IMETHOD CancelStream(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIURLCLASSIFIERDBSERVICE(_to) \
  NS_IMETHOD Exists(const nsACString & tableName, const nsACString & key, nsIUrlClassifierCallback *c) { return _to Exists(tableName, key, c); } \
  NS_IMETHOD CheckTables(const nsACString & tableNames, nsIUrlClassifierCallback *c) { return _to CheckTables(tableNames, c); } \
  NS_IMETHOD UpdateTables(const nsACString & updateString, nsIUrlClassifierCallback *c) { return _to UpdateTables(updateString, c); } \
  NS_IMETHOD Update(const nsACString & updateChunk) { return _to Update(updateChunk); } \
  NS_IMETHOD Finish(nsIUrlClassifierCallback *c) { return _to Finish(c); } \
  NS_IMETHOD CancelStream(void) { return _to CancelStream(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIURLCLASSIFIERDBSERVICE(_to) \
  NS_IMETHOD Exists(const nsACString & tableName, const nsACString & key, nsIUrlClassifierCallback *c) { return !_to ? NS_ERROR_NULL_POINTER : _to->Exists(tableName, key, c); } \
  NS_IMETHOD CheckTables(const nsACString & tableNames, nsIUrlClassifierCallback *c) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckTables(tableNames, c); } \
  NS_IMETHOD UpdateTables(const nsACString & updateString, nsIUrlClassifierCallback *c) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateTables(updateString, c); } \
  NS_IMETHOD Update(const nsACString & updateChunk) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(updateChunk); } \
  NS_IMETHOD Finish(nsIUrlClassifierCallback *c) { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(c); } \
  NS_IMETHOD CancelStream(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CancelStream(); } 

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

/* Header file */
class nsUrlClassifierDBService : public nsIUrlClassifierDBService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIURLCLASSIFIERDBSERVICE

  nsUrlClassifierDBService();

private:
  ~nsUrlClassifierDBService();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsUrlClassifierDBService, nsIUrlClassifierDBService)

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

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

/* void exists (in ACString tableName, in ACString key, in nsIUrlClassifierCallback c); */
NS_IMETHODIMP nsUrlClassifierDBService::Exists(const nsACString & tableName, const nsACString & key, nsIUrlClassifierCallback *c)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void checkTables (in ACString tableNames, in nsIUrlClassifierCallback c); */
NS_IMETHODIMP nsUrlClassifierDBService::CheckTables(const nsACString & tableNames, nsIUrlClassifierCallback *c)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void updateTables (in ACString updateString, in nsIUrlClassifierCallback c); */
NS_IMETHODIMP nsUrlClassifierDBService::UpdateTables(const nsACString & updateString, nsIUrlClassifierCallback *c)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void update (in ACString updateChunk); */
NS_IMETHODIMP nsUrlClassifierDBService::Update(const nsACString & updateChunk)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void finish (in nsIUrlClassifierCallback c); */
NS_IMETHODIMP nsUrlClassifierDBService::Finish(nsIUrlClassifierCallback *c)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void cancelStream (); */
NS_IMETHODIMP nsUrlClassifierDBService::CancelStream()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsIUrlClassifierDBServiceWorker */
#define NS_IURLCLASSIFIERDBSERVICEWORKER_IID_STR "5d405325-2ba1-4040-b69b-8bda8353d3d3"

#define NS_IURLCLASSIFIERDBSERVICEWORKER_IID \
  {0x5d405325, 0x2ba1, 0x4040, \
    { 0xb6, 0x9b, 0x8b, 0xda, 0x83, 0x53, 0xd3, 0xd3 }}

/**
 * Interface for the actual worker thread.  Implementations of this need not
 * be thread aware and just work on the database.
 */
class NS_NO_VTABLE nsIUrlClassifierDBServiceWorker : public nsIUrlClassifierDBService {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IURLCLASSIFIERDBSERVICEWORKER_IID)

  /* void closeDb (); */
  NS_IMETHOD CloseDb(void) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIURLCLASSIFIERDBSERVICEWORKER \
  NS_IMETHOD CloseDb(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIURLCLASSIFIERDBSERVICEWORKER(_to) \
  NS_IMETHOD CloseDb(void) { return _to CloseDb(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIURLCLASSIFIERDBSERVICEWORKER(_to) \
  NS_IMETHOD CloseDb(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloseDb(); } 

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

/* Header file */
class nsUrlClassifierDBServiceWorker : public nsIUrlClassifierDBServiceWorker
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIURLCLASSIFIERDBSERVICEWORKER

  nsUrlClassifierDBServiceWorker();

private:
  ~nsUrlClassifierDBServiceWorker();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsUrlClassifierDBServiceWorker, nsIUrlClassifierDBServiceWorker)

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

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

/* void closeDb (); */
NS_IMETHODIMP nsUrlClassifierDBServiceWorker::CloseDb()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIUrlClassifierDBService_h__ */
