00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SEARCH_H__
00016 #define SEARCH_H__
00017
00018 #include "gloox.h"
00019 #include "searchhandler.h"
00020 #include "discohandler.h"
00021 #include "iqhandler.h"
00022
00023 #include <string>
00024
00025 namespace gloox
00026 {
00027
00028 class ClientBase;
00029 class Stanza;
00030 class Disco;
00031
00047 class Search : public IqHandler
00048 {
00049
00050 public:
00055 Search( ClientBase *parent );
00056
00060 ~Search();
00061
00067 void fetchSearchFields( const JID& directory, SearchHandler *sh );
00068
00076 void search( const JID& directory, DataForm *form, SearchHandler *sh );
00077
00087 void search( const JID& directory, int fields, const SearchFieldStruct& values, SearchHandler *sh );
00088
00089
00090 virtual bool handleIq( Stanza *stanza ) { (void) stanza; return false; };
00091
00092
00093 virtual bool handleIqID( Stanza *stanza, int context );
00094
00095 private:
00096 enum IdType
00097 {
00098 FetchSearchFields,
00099 DoSearch
00100 };
00101
00102 typedef std::map<std::string, SearchHandler*> TrackMap;
00103 TrackMap m_track;
00104
00105 ClientBase *m_parent;
00106 Disco *m_disco;
00107
00108 };
00109
00110 }
00111
00112 #endif // SEARCH_H__