2
Copyright (c) 2004-2009 by Jakob Schroeter <js@camaya.net>
3
This file is part of the gloox library. http://camaya.net/gloox
5
This software is distributed under a license. The full license
6
agreement can be found in the file LICENSE in this distribution.
7
This software may not be copied, modified, sold or distributed
8
other than expressed in the named license agreement.
10
This software is distributed without any warranty.
14
#ifndef DISCOHANDLER_H__
15
#define DISCOHANDLER_H__
28
* @brief A virtual interface that enables objects to receive Service Discovery (XEP-0030) events.
30
* A class implementing this interface can receive the results of sent disco queries.
32
* @author Jakob Schroeter <js@camaya.net>
34
class GLOOX_API DiscoHandler
40
virtual ~DiscoHandler() {}
43
* Reimplement this function if you want to be notified about the result
44
* of an disco#info query.
45
* @param from The sender of the disco#info result.
46
* @param info The Info.
47
* @param context A context identifier.
50
virtual void handleDiscoInfo( const JID& from, const Disco::Info& info, int context ) = 0;
53
* Reimplement this function if you want to be notified about the result
54
* of a disco#items query.
55
* @param from The sender of the disco#items result.
56
* @param items The Items.
57
* @param context A context identifier.
60
virtual void handleDiscoItems( const JID& from, const Disco::Items& items, int context ) = 0;
63
* Reimplement this function to receive disco error notifications.
64
* @param from The sender of the error result.
65
* @param error The Error. May be 0.
66
* @param context A context identifier.
69
virtual void handleDiscoError( const JID& from, const Error* error, int context ) = 0;
72
* Reimplement this function to receive notifications about incoming IQ
73
* stanzas of type 'set' in the disco namespace.
74
* @param iq The full IQ.
75
* @return Returns @b true if the stanza was handled and answered, @b false otherwise.
77
virtual bool handleDiscoSet( const IQ& iq ) { (void)iq; return false; }
83
#endif // DISCOHANDLER_H__