00001 /* 00002 Copyright (c) 2006-2007 by Jakob Schroeter <js@camaya.net> 00003 This file is part of the gloox library. http://camaya.net/gloox 00004 00005 This software is distributed under a license. The full license 00006 agreement can be found in the file LICENSE in this distribution. 00007 This software may not be copied, modified, sold or distributed 00008 other than expressed in the named license agreement. 00009 00010 This software is distributed without any warranty. 00011 */ 00012 00013 00014 #ifndef SEARCHHANDLER_H__ 00015 #define SEARCHHANDLER_H__ 00016 00017 #include "stanza.h" 00018 #include "dataform.h" 00019 00020 #include <string> 00021 00022 namespace gloox 00023 { 00024 00029 struct SearchFieldStruct 00030 { 00031 std::string first; 00032 std::string last; 00033 std::string nick; 00034 std::string email; 00035 JID jid; 00036 }; 00037 00041 enum SearchFieldEnum 00042 { 00043 SearchFieldFirst = 1, 00044 SearchFieldLast = 2, 00045 SearchFieldNick = 4, 00046 SearchFieldEmail = 8 00047 }; 00048 00052 typedef std::list<SearchFieldStruct> SearchResultList; 00053 00062 class GLOOX_API SearchHandler 00063 { 00064 public: 00068 virtual ~SearchHandler() {} 00069 00077 virtual void handleSearchFields( const JID& directory, int fields, 00078 const std::string& instructions ) = 0; 00079 00087 virtual void handleSearchFields( const JID& directory, DataForm *form ) = 0; 00088 00094 virtual void handleSearchResult( const JID& directory, const SearchResultList& resultList ) = 0; 00095 00102 virtual void handleSearchResult( const JID& directory, const DataForm *form ) = 0; 00103 00109 virtual void handleSearchError( const JID& directory, Stanza *stanza ) = 0; 00110 00111 }; 00112 00113 } 00114 00115 #endif // SEARCHHANDLER_H__