pcutil.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_PCUTIL_HPP
  18. #define KC_PCUTIL_HPP 1
  19. // All functions which used in storage server and client
  20. #include "kcore.hpp"
  21. #include <kopano/kcodes.h>
  22. #include "soapH.h"
  23. #include <kopano/ECDefs.h>
  24. #include "SOAPUtils.h"
  25. #include <mapidefs.h>
  26. #include <string>
  27. namespace KC {
  28. bool IsKopanoEntryId(ULONG cb, LPBYTE lpEntryId);
  29. bool ValidateZEntryId(ULONG cb, LPBYTE lpEntryId, unsigned int ulCheckType);
  30. bool ValidateZEntryList(LPENTRYLIST lpMsgList, unsigned int ulCheckType);
  31. ECRESULT ABEntryIDToID(ULONG cb, LPBYTE lpEntryId, unsigned int* lpulID, objectid_t* lpsExternId, unsigned int* lpulMapiType);
  32. ECRESULT SIEntryIDToID(ULONG cb, LPBYTE lpInstanceId, LPGUID guidServer, unsigned int *lpulInstanceId, unsigned int *lpulPropId = NULL);
  33. int SortCompareABEID(ULONG cbEntryID1, LPENTRYID lpEntryID1, ULONG cbEntryID2, LPENTRYID lpEntryID2);
  34. bool CompareABEID(ULONG cbEntryID1, LPENTRYID lpEntryID1, ULONG cbEntryID2, LPENTRYID lpEntryID2);
  35. ECRESULT ParseKopanoVersion(const std::string &strVersion, unsigned int *lpulVersion);
  36. //Clientside functions
  37. HRESULT HrGetStoreGuidFromEntryId(ULONG cb, LPBYTE lpEntryId, LPGUID lpguidStore);
  38. HRESULT HrGetObjTypeFromEntryId(ULONG cb, LPBYTE lpEntryId, unsigned int* lpulObjType);
  39. HRESULT HrSIEntryIDToID(ULONG cb, LPBYTE lpInstanceId, LPGUID guidServer, unsigned int *lpulID, unsigned int *lpulPropId = NULL);
  40. // Serverside functions
  41. ECRESULT GetStoreGuidFromEntryId(ULONG cb, LPBYTE lpEntryId, LPGUID guidStore);
  42. ECRESULT GetObjTypeFromEntryId(ULONG cb, LPBYTE lpEntryId, unsigned int* lpulObjType);
  43. ECRESULT GetStoreGuidFromEntryId(entryId sEntryId, LPGUID guidStore);
  44. ECRESULT GetObjTypeFromEntryId(entryId sEntryId, unsigned int* lpulObjType);
  45. ECRESULT ABEntryIDToID(entryId* lpsEntryId, unsigned int* lpulID, objectid_t* lpsExternId, unsigned int* lpulMapiType);
  46. ECRESULT SIEntryIDToID(entryId* sInstanceId, LPGUID guidServer, unsigned int *lpulInstanceId, unsigned int *lpulPropId = NULL);
  47. ECRESULT ABIDToEntryID(struct soap *soap, unsigned int ulID, const objectid_t& strExternId, entryId *lpsEntryId);
  48. ECRESULT SIIDToEntryID(struct soap *soap, LPGUID guidServer, unsigned int ulInstanceId, unsigned int ulPropId, entryId *lpsInstanceId);
  49. ECRESULT MAPITypeToType(ULONG ulMAPIType, objectclass_t *lpsUserObjClass);
  50. ECRESULT TypeToMAPIType(objectclass_t sUserObjClass, ULONG *lpulMAPIType);
  51. } /* namespace */
  52. #endif /* KC_PCUTIL_HPP */