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

#ifndef __gen_calIOperation_h__
#define __gen_calIOperation_h__


#ifndef __gen_nsIVariant_h__
#include "nsIVariant.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:    calIOperation */
#define CALIOPERATION_IID_STR "b96c2997-7aaa-4619-ad48-b7ebd9236c93"

#define CALIOPERATION_IID \
  {0xb96c2997, 0x7aaa, 0x4619, \
    { 0xad, 0x48, 0xb7, 0xeb, 0xd9, 0x23, 0x6c, 0x93 }}

class NS_NO_VTABLE calIOperation : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(CALIOPERATION_IID)

  /**
     * Id for easy management of pending requests.
     */
  /* readonly attribute AUTF8String id; */
  NS_IMETHOD GetId(nsACString & aId) = 0;

  /**
     * Determines whether the request is pending, i.e. has not been completed.
     */
  /* readonly attribute boolean isPending; */
  NS_IMETHOD GetIsPending(PRBool *aIsPending) = 0;

  /**
     * Status of the request, e.g. NS_OK while pending or after successful
     * completion, or NS_ERROR_FAILED when failed.
     */
  /* readonly attribute nsIVariant status; */
  NS_IMETHOD GetStatus(nsIVariant * *aStatus) = 0;

  /**
     * Determines whether the request has succeeded, i.e. it has successfully
     * been completed.
     */
  /* readonly attribute boolean success; */
  NS_IMETHOD GetSuccess(PRBool *aSuccess) = 0;

  /**
     * Cancels a pending request and changes status.
     * @param aStatus operation status to be set;
     *                defaults to calIErrors.OPERATION_CANCELLED if null
     */
  /* void cancel (in nsIVariant aStatus); */
  NS_IMETHOD Cancel(nsIVariant *aStatus) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALIOPERATION \
  NS_IMETHOD GetId(nsACString & aId); \
  NS_IMETHOD GetIsPending(PRBool *aIsPending); \
  NS_IMETHOD GetStatus(nsIVariant * *aStatus); \
  NS_IMETHOD GetSuccess(PRBool *aSuccess); \
  NS_IMETHOD Cancel(nsIVariant *aStatus); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALIOPERATION(_to) \
  NS_IMETHOD GetId(nsACString & aId) { return _to GetId(aId); } \
  NS_IMETHOD GetIsPending(PRBool *aIsPending) { return _to GetIsPending(aIsPending); } \
  NS_IMETHOD GetStatus(nsIVariant * *aStatus) { return _to GetStatus(aStatus); } \
  NS_IMETHOD GetSuccess(PRBool *aSuccess) { return _to GetSuccess(aSuccess); } \
  NS_IMETHOD Cancel(nsIVariant *aStatus) { return _to Cancel(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_CALIOPERATION(_to) \
  NS_IMETHOD GetId(nsACString & aId) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetId(aId); } \
  NS_IMETHOD GetIsPending(PRBool *aIsPending) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsPending(aIsPending); } \
  NS_IMETHOD GetStatus(nsIVariant * *aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatus(aStatus); } \
  NS_IMETHOD GetSuccess(PRBool *aSuccess) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSuccess(aSuccess); } \
  NS_IMETHOD Cancel(nsIVariant *aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->Cancel(aStatus); } 

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

/* Header file */
class _MYCLASS_ : public calIOperation
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALIOPERATION

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* readonly attribute AUTF8String id; */
NS_IMETHODIMP _MYCLASS_::GetId(nsACString & aId)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean isPending; */
NS_IMETHODIMP _MYCLASS_::GetIsPending(PRBool *aIsPending)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIVariant status; */
NS_IMETHODIMP _MYCLASS_::GetStatus(nsIVariant * *aStatus)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean success; */
NS_IMETHODIMP _MYCLASS_::GetSuccess(PRBool *aSuccess)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void cancel (in nsIVariant aStatus); */
NS_IMETHODIMP _MYCLASS_::Cancel(nsIVariant *aStatus)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    calIGenericOperationListener */
#define CALIGENERICOPERATIONLISTENER_IID_STR "1fa39726-63d2-440c-a464-296d2822b9da"

#define CALIGENERICOPERATIONLISTENER_IID \
  {0x1fa39726, 0x63d2, 0x440c, \
    { 0xa4, 0x64, 0x29, 0x6d, 0x28, 0x22, 0xb9, 0xda }}

class NS_NO_VTABLE calIGenericOperationListener : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(CALIGENERICOPERATIONLISTENER_IID)

  /**
     * Generic callback receiving result.
     *
     * @param aOperation operation object
     * @param aResult    result or null in case of an error
     */
  /* void onResult (in calIOperation aOperation, in nsIVariant aResult); */
  NS_IMETHOD OnResult(calIOperation *aOperation, nsIVariant *aResult) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALIGENERICOPERATIONLISTENER \
  NS_IMETHOD OnResult(calIOperation *aOperation, nsIVariant *aResult); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALIGENERICOPERATIONLISTENER(_to) \
  NS_IMETHOD OnResult(calIOperation *aOperation, nsIVariant *aResult) { return _to OnResult(aOperation, aResult); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_CALIGENERICOPERATIONLISTENER(_to) \
  NS_IMETHOD OnResult(calIOperation *aOperation, nsIVariant *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnResult(aOperation, aResult); } 

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

/* Header file */
class _MYCLASS_ : public calIGenericOperationListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALIGENERICOPERATIONLISTENER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* void onResult (in calIOperation aOperation, in nsIVariant aResult); */
NS_IMETHODIMP _MYCLASS_::OnResult(calIOperation *aOperation, nsIVariant *aResult)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_calIOperation_h__ */
