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

#ifndef __gen_nsIFileLocator_h__
#define __gen_nsIFileLocator_h__

#include "nsISupports.h"

#include "nscore.h"
#include "nsIServiceManager.h"
class nsIFileSpec; /* forward declaration */


/* starting interface:    nsIFileLocator */
#define NS_IFILELOCATOR_IID_STR "7e44eb01-e600-11d2-915f-f08a208628fc"

#define NS_IFILELOCATOR_IID \
  {0x7e44eb01, 0xe600, 0x11d2, \
    { 0x91, 0x5f, 0xf0, 0x8a, 0x20, 0x86, 0x28, 0xfc }}

class NS_NO_VTABLE nsIFileLocator : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILELOCATOR_IID)

  /* nsIFileSpec GetFileLocation (in unsigned long selector); */
  NS_IMETHOD GetFileLocation(PRUint32 selector, nsIFileSpec **_retval) = 0;

  /* void ForgetProfileDir (); */
  NS_IMETHOD ForgetProfileDir(void) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFILELOCATOR \
  NS_IMETHOD GetFileLocation(PRUint32 selector, nsIFileSpec **_retval); \
  NS_IMETHOD ForgetProfileDir(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFILELOCATOR(_to) \
  NS_IMETHOD GetFileLocation(PRUint32 selector, nsIFileSpec **_retval) { return _to ## GetFileLocation(selector, _retval); } \
  NS_IMETHOD ForgetProfileDir(void) { return _to ## ForgetProfileDir(); } 

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

/* Header file */
class nsFileLocator : public nsIFileLocator
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIFILELOCATOR

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsFileLocator, nsIFileLocator)

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

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

/* nsIFileSpec GetFileLocation (in unsigned long selector); */
NS_IMETHODIMP nsFileLocator::GetFileLocation(PRUint32 selector, nsIFileSpec **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void ForgetProfileDir (); */
NS_IMETHODIMP nsFileLocator::ForgetProfileDir()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

// {CFC599F0-04CA-11d3-8068-00600811A9C3}
// {78043e01-e603-11d2-915f-f08a208628fc}
#define NS_FILELOCATOR_CID \
{ 0x78043e01, 0xe603, 0x11d2, \
  {0x91, 0x5f, 0xf0, 0x8a, 0x20, 0x86, 0x28, 0xfc} }
#define NS_FILELOCATOR_CONTRACTID \
    "@mozilla.org/filelocator;1"
// Factory method used in NSGetFactory for appshell.
extern "C" NS_APPSHELL nsresult
NS_NewFileLocatorFactory(nsIFactory** aFactory);
// Mostly, all you want to do is this:
inline nsIFileSpec* NS_LocateFileOrDirectory(PRUint32 selector)
{
    nsresult rv;
    nsIFileSpec* spec = nsnull;
    NS_WITH_SERVICE(nsIFileLocator, locator, NS_FILELOCATOR_CONTRACTID, &rv);
    if (NS_SUCCEEDED(rv) && locator)
        locator->GetFileLocation(selector, &spec);
    return spec;
}

#endif /* __gen_nsIFileLocator_h__ */
