WSTableView.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 WSTABLEVIEW_H
  18. #define WSTABLEVIEW_H
  19. #include <kopano/zcdefs.h>
  20. #include <kopano/ECUnknown.h>
  21. #include <mutex>
  22. #include "kcore.hpp"
  23. #include <kopano/kcodes.h>
  24. #include <mapi.h>
  25. #include <mapispi.h>
  26. #include "soapKCmdProxy.h"
  27. class WSTransport;
  28. typedef HRESULT (*RELOADCALLBACK)(void *lpParam);
  29. class WSTableView : public ECUnknown {
  30. protected:
  31. WSTableView(ULONG ulType, ULONG ulFlags, KCmd *, std::recursive_mutex &, ECSESSIONID, ULONG cbEntryId, LPENTRYID, WSTransport *, const char *szClassName = NULL);
  32. virtual ~WSTableView();
  33. public:
  34. virtual HRESULT QueryInterface(REFIID refiid, void **lppInstanceID) _kc_override;
  35. virtual HRESULT HrOpenTable();
  36. virtual HRESULT HrCloseTable();
  37. // You must call HrOpenTable before calling the following methods
  38. virtual HRESULT HrSetColumns(const SPropTagArray *lpsPropTagArray);
  39. virtual HRESULT HrFindRow(const SRestriction *lpsRestriction, BOOKMARK bkOrigin, ULONG ulFlags);
  40. virtual HRESULT HrQueryColumns(ULONG ulFlags, LPSPropTagArray *lppsPropTags);
  41. virtual HRESULT HrSortTable(const SSortOrderSet *lpsSortOrderSet);
  42. virtual HRESULT HrRestrict(const SRestriction *lpsRestriction);
  43. virtual HRESULT HrQueryRows(ULONG ulRowCount, ULONG ulFlags, LPSRowSet *lppRowSet);
  44. virtual HRESULT HrGetRowCount(ULONG *lpulRowCount, ULONG *lpulCurrentRow);
  45. virtual HRESULT HrSeekRow(BOOKMARK bkOrigin, LONG ulRows, LONG *lplRowsSought);
  46. virtual HRESULT HrExpandRow(ULONG cbInstanceKey, LPBYTE pbInstanceKey, ULONG ulRowCount, ULONG ulFlags, LPSRowSet * lppRows, ULONG *lpulMoreRows);
  47. virtual HRESULT HrCollapseRow(ULONG cbInstanceKey, LPBYTE pbInstanceKey, ULONG ulFlags, ULONG *lpulRowCount);
  48. virtual HRESULT HrGetCollapseState(BYTE **lppCollapseState, ULONG *lpcbCollapseState, BYTE *lpbInstanceKey, ULONG cbInstanceKey);
  49. virtual HRESULT HrSetCollapseState(BYTE *lpCollapseState, ULONG cbCollapseState, BOOKMARK *lpbkPosition);
  50. virtual HRESULT HrMulti(ULONG ulDeferredFlags, LPSPropTagArray lpsPropTagArray, LPSRestriction lpsRestriction, LPSSortOrderSet lpsSortOrderSet, ULONG ulRowCount, ULONG ulFlags, LPSRowSet *lppRowSet);
  51. virtual HRESULT FreeBookmark(BOOKMARK bkPosition);
  52. virtual HRESULT CreateBookmark(BOOKMARK* lpbkPosition);
  53. static HRESULT Reload(void *lpParam, ECSESSIONID sessionID);
  54. virtual HRESULT SetReloadCallback(RELOADCALLBACK callback, void *lpParam);
  55. ULONG ulTableId = 0;
  56. protected:
  57. virtual HRESULT LockSoap();
  58. virtual HRESULT UnLockSoap();
  59. KCmd* lpCmd;
  60. std::recursive_mutex &lpDataLock;
  61. ECSESSIONID ecSessionId;
  62. entryId m_sEntryId;
  63. void * m_lpProvider;
  64. ULONG m_ulTableType;
  65. ULONG m_ulSessionReloadCallback;
  66. WSTransport* m_lpTransport;
  67. SPropTagArray *m_lpsPropTagArray = nullptr;
  68. SSortOrderSet *m_lpsSortOrderSet = nullptr;
  69. SRestriction *m_lpsRestriction = nullptr;
  70. ULONG ulFlags;
  71. ULONG ulType;
  72. void *m_lpParam = nullptr;
  73. RELOADCALLBACK m_lpCallback = nullptr;
  74. };
  75. #endif