ECSearchClient.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 ECSEARCHCLIENT_H
  18. #define ECSEARCHCLIENT_H
  19. #include <kopano/zcdefs.h>
  20. #include <map>
  21. #include <set>
  22. #include <string>
  23. #include <soapH.h>
  24. #include <kopano/kcodes.h>
  25. #include "ECChannelClient.h"
  26. namespace KC {
  27. struct SIndexedTerm {
  28. std::string strTerm;
  29. std::set<unsigned int> setFields;
  30. };
  31. typedef std::set<unsigned int> setindexprops_t;
  32. class ECSearchClient _kc_final : public ECChannelClient {
  33. public:
  34. ECSearchClient(const char *szIndexerPath, unsigned int ulTimeOut);
  35. ECRESULT GetProperties(setindexprops_t &mapProps);
  36. ECRESULT Query(GUID *lpServerGuid, GUID *lpStoreGUID, std::list<unsigned int> &lstFolders, std::list<SIndexedTerm> &lstSearches, std::list<unsigned int> &lstMatches, std::string &suggestion);
  37. ECRESULT SyncRun();
  38. private:
  39. ECRESULT Scope(const std::string &strServer, const std::string &strStore, const std::list<unsigned int> &ulFolders);
  40. ECRESULT Find(const std::set<unsigned int> &setFields, const std::string &strTerm);
  41. ECRESULT Query(std::list<unsigned int> &lstMatches);
  42. ECRESULT Suggest(std::string &suggestion);
  43. };
  44. } /* namespace */
  45. #endif /* ECSEARCHCLIENT_H */