icalspanlist_cxx.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * @file icalspanlist_cxx.h
  3. * @author Critical Path
  4. * @brief C++ class wrapping the icalspanlist data structure
  5. *
  6. (C) COPYRIGHT 2001, Critical Path
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of either:
  9. The LGPL as published by the Free Software Foundation, version
  10. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  11. Or:
  12. The Mozilla Public License Version 1.0. You may obtain a copy of
  13. the License at http://www.mozilla.org/MPL/
  14. */
  15. #ifndef ICALSPANLIST_CXX_H
  16. #define ICALSPANLIST_CXX_H
  17. #include "libical_icalss_export.h"
  18. extern "C"
  19. {
  20. #include "icalcomponent.h"
  21. #include "icalspanlist.h"
  22. #include "icaltime.h"
  23. }
  24. #include <vector>
  25. namespace LibICal
  26. {
  27. class VComponent;
  28. /**
  29. * This class wraps the icalspanlist routines in libicalss
  30. *
  31. * Errors within libicalss are propagated via exceptions of type
  32. * icalerrorenum. See icalerror.h for the complete list of exceptions
  33. * that might be thrown.
  34. */
  35. class LIBICAL_ICALSS_EXPORT ICalSpanList
  36. {
  37. public:
  38. ICalSpanList() throw(icalerrorenum);
  39. ICalSpanList(const ICalSpanList &v) throw(icalerrorenum);
  40. /** Construct an ICalSpanList from an icalset */
  41. ICalSpanList(icalset *set, icaltimetype start, icaltimetype end) throw(icalerrorenum);
  42. /** Construct an ICalSpanList from the VFREEBUSY chunk of a icalcomponent */
  43. explicit ICalSpanList(icalcomponent *comp) throw(icalerrorenum);
  44. /** Construct an ICalSpanList from the VFREEBUSY chunk of a vcomponent */
  45. explicit ICalSpanList(VComponent &comp) throw(icalerrorenum);
  46. /** Destructor */
  47. ~ICalSpanList();
  48. /** Return a VFREEBUSY icalcomponent */
  49. VComponent *get_vfreebusy(const char *organizer, const char *attendee) throw(icalerrorenum);
  50. ICalSpanList &operator=(const ICalSpanList &) throw(icalerrorenum);
  51. /** Return the base data when casting */
  52. operator icalspanlist *()
  53. {
  54. return data;
  55. }
  56. /** Return a vector of the number of events over delta t */
  57. std::vector < int >as_vector(int delta_t) throw(icalerrorenum);
  58. /** Dump the spanlist to stdout */
  59. void dump();
  60. private:
  61. icalspanlist *data;
  62. };
  63. } // namespace LibICal;
  64. #endif