00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <map>
00010
00011 #include <string>
00012 #include <Swiften/JID/JID.h>
00013 #include <Swiften/Base/boost_bsignals.h>
00014 #include <Swiften/Elements/Presence.h>
00015 #include <Swiften/Base/API.h>
00016
00017 namespace Swift {
00018 class StanzaChannel;
00019
00020 class SWIFTEN_API SubscriptionManager {
00021 public:
00022 SubscriptionManager(StanzaChannel* stanzaChannel);
00023 ~SubscriptionManager();
00024
00025 void cancelSubscription(const JID& jid);
00026 void confirmSubscription(const JID& jid);
00027 void requestSubscription(const JID& jid);
00028
00037 boost::signal<void (const JID&, const std::string&, Presence::ref)> onPresenceSubscriptionRequest;
00038
00039 boost::signal<void (const JID&, const std::string&)> onPresenceSubscriptionRevoked;
00040
00041 private:
00042 void handleIncomingPresence(Presence::ref presence);
00043
00044 private:
00045 StanzaChannel* stanzaChannel;
00046 };
00047 }