gloox  0.9.9.12
rosterlistener.h
1 /*
2  Copyright (c) 2004-2008 by Jakob Schroeter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
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.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef ROSTERLISTENER_H__
15 #define ROSTERLISTENER_H__
16 
17 #include "rosteritem.h"
18 
19 #include <string>
20 #include <map>
21 
22 namespace gloox
23 {
24 
25  class Stanza;
26 
30  typedef std::map<const std::string, RosterItem*> Roster;
31 
42  class GLOOX_API RosterListener
43  {
44  public:
48  virtual ~RosterListener() {}
49 
58  virtual void handleItemAdded( const JID& jid ) = 0;
59 
65  virtual void handleItemSubscribed( const JID& jid ) = 0;
66 
74  virtual void handleItemRemoved( const JID& jid ) = 0;
75 
86  virtual void handleItemUpdated( const JID& jid ) = 0;
87 
93  virtual void handleItemUnsubscribed( const JID& jid ) = 0;
94 
103  virtual void handleRoster( const Roster& roster ) = 0;
104 
115  virtual void handleRosterPresence( const RosterItem& item, const std::string& resource,
116  Presence presence, const std::string& msg ) = 0;
117 
129  virtual void handleSelfPresence( const RosterItem& item, const std::string& resource,
130  Presence presence, const std::string& msg ) = 0;
131 
142  virtual bool handleSubscriptionRequest( const JID& jid, const std::string& msg ) = 0;
143 
154  virtual bool handleUnsubscriptionRequest( const JID& jid, const std::string& msg ) = 0;
155 
161  virtual void handleNonrosterPresence( Stanza* stanza ) = 0;
162 
167  virtual void handleRosterError( Stanza* stanza ) = 0;
168  };
169 
170 }
171 
172 #endif // ROSTERLISTENER_H__