summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-08 18:41:53 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-08 18:41:53 (GMT)
commit19df82042f44c201e5a2821b4fa35465e33a1c90 (patch)
tree1746bddfa31ce2a6488ef5186036a049a255c9da /Swiften/Serializer/PayloadSerializers/FormSerializer.h
parent4a5a0977f661bf5c7c34ee7aa48b35073a682203 (diff)
downloadswift-19df82042f44c201e5a2821b4fa35465e33a1c90.zip
swift-19df82042f44c201e5a2821b4fa35465e33a1c90.tar.bz2
Added XEP-0004 data forms parsing & serializing.
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/FormSerializer.h')
-rw-r--r--Swiften/Serializer/PayloadSerializers/FormSerializer.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/FormSerializer.h b/Swiften/Serializer/PayloadSerializers/FormSerializer.h
new file mode 100644
index 0000000..1cdc7f2
--- /dev/null
+++ b/Swiften/Serializer/PayloadSerializers/FormSerializer.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "Swiften/Serializer/GenericPayloadSerializer.h"
+#include "Swiften/Elements/Form.h"
+#include "Swiften/Elements/FormField.h"
+#include "Swiften/Serializer/XML/XMLElement.h"
+
+namespace Swift {
+ class FormSerializer : public GenericPayloadSerializer<Form> {
+ public:
+ FormSerializer();
+
+ virtual String serializePayload(boost::shared_ptr<Form>) const;
+
+ private:
+ boost::shared_ptr<XMLElement> fieldToXML(boost::shared_ptr<FormField> field) const;
+ void multiLineify(const String& text, const String& elementName, boost::shared_ptr<XMLElement> parent) const;
+ };
+}
+
+