summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/ElementConvertors/PresenceConvertor.h')
-rw-r--r--Sluift/ElementConvertors/PresenceConvertor.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/Sluift/ElementConvertors/PresenceConvertor.h b/Sluift/ElementConvertors/PresenceConvertor.h
new file mode 100644
index 0000000..b13398d
--- /dev/null
+++ b/Sluift/ElementConvertors/PresenceConvertor.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014-2017 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Elements/Presence.h>
+
+#include <Sluift/ElementConvertors/StanzaConvertor.h>
+
+namespace Swift {
+ class LuaElementConvertors;
+
+ class PresenceConvertor : public StanzaConvertor<Presence> {
+ public:
+ PresenceConvertor(LuaElementConvertors* convertors);
+ virtual ~PresenceConvertor() override;
+
+ virtual std::shared_ptr<Presence> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Presence>) override;
+
+ virtual boost::optional<Documentation> getDocumentation() const override;
+
+ static std::string convertPresenceTypeToString(Presence::Type type);
+ static Presence::Type convertPresenceTypeFromString(const std::string& type);
+
+ private:
+ LuaElementConvertors* convertors;
+ };
+}
+