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

#ifndef __gen_calIChangeLog_h__
#define __gen_calIChangeLog_h__


#ifndef __gen_calICalendar_h__
#include "calICalendar.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class calIGenericOperationListener; /* forward declaration */

class calIOperation; /* forward declaration */


/* starting interface:    calISyncCalendar */
#define CALISYNCCALENDAR_IID_STR "cef78f0e-bdbe-4534-8546-29b3e85be148"

#define CALISYNCCALENDAR_IID \
  {0xcef78f0e, 0xbdbe, 0x4534, \
    { 0x85, 0x46, 0x29, 0xb3, 0xe8, 0x5b, 0xe1, 0x48 }}

/**
 * Interface for synchronously working providers, e.g. storage, memory.
 *
 * @note
 *   This interface is used in conjunction with changelog-based synchronization
 *   and additionally offers storing meta-data for items for this purpose.
 *   The meta data is stored as long as the corresponding items persist in
 *   the calendar and automatically cleanup up once the item is deleted from
 *   the calendar, but is not altered when an item is modified (modifyItem).
 *   Meta data can be fetched/stored per (master) item, i.e. if you need to
 *   store meta data for individual overridden items, you need to store it
 *   along with the master item's meta data.
 *   Finally, keep in mind that the meta data is "calendar local" and not
 *   automatically transferred when storing the item on another calISyncCalendar.
 */
class NS_NO_VTABLE calISyncCalendar : public calICalendar {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(CALISYNCCALENDAR_IID)

  /**
     * Adds or replaces meta data of an item.
     *
     * @param id    an item id
     * @param value an arbitrary string
     */
  /* void setMetaData (in AUTF8String id, in AUTF8String value); */
  NS_IMETHOD SetMetaData(const nsACString & id, const nsACString & value) = 0;

  /**
     * Deletes meta data of an item.
     *
     * @param id    an item id
     */
  /* void deleteMetaData (in AUTF8String id); */
  NS_IMETHOD DeleteMetaData(const nsACString & id) = 0;

  /**
     * Gets meta data of an item or null if there's none or the item id is invalid.
     *
     * @param id    an item id
     */
  /* AUTF8String getMetaData (in AUTF8String id); */
  NS_IMETHOD GetMetaData(const nsACString & id, nsACString & _retval) = 0;

  /**
     * Gets all meta data. The returned arrays are of the same length.
     */
  /* void getAllMetaData (out PRUint32 count, [array, size_is (count)] out wstring ids, [array, size_is (count)] out wstring values); */
  NS_IMETHOD GetAllMetaData(PRUint32 *count, PRUnichar ***ids, PRUnichar ***values) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALISYNCCALENDAR \
  NS_IMETHOD SetMetaData(const nsACString & id, const nsACString & value); \
  NS_IMETHOD DeleteMetaData(const nsACString & id); \
  NS_IMETHOD GetMetaData(const nsACString & id, nsACString & _retval); \
  NS_IMETHOD GetAllMetaData(PRUint32 *count, PRUnichar ***ids, PRUnichar ***values); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALISYNCCALENDAR(_to) \
  NS_IMETHOD SetMetaData(const nsACString & id, const nsACString & value) { return _to SetMetaData(id, value); } \
  NS_IMETHOD DeleteMetaData(const nsACString & id) { return _to DeleteMetaData(id); } \
  NS_IMETHOD GetMetaData(const nsACString & id, nsACString & _retval) { return _to GetMetaData(id, _retval); } \
  NS_IMETHOD GetAllMetaData(PRUint32 *count, PRUnichar ***ids, PRUnichar ***values) { return _to GetAllMetaData(count, ids, values); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_CALISYNCCALENDAR(_to) \
  NS_IMETHOD SetMetaData(const nsACString & id, const nsACString & value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMetaData(id, value); } \
  NS_IMETHOD DeleteMetaData(const nsACString & id) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteMetaData(id); } \
  NS_IMETHOD GetMetaData(const nsACString & id, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMetaData(id, _retval); } \
  NS_IMETHOD GetAllMetaData(PRUint32 *count, PRUnichar ***ids, PRUnichar ***values) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllMetaData(count, ids, values); } 

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

/* Header file */
class _MYCLASS_ : public calISyncCalendar
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALISYNCCALENDAR

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* void setMetaData (in AUTF8String id, in AUTF8String value); */
NS_IMETHODIMP _MYCLASS_::SetMetaData(const nsACString & id, const nsACString & value)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void deleteMetaData (in AUTF8String id); */
NS_IMETHODIMP _MYCLASS_::DeleteMetaData(const nsACString & id)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AUTF8String getMetaData (in AUTF8String id); */
NS_IMETHODIMP _MYCLASS_::GetMetaData(const nsACString & id, nsACString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getAllMetaData (out PRUint32 count, [array, size_is (count)] out wstring ids, [array, size_is (count)] out wstring values); */
NS_IMETHODIMP _MYCLASS_::GetAllMetaData(PRUint32 *count, PRUnichar ***ids, PRUnichar ***values)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    calIChangeLog */
#define CALICHANGELOG_IID_STR "0bf4c6a2-b4c7-4cae-993a-4408d8bded3e"

#define CALICHANGELOG_IID \
  {0x0bf4c6a2, 0xb4c7, 0x4cae, \
    { 0x99, 0x3a, 0x44, 0x08, 0xd8, 0xbd, 0xed, 0x3e }}

/**
 * Calendar implementing this interface have improved means of replaying their
 * changelog data. This could for example mean, that the provider can retrieve
 * changes between now and the last sync.
 *
 * Not implementing this interface is perfectly valid for calendars, that need
 * to do a full sync each time anyway (i.e ics)
 */
class NS_NO_VTABLE calIChangeLog : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(CALICHANGELOG_IID)

  /**
     * Resets the changelog. This is used if the cache should be refreshed.
     */
  /* void resetLog (); */
  NS_IMETHOD ResetLog(void) = 0;

  /**
     * Instructs the calendar to replay remote changes into the given
     * calendar. The calendar itself is responsible for storing anything needed
     * to keep track of what items need updating.
     *
     * TODO: We might reconsider to replay on calICalendar,
     *       but this complicates implementing this interface
     *       enormously for providers.
     *
     * @param aDestination      The calendar to sync changes into
     * @param aListener         The listener to notify when the operation completes.
     */
  /* calIOperation replayChangesOn (in calISyncCalendar aDestination, in calIGenericOperationListener aListener); */
  NS_IMETHOD ReplayChangesOn(calISyncCalendar *aDestination, calIGenericOperationListener *aListener, calIOperation **_retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALICHANGELOG \
  NS_IMETHOD ResetLog(void); \
  NS_IMETHOD ReplayChangesOn(calISyncCalendar *aDestination, calIGenericOperationListener *aListener, calIOperation **_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALICHANGELOG(_to) \
  NS_IMETHOD ResetLog(void) { return _to ResetLog(); } \
  NS_IMETHOD ReplayChangesOn(calISyncCalendar *aDestination, calIGenericOperationListener *aListener, calIOperation **_retval) { return _to ReplayChangesOn(aDestination, aListener, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_CALICHANGELOG(_to) \
  NS_IMETHOD ResetLog(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetLog(); } \
  NS_IMETHOD ReplayChangesOn(calISyncCalendar *aDestination, calIGenericOperationListener *aListener, calIOperation **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReplayChangesOn(aDestination, aListener, _retval); } 

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

/* Header file */
class _MYCLASS_ : public calIChangeLog
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALICHANGELOG

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* void resetLog (); */
NS_IMETHODIMP _MYCLASS_::ResetLog()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* calIOperation replayChangesOn (in calISyncCalendar aDestination, in calIGenericOperationListener aListener); */
NS_IMETHODIMP _MYCLASS_::ReplayChangesOn(calISyncCalendar *aDestination, calIGenericOperationListener *aListener, calIOperation **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_calIChangeLog_h__ */
