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

#ifndef __gen_calITransactionManager_h__
#define __gen_calITransactionManager_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 nsITransactionManager; /* forward declaration */

class calICalendar; /* forward declaration */

class calIItemBase; /* forward declaration */

class calIOperationListener; /* forward declaration */


/* starting interface:    calITransactionManager */
#define CALITRANSACTIONMANAGER_IID_STR "40a1ccf4-5f54-4815-b842-abf06f84dbfd"

#define CALITRANSACTIONMANAGER_IID \
  {0x40a1ccf4, 0x5f54, 0x4815, \
    { 0xb8, 0x42, 0xab, 0xf0, 0x6f, 0x84, 0xdb, 0xfd }}

/**
 * calITransactionManager is a service designed to handle nsITransactions
 * regarding the calendar.  It is here as a service so that we can keep the
 * transactions around without holding onto the whole global js scope+window.
 */
class NS_NO_VTABLE calITransactionManager : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(CALITRANSACTIONMANAGER_IID)

  /**
     * @param aAction       The Action to execute. This can be one of:
     *                        add     Adds an item
     *                        modify  Modfifies an item
     *                        delete  Deletes an item
     *                        move    Move an item from one calendar to the
     *                                next. With this operation, aCalendar is
     *                                the calendar that the event should be
     *                                moved to.
     * @param aCalendar     The Calendar to execute the transaction on
     * @param aItem         The changed item for this transaction. This item 
     *                      should be immutable
     * @param aOldItem      The Item in its original form. Only needed for 
     *                      modify.
     * @param aListener     The listener to call when the transaction has
     *                      completed. This parameter can be null.
     */
  /* void createAndCommitTxn (in AUTF8String aAction, in calIItemBase aItem, in calICalendar aCalendar, in calIItemBase aOldItem, in calIOperationListener aListener); */
  NS_IMETHOD CreateAndCommitTxn(const nsACString & aAction, calIItemBase *aItem, calICalendar *aCalendar, calIItemBase *aOldItem, calIOperationListener *aListener) = 0;

  /**
     * Signals the transaction manager that a series of transactions are going
     * to be performed, but that, for the purposes of undo and redo, they should
     * all be regarded as a single transaction. See also
     * nsITransactionManager::beginBatch
     */
  /* void beginBatch (); */
  NS_IMETHOD BeginBatch(void) = 0;

  /**
     * Ends the batch transaction in process. See also
     * nsITransactionManager::endBatch
     */
  /* void endBatch (); */
  NS_IMETHOD EndBatch(void) = 0;

  /**
     * Undo the last transaction in the transaction manager's stack
     */
  /* void undo (); */
  NS_IMETHOD Undo(void) = 0;

  /**
     * Returns true if it is possible to undo a transaction at this time
     */
  /* boolean canUndo (); */
  NS_IMETHOD CanUndo(PRBool *_retval) = 0;

  /**
     * Redo the last transaction
     */
  /* void redo (); */
  NS_IMETHOD Redo(void) = 0;

  /**
     * Returns true if it is possible to redo a transaction at this time
     */
  /* boolean canRedo (); */
  NS_IMETHOD CanRedo(PRBool *_retval) = 0;

  /**
     * A reference to the transaction manager for calendar operations
     */
  /* readonly attribute nsITransactionManager transactionManager; */
  NS_IMETHOD GetTransactionManager(nsITransactionManager * *aTransactionManager) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALITRANSACTIONMANAGER \
  NS_IMETHOD CreateAndCommitTxn(const nsACString & aAction, calIItemBase *aItem, calICalendar *aCalendar, calIItemBase *aOldItem, calIOperationListener *aListener); \
  NS_IMETHOD BeginBatch(void); \
  NS_IMETHOD EndBatch(void); \
  NS_IMETHOD Undo(void); \
  NS_IMETHOD CanUndo(PRBool *_retval); \
  NS_IMETHOD Redo(void); \
  NS_IMETHOD CanRedo(PRBool *_retval); \
  NS_IMETHOD GetTransactionManager(nsITransactionManager * *aTransactionManager); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALITRANSACTIONMANAGER(_to) \
  NS_IMETHOD CreateAndCommitTxn(const nsACString & aAction, calIItemBase *aItem, calICalendar *aCalendar, calIItemBase *aOldItem, calIOperationListener *aListener) { return _to CreateAndCommitTxn(aAction, aItem, aCalendar, aOldItem, aListener); } \
  NS_IMETHOD BeginBatch(void) { return _to BeginBatch(); } \
  NS_IMETHOD EndBatch(void) { return _to EndBatch(); } \
  NS_IMETHOD Undo(void) { return _to Undo(); } \
  NS_IMETHOD CanUndo(PRBool *_retval) { return _to CanUndo(_retval); } \
  NS_IMETHOD Redo(void) { return _to Redo(); } \
  NS_IMETHOD CanRedo(PRBool *_retval) { return _to CanRedo(_retval); } \
  NS_IMETHOD GetTransactionManager(nsITransactionManager * *aTransactionManager) { return _to GetTransactionManager(aTransactionManager); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_CALITRANSACTIONMANAGER(_to) \
  NS_IMETHOD CreateAndCommitTxn(const nsACString & aAction, calIItemBase *aItem, calICalendar *aCalendar, calIItemBase *aOldItem, calIOperationListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateAndCommitTxn(aAction, aItem, aCalendar, aOldItem, aListener); } \
  NS_IMETHOD BeginBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginBatch(); } \
  NS_IMETHOD EndBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->EndBatch(); } \
  NS_IMETHOD Undo(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Undo(); } \
  NS_IMETHOD CanUndo(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CanUndo(_retval); } \
  NS_IMETHOD Redo(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Redo(); } \
  NS_IMETHOD CanRedo(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CanRedo(_retval); } \
  NS_IMETHOD GetTransactionManager(nsITransactionManager * *aTransactionManager) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTransactionManager(aTransactionManager); } 

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

/* Header file */
class _MYCLASS_ : public calITransactionManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALITRANSACTIONMANAGER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* void createAndCommitTxn (in AUTF8String aAction, in calIItemBase aItem, in calICalendar aCalendar, in calIItemBase aOldItem, in calIOperationListener aListener); */
NS_IMETHODIMP _MYCLASS_::CreateAndCommitTxn(const nsACString & aAction, calIItemBase *aItem, calICalendar *aCalendar, calIItemBase *aOldItem, calIOperationListener *aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void beginBatch (); */
NS_IMETHODIMP _MYCLASS_::BeginBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void endBatch (); */
NS_IMETHODIMP _MYCLASS_::EndBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void undo (); */
NS_IMETHODIMP _MYCLASS_::Undo()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean canUndo (); */
NS_IMETHODIMP _MYCLASS_::CanUndo(PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void redo (); */
NS_IMETHODIMP _MYCLASS_::Redo()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean canRedo (); */
NS_IMETHODIMP _MYCLASS_::CanRedo(PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsITransactionManager transactionManager; */
NS_IMETHODIMP _MYCLASS_::GetTransactionManager(nsITransactionManager * *aTransactionManager)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_calITransactionManager_h__ */
