summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalRoster.h')
-rw-r--r--Swiften/LinkLocal/LinkLocalRoster.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/Swiften/LinkLocal/LinkLocalRoster.h b/Swiften/LinkLocal/LinkLocalRoster.h
index 321bd96..33dd455 100644
--- a/Swiften/LinkLocal/LinkLocalRoster.h
+++ b/Swiften/LinkLocal/LinkLocalRoster.h
@@ -2,8 +2,13 @@
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
+#include <set>
+#include "Swiften/Base/String.h"
+#include "Swiften/JID/JID.h"
#include "Swiften/LinkLocal/DNSSDService.h"
+#include "Swiften/Elements/RosterPayload.h"
+#include "Swiften/Elements/Presence.h"
namespace Swift {
class HostAddress;
@@ -12,16 +17,28 @@ namespace Swift {
public:
LinkLocalRoster(boost::shared_ptr<DNSSDService> service);
+ boost::shared_ptr<RosterPayload> getRoster() const;
+ std::vector<boost::shared_ptr<Presence> > getAllPresence() const;
+
+ boost::signal<void (boost::shared_ptr<RosterPayload>)> onRosterChanged;
+ boost::signal<void (boost::shared_ptr<Presence>)> onPresenceChanged;
+
private:
+ RosterItemPayload getRosterItem(const DNSSDService::Service& service, const DNSSDService::ResolveResult& info) const;
+ String getRosterName(const DNSSDService::Service& service, const DNSSDService::ResolveResult& info) const;
+ JID getJIDForService(const DNSSDService::Service& service) const;
+ boost::shared_ptr<Presence> getPresence(const DNSSDService::Service& service, const DNSSDService::ResolveResult& info) const;
+
void handleStopped(bool);
void handleServiceRegistered(const DNSSDService::Service& service);
void handleServiceAdded(const DNSSDService::Service&);
void handleServiceRemoved(const DNSSDService::Service&);
void handleServiceResolved(const DNSSDService::Service& service, const DNSSDService::ResolveResult& result);
- void handleHostnameResolved(const String& hostname, const boost::optional<HostAddress>& address);
private:
boost::shared_ptr<DNSSDService> dnsSDService;
boost::optional<DNSSDService::Service> selfService;
+ typedef std::map<DNSSDService::Service, DNSSDService::ResolveResult> ServiceMap;
+ ServiceMap services;
};
}