CalDavProto.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 _CALDAVPROTO_H_
  18. #define _CALDAVPROTO_H_
  19. #include "WebDav.h"
  20. #include "CalDavUtil.h"
  21. #include <libxml/uri.h>
  22. #include <kopano/zcdefs.h>
  23. #include <kopano/mapiext.h>
  24. #include "MAPIToICal.h"
  25. #include "ICalToMAPI.h"
  26. #include "icaluid.h"
  27. #define FB_PUBLISH_DURATION 6
  28. class CalDAV _kc_final : public WebDav {
  29. public:
  30. CalDAV(Http *, IMAPISession *, const std::string &srv_tz, const std::string &charset);
  31. HRESULT HrHandleCommand(const std::string &strMethod) _kc_override;
  32. protected:
  33. /* entry points in webdav class */
  34. /* HRESULT HrPropfind(); */
  35. /* HRESULT HrReport(); */
  36. /* HRESULT HrMkCalendar(); */
  37. /* HRESULT HrPropPatch(); */
  38. HRESULT HrPut();
  39. HRESULT HrMove();
  40. HRESULT HrHandleMeeting(ICalToMapi *lpIcalToMapi);
  41. HRESULT HrHandleFreebusy(ICalToMapi *lpIcalToMapi);
  42. virtual HRESULT HrHandlePropfind(WEBDAVREQSTPROPS *sDavProp, WEBDAVMULTISTATUS *lpsDavMulStatus) _kc_override;
  43. virtual HRESULT HrListCalEntries(WEBDAVREQSTPROPS *sWebRCalQry,WEBDAVMULTISTATUS *sWebMStatus) _kc_override; // Used By both PROPFIND & Report Calendar-query
  44. virtual HRESULT HrHandleReport(WEBDAVRPTMGET *sWebRMGet, WEBDAVMULTISTATUS *sWebMStatus) _kc_override;
  45. virtual HRESULT HrHandlePropPatch(WEBDAVPROP *lpsDavProp, WEBDAVMULTISTATUS *sWebMStatus) _kc_override;
  46. virtual HRESULT HrHandleMkCal(WEBDAVPROP *lpsDavProp) _kc_override;
  47. virtual HRESULT HrHandlePropertySearch(WEBDAVRPTMGET *sWebRMGet, WEBDAVMULTISTATUS *sWebMStatus) _kc_override;
  48. virtual HRESULT HrHandlePropertySearchSet(WEBDAVMULTISTATUS *sWebMStatus) _kc_override;
  49. virtual HRESULT HrHandleDelete(void) _kc_override;
  50. HRESULT HrHandlePost();
  51. private:
  52. HRESULT HrMoveEntry(const std::string &strGuid, LPMAPIFOLDER lpDestFolder);
  53. HRESULT HrHandlePropfindRoot(WEBDAVREQSTPROPS *sDavProp, WEBDAVMULTISTATUS *lpsDavMulStatus);
  54. HRESULT CreateAndGetGuid(SBinary sbEid, ULONG ulPropTag, std::string *lpstrGuid);
  55. HRESULT HrListCalendar(WEBDAVREQSTPROPS *sDavProp, WEBDAVMULTISTATUS *lpsMulStatus);
  56. HRESULT HrConvertToIcal(const SPropValue *lpEid, MapiToICal *lpMtToIcal, ULONG ulFlags, std::string *strIcal);
  57. HRESULT HrMapValtoStruct(LPMAPIPROP lpObj, LPSPropValue lpProps, ULONG ulPropCount, MapiToICal *lpMtIcal, ULONG ulFlags, bool bPropsFirst, std::list<WEBDAVPROPERTY> *lstDavProps, WEBDAVRESPONSE *lpsResponse);
  58. HRESULT HrGetCalendarOrder(SBinary sbEid, std::string *lpstrCalendarOrder);
  59. };
  60. #endif