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

#ifndef __gen_calIWcapSession_h__
#define __gen_calIWcapSession_h__


#ifndef __gen_calIWcapCalendar_h__
#include "calIWcapCalendar.h"
#endif

#ifndef __gen_calIWcapFreeBusyListener_h__
#include "calIWcapFreeBusyListener.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:    calIWcapSession */
#define CALIWCAPSESSION_IID_STR "477b4534-c297-40a1-adf2-5a7e2a81816a"

#define CALIWCAPSESSION_IID \
  {0x477b4534, 0xc297, 0x40a1, \
    { 0xad, 0xf2, 0x5a, 0x7e, 0x2a, 0x81, 0x81, 0x6a }}

class NS_NO_VTABLE calIWcapSession : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(CALIWCAPSESSION_IID)

  /**
 * WCAP session.
 */
/**
     * Setting this URI causes the session to be disconnected.
     */
  /* attribute nsIURI uri; */
  NS_IMETHOD GetUri(nsIURI * *aUri) = 0;
  NS_IMETHOD SetUri(nsIURI * aUri) = 0;

  /**
     * User that has established this session.
     * Reading this attribute prompts for login if the session has not yet
     * been established.
     * An error is notified to all registered calIObservers, then thrown.
     */
  /* readonly attribute string userId; */
  NS_IMETHOD GetUserId(char * *aUserId) = 0;

  /**
     * Determines whether the user is currentl logged in.
     * Does _not_ check whether the user's ticket has timed out!
     */
  /* readonly attribute boolean isLoggedIn; */
  NS_IMETHOD GetIsLoggedIn(PRBool *aIsLoggedIn) = 0;

  /**
     * Explicitly performs a session establishment.
     * Commonly not needed, because any attempt to get a calendar instance
     * will establish a session automatically.
     * If the user is already logged in, she will be logged out before.
     * UI will prompt for a userId and password.
     * An error is notified to all registered calIObservers, then thrown.
     */
  /* void login (); */
  NS_IMETHOD Login(void) = 0;

  /**
     * Explicitly performs a session logout.
     * Commonly not needed, because the user will be logged out upon
     * "network:offline-about-to-go-offline" and "quit-application"
     * automatically.
     * An error is notified to all registered calIObservers, then thrown.
     */
  /* void logout (); */
  NS_IMETHOD Logout(void) = 0;

  /**
     * Gets a text for an error code.
     *
     * @param rc error code defined in calIWcapErrors
     * @return error string
     * @exception NS_ERROR_INVALID_ARG
     */
  /* string getWcapErrorString (in unsigned long rc); */
  NS_IMETHOD GetWcapErrorString(PRUint32 rc, char **_retval) = 0;

  /**
     * The user's default calendar.
     * An error is notified to all registered calIObservers, then thrown.
     */
  /* readonly attribute calIWcapCalendar defaultCalendar; */
  NS_IMETHOD GetDefaultCalendar(calIWcapCalendar * *aDefaultCalendar) = 0;

  /**
     * Gets a calendar instance for the passed calId using this session.
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @param calId full calId (incl. "<user>:")
     * @return calendar instance
     */
  /* calIWcapCalendar getCalendarByCalId (in string calId); */
  NS_IMETHOD GetCalendarByCalId(const char *calId, calIWcapCalendar **_retval) = 0;

  /**
     * Gets calendars where the user is the primary owner
     * (including default calendar).
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @return array of owned calendars
     */
  /* void getOwnedCalendars (out unsigned long count, [array, size_is (count), retval] out calIWcapCalendar ownedCals); */
  NS_IMETHOD GetOwnedCalendars(PRUint32 *count, calIWcapCalendar ***ownedCals) = 0;

  /**
     * Gets subscribed calendars (may include calendars where the user
     * is the primary owner).
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @return array of subscribed calendars
     */
  /* void getSubscribedCalendars (out unsigned long count, [array, size_is (count), retval] out calIWcapCalendar subscribedCals); */
  NS_IMETHOD GetSubscribedCalendars(PRUint32 *count, calIWcapCalendar ***subscribedCals) = 0;

  /**
     * Creates a new calendar for the session's user.
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @param calId calendar's calId (portion);
     *        without user's id, e.g. "test-cal".
     *        valid characters for the calId parameter are:
     *        - Alphabet characters (A-Z, a-z)
     *        - Numeric characters (0-9)
     *        - Three special characters
     *        - Dash (-)
     *        - Underscore (_)
     *        - Period (.)
     * @param name calendar's name, e.g. "My Work Cal"
     * @param bAllowDoubleBooking whether double booking (events/todos) is
     *                            allowed
     * @param bSetCalProps whether properties of the new calendar are set
     * @param bAddToSubscribed allows a user to specify if the newly
     *                         created calendar should be added to the
     *                         user’s subscribed calendar list
     * @return created calendar
     */
  /* calIWcapCalendar createCalendar (in string calId, in string name, in boolean bAllowDoubleBooking, in boolean bSetCalProps, in boolean bAddToSubscribed); */
  NS_IMETHOD CreateCalendar(const char *calId, const char *name, PRBool bAllowDoubleBooking, PRBool bSetCalProps, PRBool bAddToSubscribed, calIWcapCalendar **_retval) = 0;

  /**
     * Deletes a calendar.
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @param calId full calId (incl. "<user>:")
     * @param bRemoveFromSubscribed whether calendar ought to be removed
     *                              from subscription list
     */
  /* void deleteCalendar (in string calId, in boolean bRemoveFromSubscribed); */
  NS_IMETHOD DeleteCalendar(const char *calId, PRBool bRemoveFromSubscribed) = 0;

  /**
     * Subscribe to calendar(s).
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @param count number of calIds
     * @param calIds array of calIds (calid or "mailto:rfc822addr")
     */
  /* void subscribeToCalendars (in unsigned long count, [array, size_is (count)] in string calIds); */
  NS_IMETHOD SubscribeToCalendars(PRUint32 count, const char **calIds) = 0;

  /**
     * Unsubscribe from calendar(s).
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @param count number of calIds
     * @param calIds array of calIds (calid or "mailto:rfc822addr")
     */
  /* void unsubscribeFromCalendars (in unsigned long count, [array, size_is (count)] in string calIds); */
  NS_IMETHOD UnsubscribeFromCalendars(PRUint32 count, const char **calIds) = 0;

  /**
     * Gets the user's preferences.
     * An error is notified to all registered calIObservers, then thrown.
     *
     * @param prefName preference name
     * @return array of preference values
     */
  /* void getUserPreferences (in string prefName, out unsigned long count, [array, size_is (count), retval] out string properties); */
  NS_IMETHOD GetUserPreferences(const char *prefName, PRUint32 *count, char ***properties) = 0;

  /**
     * Gets free-busy entries for calid.
     * Results are notifies to passed listener instance.
     * An error is notified to all registered calIObservers and
     * to calIWcapFreeBusyListener::onGetFreeBusyTimes with rc != NS_OK.
     * Additionally, when an error occurs within getFreeBusyTimes,
     * the error is also thrown.
     *
     * @param calId a calid or "mailto:rfc822addr"
     * @param dtRangeStart start time of free-busy search
     * @param dtRangeEnd end time of free-busy search
     * @param bBusyOnly whether to return busy entries only
     * @param listener listener receiving results
     * @param bAsync whether the listener receives results asynchronously
     * @param requestId request id to distinguish asynchronous requests
     */
  /* void getFreeBusyTimes (in string calId, in calIDateTime dtRangeStart, in calIDateTime dtRangeEnd, in boolean bBusyOnly, in calIWcapFreeBusyListener listener, in boolean bAsync, in unsigned long requestId); */
  NS_IMETHOD GetFreeBusyTimes(const char *calId, calIDateTime *dtRangeStart, calIDateTime *dtRangeEnd, PRBool bBusyOnly, calIWcapFreeBusyListener *listener, PRBool bAsync, PRUint32 requestId) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(calIWcapSession, CALIWCAPSESSION_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALIWCAPSESSION \
  NS_IMETHOD GetUri(nsIURI * *aUri); \
  NS_IMETHOD SetUri(nsIURI * aUri); \
  NS_IMETHOD GetUserId(char * *aUserId); \
  NS_IMETHOD GetIsLoggedIn(PRBool *aIsLoggedIn); \
  NS_IMETHOD Login(void); \
  NS_IMETHOD Logout(void); \
  NS_IMETHOD GetWcapErrorString(PRUint32 rc, char **_retval); \
  NS_IMETHOD GetDefaultCalendar(calIWcapCalendar * *aDefaultCalendar); \
  NS_IMETHOD GetCalendarByCalId(const char *calId, calIWcapCalendar **_retval); \
  NS_IMETHOD GetOwnedCalendars(PRUint32 *count, calIWcapCalendar ***ownedCals); \
  NS_IMETHOD GetSubscribedCalendars(PRUint32 *count, calIWcapCalendar ***subscribedCals); \
  NS_IMETHOD CreateCalendar(const char *calId, const char *name, PRBool bAllowDoubleBooking, PRBool bSetCalProps, PRBool bAddToSubscribed, calIWcapCalendar **_retval); \
  NS_IMETHOD DeleteCalendar(const char *calId, PRBool bRemoveFromSubscribed); \
  NS_IMETHOD SubscribeToCalendars(PRUint32 count, const char **calIds); \
  NS_IMETHOD UnsubscribeFromCalendars(PRUint32 count, const char **calIds); \
  NS_IMETHOD GetUserPreferences(const char *prefName, PRUint32 *count, char ***properties); \
  NS_IMETHOD GetFreeBusyTimes(const char *calId, calIDateTime *dtRangeStart, calIDateTime *dtRangeEnd, PRBool bBusyOnly, calIWcapFreeBusyListener *listener, PRBool bAsync, PRUint32 requestId); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALIWCAPSESSION(_to) \
  NS_IMETHOD GetUri(nsIURI * *aUri) { return _to GetUri(aUri); } \
  NS_IMETHOD SetUri(nsIURI * aUri) { return _to SetUri(aUri); } \
  NS_IMETHOD GetUserId(char * *aUserId) { return _to GetUserId(aUserId); } \
  NS_IMETHOD GetIsLoggedIn(PRBool *aIsLoggedIn) { return _to GetIsLoggedIn(aIsLoggedIn); } \
  NS_IMETHOD Login(void) { return _to Login(); } \
  NS_IMETHOD Logout(void) { return _to Logout(); } \
  NS_IMETHOD GetWcapErrorString(PRUint32 rc, char **_retval) { return _to GetWcapErrorString(rc, _retval); } \
  NS_IMETHOD GetDefaultCalendar(calIWcapCalendar * *aDefaultCalendar) { return _to GetDefaultCalendar(aDefaultCalendar); } \
  NS_IMETHOD GetCalendarByCalId(const char *calId, calIWcapCalendar **_retval) { return _to GetCalendarByCalId(calId, _retval); } \
  NS_IMETHOD GetOwnedCalendars(PRUint32 *count, calIWcapCalendar ***ownedCals) { return _to GetOwnedCalendars(count, ownedCals); } \
  NS_IMETHOD GetSubscribedCalendars(PRUint32 *count, calIWcapCalendar ***subscribedCals) { return _to GetSubscribedCalendars(count, subscribedCals); } \
  NS_IMETHOD CreateCalendar(const char *calId, const char *name, PRBool bAllowDoubleBooking, PRBool bSetCalProps, PRBool bAddToSubscribed, calIWcapCalendar **_retval) { return _to CreateCalendar(calId, name, bAllowDoubleBooking, bSetCalProps, bAddToSubscribed, _retval); } \
  NS_IMETHOD DeleteCalendar(const char *calId, PRBool bRemoveFromSubscribed) { return _to DeleteCalendar(calId, bRemoveFromSubscribed); } \
  NS_IMETHOD SubscribeToCalendars(PRUint32 count, const char **calIds) { return _to SubscribeToCalendars(count, calIds); } \
  NS_IMETHOD UnsubscribeFromCalendars(PRUint32 count, const char **calIds) { return _to UnsubscribeFromCalendars(count, calIds); } \
  NS_IMETHOD GetUserPreferences(const char *prefName, PRUint32 *count, char ***properties) { return _to GetUserPreferences(prefName, count, properties); } \
  NS_IMETHOD GetFreeBusyTimes(const char *calId, calIDateTime *dtRangeStart, calIDateTime *dtRangeEnd, PRBool bBusyOnly, calIWcapFreeBusyListener *listener, PRBool bAsync, PRUint32 requestId) { return _to GetFreeBusyTimes(calId, dtRangeStart, dtRangeEnd, bBusyOnly, listener, bAsync, requestId); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_CALIWCAPSESSION(_to) \
  NS_IMETHOD GetUri(nsIURI * *aUri) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUri(aUri); } \
  NS_IMETHOD SetUri(nsIURI * aUri) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUri(aUri); } \
  NS_IMETHOD GetUserId(char * *aUserId) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserId(aUserId); } \
  NS_IMETHOD GetIsLoggedIn(PRBool *aIsLoggedIn) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsLoggedIn(aIsLoggedIn); } \
  NS_IMETHOD Login(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Login(); } \
  NS_IMETHOD Logout(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Logout(); } \
  NS_IMETHOD GetWcapErrorString(PRUint32 rc, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWcapErrorString(rc, _retval); } \
  NS_IMETHOD GetDefaultCalendar(calIWcapCalendar * *aDefaultCalendar) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultCalendar(aDefaultCalendar); } \
  NS_IMETHOD GetCalendarByCalId(const char *calId, calIWcapCalendar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCalendarByCalId(calId, _retval); } \
  NS_IMETHOD GetOwnedCalendars(PRUint32 *count, calIWcapCalendar ***ownedCals) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnedCalendars(count, ownedCals); } \
  NS_IMETHOD GetSubscribedCalendars(PRUint32 *count, calIWcapCalendar ***subscribedCals) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubscribedCalendars(count, subscribedCals); } \
  NS_IMETHOD CreateCalendar(const char *calId, const char *name, PRBool bAllowDoubleBooking, PRBool bSetCalProps, PRBool bAddToSubscribed, calIWcapCalendar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateCalendar(calId, name, bAllowDoubleBooking, bSetCalProps, bAddToSubscribed, _retval); } \
  NS_IMETHOD DeleteCalendar(const char *calId, PRBool bRemoveFromSubscribed) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteCalendar(calId, bRemoveFromSubscribed); } \
  NS_IMETHOD SubscribeToCalendars(PRUint32 count, const char **calIds) { return !_to ? NS_ERROR_NULL_POINTER : _to->SubscribeToCalendars(count, calIds); } \
  NS_IMETHOD UnsubscribeFromCalendars(PRUint32 count, const char **calIds) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnsubscribeFromCalendars(count, calIds); } \
  NS_IMETHOD GetUserPreferences(const char *prefName, PRUint32 *count, char ***properties) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserPreferences(prefName, count, properties); } \
  NS_IMETHOD GetFreeBusyTimes(const char *calId, calIDateTime *dtRangeStart, calIDateTime *dtRangeEnd, PRBool bBusyOnly, calIWcapFreeBusyListener *listener, PRBool bAsync, PRUint32 requestId) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFreeBusyTimes(calId, dtRangeStart, dtRangeEnd, bBusyOnly, listener, bAsync, requestId); } 

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

/* Header file */
class _MYCLASS_ : public calIWcapSession
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALIWCAPSESSION

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* attribute nsIURI uri; */
NS_IMETHODIMP _MYCLASS_::GetUri(nsIURI * *aUri)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP _MYCLASS_::SetUri(nsIURI * aUri)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute string userId; */
NS_IMETHODIMP _MYCLASS_::GetUserId(char * *aUserId)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean isLoggedIn; */
NS_IMETHODIMP _MYCLASS_::GetIsLoggedIn(PRBool *aIsLoggedIn)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void login (); */
NS_IMETHODIMP _MYCLASS_::Login()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void logout (); */
NS_IMETHODIMP _MYCLASS_::Logout()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* string getWcapErrorString (in unsigned long rc); */
NS_IMETHODIMP _MYCLASS_::GetWcapErrorString(PRUint32 rc, char **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute calIWcapCalendar defaultCalendar; */
NS_IMETHODIMP _MYCLASS_::GetDefaultCalendar(calIWcapCalendar * *aDefaultCalendar)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* calIWcapCalendar getCalendarByCalId (in string calId); */
NS_IMETHODIMP _MYCLASS_::GetCalendarByCalId(const char *calId, calIWcapCalendar **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getOwnedCalendars (out unsigned long count, [array, size_is (count), retval] out calIWcapCalendar ownedCals); */
NS_IMETHODIMP _MYCLASS_::GetOwnedCalendars(PRUint32 *count, calIWcapCalendar ***ownedCals)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getSubscribedCalendars (out unsigned long count, [array, size_is (count), retval] out calIWcapCalendar subscribedCals); */
NS_IMETHODIMP _MYCLASS_::GetSubscribedCalendars(PRUint32 *count, calIWcapCalendar ***subscribedCals)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* calIWcapCalendar createCalendar (in string calId, in string name, in boolean bAllowDoubleBooking, in boolean bSetCalProps, in boolean bAddToSubscribed); */
NS_IMETHODIMP _MYCLASS_::CreateCalendar(const char *calId, const char *name, PRBool bAllowDoubleBooking, PRBool bSetCalProps, PRBool bAddToSubscribed, calIWcapCalendar **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void deleteCalendar (in string calId, in boolean bRemoveFromSubscribed); */
NS_IMETHODIMP _MYCLASS_::DeleteCalendar(const char *calId, PRBool bRemoveFromSubscribed)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void subscribeToCalendars (in unsigned long count, [array, size_is (count)] in string calIds); */
NS_IMETHODIMP _MYCLASS_::SubscribeToCalendars(PRUint32 count, const char **calIds)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void unsubscribeFromCalendars (in unsigned long count, [array, size_is (count)] in string calIds); */
NS_IMETHODIMP _MYCLASS_::UnsubscribeFromCalendars(PRUint32 count, const char **calIds)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getUserPreferences (in string prefName, out unsigned long count, [array, size_is (count), retval] out string properties); */
NS_IMETHODIMP _MYCLASS_::GetUserPreferences(const char *prefName, PRUint32 *count, char ***properties)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getFreeBusyTimes (in string calId, in calIDateTime dtRangeStart, in calIDateTime dtRangeEnd, in boolean bBusyOnly, in calIWcapFreeBusyListener listener, in boolean bAsync, in unsigned long requestId); */
NS_IMETHODIMP _MYCLASS_::GetFreeBusyTimes(const char *calId, calIDateTime *dtRangeStart, calIDateTime *dtRangeEnd, PRBool bBusyOnly, calIWcapFreeBusyListener *listener, PRBool bAsync, PRUint32 requestId)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_calIWcapSession_h__ */
