gloox 1.0
|
00001 /* 00002 Copyright (c) 2004-2009 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 ROSTERLISTENER_H__ 00015 #define ROSTERLISTENER_H__ 00016 00017 #include "rosteritem.h" 00018 00019 #include <string> 00020 #include <map> 00021 00022 namespace gloox 00023 { 00024 00025 class IQ; 00026 class Presence; 00027 00031 typedef std::map<const std::string, RosterItem*> Roster; 00032 00043 class GLOOX_API RosterListener 00044 { 00045 public: 00049 virtual ~RosterListener() {} 00050 00059 virtual void handleItemAdded( const JID& jid ) = 0; 00060 00066 virtual void handleItemSubscribed( const JID& jid ) = 0; 00067 00075 virtual void handleItemRemoved( const JID& jid ) = 0; 00076 00087 virtual void handleItemUpdated( const JID& jid ) = 0; 00088 00094 virtual void handleItemUnsubscribed( const JID& jid ) = 0; 00095 00104 virtual void handleRoster( const Roster& roster ) = 0; 00105 00116 virtual void handleRosterPresence( const RosterItem& item, const std::string& resource, 00117 Presence::PresenceType presence, const std::string& msg ) = 0; 00118 00130 virtual void handleSelfPresence( const RosterItem& item, const std::string& resource, 00131 Presence::PresenceType presence, const std::string& msg ) = 0; 00132 00143 virtual bool handleSubscriptionRequest( const JID& jid, const std::string& msg ) = 0; 00144 00155 virtual bool handleUnsubscriptionRequest( const JID& jid, const std::string& msg ) = 0; 00156 00162 virtual void handleNonrosterPresence( const Presence& presence ) = 0; 00163 00168 virtual void handleRosterError( const IQ& iq ) = 0; 00169 }; 00170 00171 } 00172 00173 #endif // ROSTERLISTENER_H__