ics_client.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 KC_ICS_CLIENT_HPP
  18. #define KC_ICS_CLIENT_HPP 1
  19. #include <string>
  20. #include <list>
  21. #include <mapidefs.h> // SBinary
  22. typedef ULONG syncid_t;
  23. typedef ULONG changeid_t;
  24. typedef ULONG connection_t;
  25. // Client-side type definitions for ICS
  26. struct ICSCHANGE {
  27. unsigned int ulChangeId;
  28. SBinary sSourceKey;
  29. SBinary sParentSourceKey;
  30. SBinary sMovedFromSourceKey;
  31. unsigned int ulChangeType;
  32. unsigned int ulFlags;
  33. };
  34. /**
  35. * SSyncState: This structure uniquely defines a sync state.
  36. */
  37. struct SSyncState {
  38. syncid_t ulSyncId; //!< The sync id uniquely specifies a folder in a syncronization context.
  39. changeid_t ulChangeId; //!< The change id specifies the syncronization state for a specific sync id.
  40. };
  41. /**
  42. * SSyncAdvise: This structure combines a sync state with a notification connection.
  43. */
  44. struct SSyncAdvise {
  45. SSyncState sSyncState; //!< The sync state that's for which a change notifications have been registered.
  46. connection_t ulConnection; //!< The connection on which notifications for the folder specified by the sync state are received.
  47. };
  48. /**
  49. * Extract the sync id from binary data that is known to be a valid sync state.
  50. */
  51. #define SYNCID(lpb) (((SSyncState*)(lpb))->ulSyncId)
  52. /**
  53. * Extract the change id from binary data that is known to be a valid sync state.
  54. */
  55. #define CHANGEID(lpb) (((SSyncState*)(lpb))->ulChangeId)
  56. typedef std::list<syncid_t> ECLISTSYNCID;
  57. typedef std::list<SSyncState> ECLISTSYNCSTATE;
  58. typedef std::list<SSyncAdvise> ECLISTSYNCADVISE;
  59. #endif /* KC_ICS_CLIENT_HPP */