summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-17 07:03:16 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-17 07:41:26 (GMT)
commit436ae921afbc5c2b461ee9b2d8fa9b1c869ed274 (patch)
tree9d209712286cc49d4c1f08be5ab8f5b90ef4971c /Swiften/LinkLocal/LinkLocalServiceInfo.h
parent2c954f7e9464b8fdd970eed829e2ba632e8979d8 (diff)
downloadswift-436ae921afbc5c2b461ee9b2d8fa9b1c869ed274.zip
swift-436ae921afbc5c2b461ee9b2d8fa9b1c869ed274.tar.bz2
Implement LinkLocalServiceInfo TXT record.
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalServiceInfo.h')
-rw-r--r--Swiften/LinkLocal/LinkLocalServiceInfo.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/LinkLocalServiceInfo.h b/Swiften/LinkLocal/LinkLocalServiceInfo.h
new file mode 100644
index 0000000..bd5286b
--- /dev/null
+++ b/Swiften/LinkLocal/LinkLocalServiceInfo.h
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <boost/optional.hpp>
+
+#include "Swiften/Base/ByteArray.h"
+#include "Swiften/Base/String.h"
+#include "Swiften/JID/JID.h"
+
+namespace Swift {
+
+ class LinkLocalServiceInfo {
+ public:
+ enum Status { Available, Away, DND };
+
+ LinkLocalServiceInfo() : status(Available) {}
+
+ const String& getFirstName() const { return firstName; }
+ void setFirstName(const String& f) { firstName = f; }
+
+ const String& getLastName() const { return lastName; }
+ void setLastName(const String& l) { lastName = l; }
+
+ const String& getEMail() const { return email; }
+ void setEMail(const String& e) { email = e; }
+
+ const JID& getJID() const { return jid; }
+ void setJID(const JID& j) { jid = j; }
+
+ const String& getMessage() const { return message; }
+ void setMessage(const String& m) { message = m; }
+
+ const String& getNick() const { return nick; }
+ void setNick(const String& n) { nick = n; }
+
+ Status getStatus() const { return status; }
+ void setStatus(Status s) { status = s; }
+
+ boost::optional<int> getPort() const { return port; }
+ void setPort(int p) { port = p; }
+
+ ByteArray toTXTRecord() const;
+
+ private:
+ static ByteArray getEncoded(const String&);
+
+ private:
+ String firstName;
+ String lastName;
+ String email;
+ JID jid;
+ String message;
+ String nick;
+ Status status;
+ boost::optional<int> port;
+ };
+}