icalspanlist.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*======================================================================
  2. FILE: icalspanlist.h
  3. CREATOR: eric 21 Aug 2000
  4. (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
  5. http://www.softwarestudio.org
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of either:
  8. The LGPL as published by the Free Software Foundation, version
  9. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  10. Or:
  11. The Mozilla Public License Version 1.0. You may obtain a copy of
  12. the License at http://www.mozilla.org/MPL/
  13. =========================================================================*/
  14. #ifndef ICALSPANLIST_H
  15. #define ICALSPANLIST_H
  16. #include "libical_icalss_export.h"
  17. #include "icalset.h"
  18. /** @file icalspanlist.h
  19. * @brief Code that supports collections of free/busy spans of time
  20. */
  21. typedef struct icalspanlist_impl icalspanlist;
  22. /** @brief Constructor
  23. * Make a free list from a set of component. Start and end should be in UTC
  24. */
  25. LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_new(icalset *set,
  26. struct icaltimetype start,
  27. struct icaltimetype end);
  28. /** @brief Destructor
  29. */
  30. LIBICAL_ICALSS_EXPORT void icalspanlist_free(icalspanlist *spl);
  31. /* Unimplemented functions */
  32. LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_make_free_list(icalspanlist *sl);
  33. LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_make_busy_list(icalspanlist *sl);
  34. /** Get first next free time after time t. all times are in UTC. */
  35. LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_free_time(icalspanlist *sl,
  36. struct icaltimetype t);
  37. /** Get first next busy time after time t. all times are in UTC. */
  38. LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_busy_time(icalspanlist *sl,
  39. struct icaltimetype t);
  40. LIBICAL_ICALSS_EXPORT void icalspanlist_dump(icalspanlist *s);
  41. /** @brief Return a valid VFREEBUSY component for this span */
  42. LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_as_vfreebusy(icalspanlist *s_in,
  43. const char *organizer,
  44. const char *attendee);
  45. /** @brief Return an integer matrix of total events per delta_t timespan */
  46. LIBICAL_ICALSS_EXPORT int *icalspanlist_as_freebusy_matrix(icalspanlist *span, int delta_t);
  47. /** @brief Construct an icalspanlist from a VFREEBUSY component */
  48. LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_from_vfreebusy(icalcomponent *c);
  49. #endif