rosterlistener.h
/*
Copyright (c) 2004-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef ROSTERLISTENER_H__
#define ROSTERLISTENER_H__
#include "rosteritem.h"
#include <string>
#include <map>
namespace gloox
{
class IQ;
class Presence;
typedef std::map<const std::string, RosterItem*> Roster;
class GLOOX_API RosterListener
{
public:
virtual ~RosterListener() {}
virtual void handleItemAdded( const JID& jid ) = 0;
virtual void handleItemSubscribed( const JID& jid ) = 0;
virtual void handleItemRemoved( const JID& jid ) = 0;
virtual void handleItemUpdated( const JID& jid ) = 0;
virtual void handleItemUnsubscribed( const JID& jid ) = 0;
virtual void handleRoster( const Roster& roster ) = 0;
virtual void handleRosterPresence( const RosterItem& item, const std::string& resource,
Presence::PresenceType presence, const std::string& msg ) = 0;
virtual void handleSelfPresence( const RosterItem& item, const std::string& resource,
Presence::PresenceType presence, const std::string& msg ) = 0;
virtual bool handleSubscriptionRequest( const JID& jid, const std::string& msg ) = 0;
virtual bool handleUnsubscriptionRequest( const JID& jid, const std::string& msg ) = 0;
virtual void handleNonrosterPresence( const Presence& presence ) = 0;
virtual void handleRosterError( const IQ& iq ) = 0;
};
}
#endif // ROSTERLISTENER_H__
gloox::IQ
An abstraction of an IQ stanza.
Definition iq.h:34
gloox::JID
An abstraction of a JID.
Definition jid.h:31
gloox::Presence
An abstraction of a presence stanza.
Definition presence.h:33
gloox::Presence::PresenceType
PresenceType
Definition presence.h:43
gloox::RosterItem
An abstraction of a roster item.
Definition rosteritem.h:41
gloox::RosterListener
A virtual interface which can be reimplemented to receive roster updates.
Definition rosterlistener.h:44
gloox::RosterListener::handleSubscriptionRequest
virtual bool handleSubscriptionRequest(const JID &jid, const std::string &msg)=0
gloox::RosterListener::handleItemUnsubscribed
virtual void handleItemUnsubscribed(const JID &jid)=0
gloox::RosterListener::handleItemRemoved
virtual void handleItemRemoved(const JID &jid)=0
gloox::RosterListener::handleRoster
virtual void handleRoster(const Roster &roster)=0
gloox::RosterListener::handleItemSubscribed
virtual void handleItemSubscribed(const JID &jid)=0
gloox::RosterListener::~RosterListener
virtual ~RosterListener()
Definition rosterlistener.h:49
gloox::RosterListener::handleNonrosterPresence
virtual void handleNonrosterPresence(const Presence &presence)=0
gloox::RosterListener::handleItemAdded
virtual void handleItemAdded(const JID &jid)=0
gloox::RosterListener::handleItemUpdated
virtual void handleItemUpdated(const JID &jid)=0
gloox::RosterListener::handleRosterPresence
virtual void handleRosterPresence(const RosterItem &item, const std::string &resource, Presence::PresenceType presence, const std::string &msg)=0
gloox::RosterListener::handleSelfPresence
virtual void handleSelfPresence(const RosterItem &item, const std::string &resource, Presence::PresenceType presence, const std::string &msg)=0
gloox::RosterListener::handleUnsubscriptionRequest
virtual bool handleUnsubscriptionRequest(const JID &jid, const std::string &msg)=0
gloox::RosterListener::handleRosterError
virtual void handleRosterError(const IQ &iq)=0
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::Roster
std::map< const std::string, RosterItem * > Roster
Definition rosterlistener.h:31