00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <boost/optional.hpp>
00010 #include <vector>
00011 #include <set>
00012 #include <Swiften/Base/boost_bsignals.h>
00013
00014 #include <string>
00015 #include <Swiften/JID/JID.h>
00016 #include <Swiften/Elements/RosterItemPayload.h>
00017 #include <Swiften/Roster/XMPPRosterItem.h>
00018
00019 namespace Swift {
00026 class XMPPRoster {
00027 public:
00028 XMPPRoster();
00029 virtual ~XMPPRoster();
00030
00034 virtual bool containsJID(const JID& jid) = 0;
00035
00039 virtual RosterItemPayload::Subscription getSubscriptionStateForJID(const JID& jid) = 0;
00040
00044 virtual std::string getNameForJID(const JID& jid) const = 0;
00045
00049 virtual std::vector<std::string> getGroupsForJID(const JID& jid) = 0;
00050
00054 virtual std::vector<XMPPRosterItem> getItems() const = 0;
00055
00059 virtual boost::optional<XMPPRosterItem> getItem(const JID&) const = 0;
00060
00064 virtual std::set<std::string> getGroups() const = 0;
00065
00066 public:
00070 boost::signal<void (const JID&)> onJIDAdded;
00071
00075 boost::signal<void (const JID&)> onJIDRemoved;
00076
00081 boost::signal<void (const JID&, const std::string&, const std::vector<std::string>&)> onJIDUpdated;
00082
00088 boost::signal<void ()> onRosterCleared;
00089
00094 boost::signal<void ()> onInitialRosterPopulated;
00095 };
00096 }