ECExportAddressbookChanges.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 ECEXPORTADDRESSBOOKCHANGES_H
  18. #define ECEXPORTADDRESSBOOKCHANGES_H
  19. #include <kopano/zcdefs.h>
  20. #include <set>
  21. #include "ECABContainer.h"
  22. namespace KC {
  23. class IECImportAddressbookChanges;
  24. class ECLogger;
  25. }
  26. class ECExportAddressbookChanges _kc_final : public ECUnknown {
  27. public:
  28. ECExportAddressbookChanges(ECMsgStore *lpContainer);
  29. virtual ~ECExportAddressbookChanges();
  30. virtual HRESULT QueryInterface(REFIID refiid, void **lppInterface) _kc_override;
  31. // IECExportAddressbookChanges
  32. virtual HRESULT Config(LPSTREAM lpState, ULONG ulFlags, IECImportAddressbookChanges *lpCollector);
  33. virtual HRESULT Synchronize(ULONG *lpulSteps, ULONG *lpulProgress);
  34. virtual HRESULT UpdateState(LPSTREAM lpState);
  35. private:
  36. static bool LeftPrecedesRight(const ICSCHANGE &left, const ICSCHANGE &right);
  37. class xECExportAddressbookChanges _kc_final :
  38. public IECExportAddressbookChanges {
  39. #include <kopano/xclsfrag/IUnknown.hpp>
  40. // <kopano/xclsfrag/IECExportAddressbookChanges.hpp>
  41. virtual HRESULT __stdcall Config(LPSTREAM lpState, ULONG flags, IECImportAddressbookChanges *lpCollector) _kc_override;
  42. virtual HRESULT __stdcall Synchronize(ULONG *lpulSteps, ULONG *lpulProgress) _kc_override;
  43. virtual HRESULT __stdcall UpdateState(LPSTREAM lpState) _kc_override;
  44. } m_xECExportAddressbookChanges;
  45. IECImportAddressbookChanges *m_lpImporter = nullptr;
  46. unsigned int m_ulChangeId = 0;
  47. ECMsgStore *m_lpMsgStore = nullptr;
  48. unsigned int m_ulThisChange = 0;
  49. ULONG m_ulChanges = 0;
  50. ULONG m_ulMaxChangeId =0;
  51. ICSCHANGE *m_lpRawChanges = nullptr; // Raw data from server
  52. ICSCHANGE *m_lpChanges = nullptr; // Same data, but sorted (users, then groups)
  53. std::set<ULONG> m_setProcessed;
  54. ECLogger *m_lpLogger = nullptr;
  55. };
  56. #endif