vtimezone.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef TIMEZONE_TYPE_H
  18. #define TIMEZONE_TYPE_H
  19. #include "recurrence.h"
  20. #include <mapidefs.h>
  21. #include <string>
  22. #include <map>
  23. #include "TimeUtil.h"
  24. #include <libical/ical.h>
  25. namespace KC {
  26. typedef std::map<std::string, TIMEZONE_STRUCT> timezone_map;
  27. typedef std::map<std::string, TIMEZONE_STRUCT>::iterator timezone_map_iterator;
  28. /* converts ical property like DTSTART to Unix timestamp in UTC */
  29. time_t ICalTimeTypeToUTC(icalcomponent *lpicRoot, icalproperty *lpicProp);
  30. /* Function to convert time to local - used for All day events*/
  31. time_t ICalTimeTypeToLocal(icalproperty *lpicProp);
  32. /* converts icaltimetype to local time_t */
  33. time_t icaltime_as_timet_with_server_zone(const struct icaltimetype tt);
  34. HRESULT HrParseVTimeZone(icalcomponent* lpVTZ, std::string* strTZID, TIMEZONE_STRUCT* lpTimeZone);
  35. HRESULT HrCreateVTimeZone(const std::string &strTZID, TIMEZONE_STRUCT &tsTimeZone, icalcomponent** lppVTZComp);
  36. /* convert Olson timezone name (eg. Europe/Amsterdam) to internal TIMEZONE_STRUCT */
  37. HRESULT HrGetTzStruct(const std::string &strTimezone, TIMEZONE_STRUCT *tStruct);
  38. } /* namespace */
  39. #endif