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

#ifndef __gen_calIIcsParser_h__
#define __gen_calIIcsParser_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 calIIcalProperty; /* forward declaration */

class calIIcalComponent; /* forward declaration */

class calIItemBase; /* forward declaration */

class nsIInputStream; /* forward declaration */

class calITimezoneProvider; /* forward declaration */


/* starting interface:    calIIcsParser */
#define CALIICSPARSER_IID_STR "83e9befe-5e9e-49de-8bc2-d882f464f7e7"

#define CALIICSPARSER_IID \
  {0x83e9befe, 0x5e9e, 0x49de, \
    { 0x8b, 0xc2, 0xd8, 0x82, 0xf4, 0x64, 0xf7, 0xe7 }}

/**
 * An interface for parsing an ics string or stream into its items.
 * Note that this is not a service. A new instance must be created for every new
 * string or stream to be parsed.
 */
class NS_NO_VTABLE calIIcsParser : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(CALIICSPARSER_IID)

  /**
   * Parse an ics string into its items, and store top-level properties and
   * components that are not interpreted.
   *
   * @param aICSString
   *    The ICS string to parse
   * @param aTzProvider
   *    The timezone provider used to resolve timezones not contained in the
   *    parent VCALENDAR or null (falls back to timezone service)
   */
  /* void parseString (in AString aICSString, in calITimezoneProvider aTzProvider); */
  NS_IMETHOD ParseString(const nsAString & aICSString, calITimezoneProvider *aTzProvider) = 0;

  /**
   * Parse an input stream.
   *
   * @see parseString
   * @param aICSString
   *    The stream to parse
   * @param aTzProvider
   *    The timezone provider used to resolve timezones not contained in the
   *    parent VCALENDAR or null (falls back to timezone service)
   */
  /* void parseFromStream (in nsIInputStream aStream, in calITimezoneProvider aTzProvider); */
  NS_IMETHOD ParseFromStream(nsIInputStream *aStream, calITimezoneProvider *aTzProvider) = 0;

  /**
   * Get the items that were in the string or stream. In case an item represents a
   * recurring series, the (unexpanded) parent item is returned only.
   * Please keep in mind that any parentless items (see below) are not contained
   * in the returned set of items.
   *
   * @param aCount
   *    Will hold the number of items that were parsed
   * @param aItems
   *    The items
   */
  /* void getItems (out PRUint32 aCount, [array, size_is (aCount), retval] out calIItemBase aItems); */
  NS_IMETHOD GetItems(PRUint32 *aCount, calIItemBase ***aItems) = 0;

  /**
   * Get the parentless items that may have occurred, i.e. overridden items of a
   * recurring series (having a RECURRENCE-ID) missing their parent item in the
   * parsed content.
   *
   * @param aCount
   *    Will hold the number of items that were parsed
   * @param aItems
   *    The items
   */
  /* void getParentlessItems (out PRUint32 aCount, [array, size_is (aCount), retval] out calIItemBase aItems); */
  NS_IMETHOD GetParentlessItems(PRUint32 *aCount, calIItemBase ***aItems) = 0;

  /**
   * Get the top-level properties that were not interpreted as anything special
   * @param aCount
   *    Will hold the number of properties that were found
   * @param aProperties
   *    The properties
   */
  /* void getProperties (out PRUint32 aCount, [array, size_is (aCount), retval] out calIIcalProperty aProperties); */
  NS_IMETHOD GetProperties(PRUint32 *aCount, calIIcalProperty ***aProperties) = 0;

  /**
   * Get the top-level components that were not interpreted as anything special
   * @param aCount
   *    Will hold the number of components that were found
   * @param aComponents
   *    The components
   */
  /* void getComponents (out PRUint32 aCount, [array, size_is (aCount), retval] out calIIcalComponent aComponents); */
  NS_IMETHOD GetComponents(PRUint32 *aCount, calIIcalComponent ***aComponents) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_CALIICSPARSER \
  NS_IMETHOD ParseString(const nsAString & aICSString, calITimezoneProvider *aTzProvider); \
  NS_IMETHOD ParseFromStream(nsIInputStream *aStream, calITimezoneProvider *aTzProvider); \
  NS_IMETHOD GetItems(PRUint32 *aCount, calIItemBase ***aItems); \
  NS_IMETHOD GetParentlessItems(PRUint32 *aCount, calIItemBase ***aItems); \
  NS_IMETHOD GetProperties(PRUint32 *aCount, calIIcalProperty ***aProperties); \
  NS_IMETHOD GetComponents(PRUint32 *aCount, calIIcalComponent ***aComponents); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_CALIICSPARSER(_to) \
  NS_IMETHOD ParseString(const nsAString & aICSString, calITimezoneProvider *aTzProvider) { return _to ParseString(aICSString, aTzProvider); } \
  NS_IMETHOD ParseFromStream(nsIInputStream *aStream, calITimezoneProvider *aTzProvider) { return _to ParseFromStream(aStream, aTzProvider); } \
  NS_IMETHOD GetItems(PRUint32 *aCount, calIItemBase ***aItems) { return _to GetItems(aCount, aItems); } \
  NS_IMETHOD GetParentlessItems(PRUint32 *aCount, calIItemBase ***aItems) { return _to GetParentlessItems(aCount, aItems); } \
  NS_IMETHOD GetProperties(PRUint32 *aCount, calIIcalProperty ***aProperties) { return _to GetProperties(aCount, aProperties); } \
  NS_IMETHOD GetComponents(PRUint32 *aCount, calIIcalComponent ***aComponents) { return _to GetComponents(aCount, aComponents); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_CALIICSPARSER(_to) \
  NS_IMETHOD ParseString(const nsAString & aICSString, calITimezoneProvider *aTzProvider) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseString(aICSString, aTzProvider); } \
  NS_IMETHOD ParseFromStream(nsIInputStream *aStream, calITimezoneProvider *aTzProvider) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFromStream(aStream, aTzProvider); } \
  NS_IMETHOD GetItems(PRUint32 *aCount, calIItemBase ***aItems) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetItems(aCount, aItems); } \
  NS_IMETHOD GetParentlessItems(PRUint32 *aCount, calIItemBase ***aItems) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentlessItems(aCount, aItems); } \
  NS_IMETHOD GetProperties(PRUint32 *aCount, calIIcalProperty ***aProperties) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProperties(aCount, aProperties); } \
  NS_IMETHOD GetComponents(PRUint32 *aCount, calIIcalComponent ***aComponents) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetComponents(aCount, aComponents); } 

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

/* Header file */
class _MYCLASS_ : public calIIcsParser
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_CALIICSPARSER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* void parseString (in AString aICSString, in calITimezoneProvider aTzProvider); */
NS_IMETHODIMP _MYCLASS_::ParseString(const nsAString & aICSString, calITimezoneProvider *aTzProvider)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void parseFromStream (in nsIInputStream aStream, in calITimezoneProvider aTzProvider); */
NS_IMETHODIMP _MYCLASS_::ParseFromStream(nsIInputStream *aStream, calITimezoneProvider *aTzProvider)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getItems (out PRUint32 aCount, [array, size_is (aCount), retval] out calIItemBase aItems); */
NS_IMETHODIMP _MYCLASS_::GetItems(PRUint32 *aCount, calIItemBase ***aItems)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getParentlessItems (out PRUint32 aCount, [array, size_is (aCount), retval] out calIItemBase aItems); */
NS_IMETHODIMP _MYCLASS_::GetParentlessItems(PRUint32 *aCount, calIItemBase ***aItems)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getProperties (out PRUint32 aCount, [array, size_is (aCount), retval] out calIIcalProperty aProperties); */
NS_IMETHODIMP _MYCLASS_::GetProperties(PRUint32 *aCount, calIIcalProperty ***aProperties)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getComponents (out PRUint32 aCount, [array, size_is (aCount), retval] out calIIcalComponent aComponents); */
NS_IMETHODIMP _MYCLASS_::GetComponents(PRUint32 *aCount, calIIcalComponent ***aComponents)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_calIIcsParser_h__ */
