search.h

00001 /*
00002   Copyright (c) 2006 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 
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       // reimplemented from IqHandler
00090       virtual bool handleIq( Stanza *stanza ) { (void) stanza; return false; };
00091 
00092       // reimplemented from IqHandler
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__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1