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

#ifndef __gen_ipcILockService_h__
#define __gen_ipcILockService_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 ipcILockNotify; /* forward declaration */


/* starting interface:    ipcILockService */
#define IPCILOCKSERVICE_IID_STR "9f6dbe15-d851-4b00-912a-5ac0be88a409"

#define IPCILOCKSERVICE_IID \
  {0x9f6dbe15, 0xd851, 0x4b00, \
    { 0x91, 0x2a, 0x5a, 0xc0, 0xbe, 0x88, 0xa4, 0x09 }}

/**
 * This service provides named interprocess locking with either synchronous
 * or asynchronous waiting.
 */
class NS_NO_VTABLE ipcILockService : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(IPCILOCKSERVICE_IID)

  /**
     * Call this method to acquire a named lock.  Pass a notification handler
     * to be notified asynchronously when the lock is acquired.  Otherwise,
     * this function will block until the lock is acquired.
     *
     * @param aLockName
     *        specifies the name of the lock
     * @param aNotify
     *        notification callback (NULL to synchronously acquire lock)
     * @param aWaitIfBusy
     *        wait for the lock to become available; otherwise, fail if lock
     *        is already held by some other process.
     */
  /* void acquireLock (in string aLockName, in ipcILockNotify aNotify, in boolean aWaitIfBusy); */
  NS_IMETHOD AcquireLock(const char *aLockName, ipcILockNotify *aNotify, PRBool aWaitIfBusy) = 0;

  /**
     * Call this method to release a named lock.  This method can be called
     * before OnAcquireLockComplete has been called, which will effectively
     * cancel the request to acquire the named lock.  OnAcquireLockComplete
     * will not be called after a call to ReleaseLock.
     *
     * @param aLockName
     *        specifies the name of the lock
     */
  /* void releaseLock (in string aLockName); */
  NS_IMETHOD ReleaseLock(const char *aLockName) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IPCILOCKSERVICE \
  NS_IMETHOD AcquireLock(const char *aLockName, ipcILockNotify *aNotify, PRBool aWaitIfBusy); \
  NS_IMETHOD ReleaseLock(const char *aLockName); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_IPCILOCKSERVICE(_to) \
  NS_IMETHOD AcquireLock(const char *aLockName, ipcILockNotify *aNotify, PRBool aWaitIfBusy) { return _to AcquireLock(aLockName, aNotify, aWaitIfBusy); } \
  NS_IMETHOD ReleaseLock(const char *aLockName) { return _to ReleaseLock(aLockName); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_IPCILOCKSERVICE(_to) \
  NS_IMETHOD AcquireLock(const char *aLockName, ipcILockNotify *aNotify, PRBool aWaitIfBusy) { return !_to ? NS_ERROR_NULL_POINTER : _to->AcquireLock(aLockName, aNotify, aWaitIfBusy); } \
  NS_IMETHOD ReleaseLock(const char *aLockName) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReleaseLock(aLockName); } 

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

/* Header file */
class _MYCLASS_ : public ipcILockService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_IPCILOCKSERVICE

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(_MYCLASS_, ipcILockService)

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

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

/* void acquireLock (in string aLockName, in ipcILockNotify aNotify, in boolean aWaitIfBusy); */
NS_IMETHODIMP _MYCLASS_::AcquireLock(const char *aLockName, ipcILockNotify *aNotify, PRBool aWaitIfBusy)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void releaseLock (in string aLockName); */
NS_IMETHODIMP _MYCLASS_::ReleaseLock(const char *aLockName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    ipcILockNotify */
#define IPCILOCKNOTIFY_IID_STR "b4ac1160-98a4-4030-aecc-01137a05c94b"

#define IPCILOCKNOTIFY_IID \
  {0xb4ac1160, 0x98a4, 0x4030, \
    { 0xae, 0xcc, 0x01, 0x13, 0x7a, 0x05, 0xc9, 0x4b }}

class NS_NO_VTABLE ipcILockNotify : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(IPCILOCKNOTIFY_IID)

  /**
     * Called to complete a call to AcquireLock.
     *
     * @status aLockName
     *         specifies the name of the lock
     * @status aStatus
     *         NS_OK if lock has been acquired; reason for failure otherwise.
     */
  /* void onAcquireLockComplete (in string aLockName, in nsresult aStatus); */
  NS_IMETHOD OnAcquireLockComplete(const char *aLockName, nsresult aStatus) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IPCILOCKNOTIFY \
  NS_IMETHOD OnAcquireLockComplete(const char *aLockName, nsresult aStatus); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_IPCILOCKNOTIFY(_to) \
  NS_IMETHOD OnAcquireLockComplete(const char *aLockName, nsresult aStatus) { return _to OnAcquireLockComplete(aLockName, aStatus); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_IPCILOCKNOTIFY(_to) \
  NS_IMETHOD OnAcquireLockComplete(const char *aLockName, nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAcquireLockComplete(aLockName, aStatus); } 

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

/* Header file */
class _MYCLASS_ : public ipcILockNotify
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_IPCILOCKNOTIFY

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(_MYCLASS_, ipcILockNotify)

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

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

/* void onAcquireLockComplete (in string aLockName, in nsresult aStatus); */
NS_IMETHODIMP _MYCLASS_::OnAcquireLockComplete(const char *aLockName, nsresult aStatus)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_ipcILockService_h__ */
