diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/Form.cpp | 15 | ||||
-rw-r--r-- | Swiften/Elements/Form.h | 8 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Swiften/Elements/Form.cpp b/Swiften/Elements/Form.cpp index c34b868..cf9ecf6 100644 --- a/Swiften/Elements/Form.cpp +++ b/Swiften/Elements/Form.cpp @@ -24,5 +24,20 @@ FormField::ref Form::getField(const std::string& name) const { return FormField::ref(); } +void Form::addReportedField(FormField::ref field) { + reportedFields_.push_back(field); +} + +const std::vector<FormField::ref>& Form::getReportedFields() const { + return reportedFields_; +} + +void Form::addItem(const Form::FormItem& item) { + items_.push_back(item); +} + +const std::vector<Form::FormItem>& Form::getItems() const { + return items_; +} } diff --git a/Swiften/Elements/Form.h b/Swiften/Elements/Form.h index 0d1ed63..2c6f963 100644 --- a/Swiften/Elements/Form.h +++ b/Swiften/Elements/Form.h @@ -22,6 +22,7 @@ namespace Swift { class Form : public Payload { public: typedef boost::shared_ptr<Form> ref; + typedef std::vector<FormField::ref> FormItem; enum Type { FormType, SubmitType, CancelType, ResultType }; @@ -46,8 +47,15 @@ namespace Swift { FormField::ref getField(const std::string& name) const; + void addReportedField(FormField::ref field); + const std::vector<FormField::ref>& getReportedFields() const; + + void addItem(const FormItem& item); + const std::vector<FormItem>& getItems() const; private: std::vector<boost::shared_ptr<FormField> > fields_; + std::vector<boost::shared_ptr<FormField> > reportedFields_; + std::vector<FormItem> items_; std::string title_; std::string instructions_; Type type_; |