/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include #include #include "Swiften/Elements/Payload.h" #include "Swiften/Elements/Form.h" #include "Swiften/Base/String.h" namespace Swift { /** * XEP-0055 search payload. */ class SearchPayload : public Payload { public: typedef boost::shared_ptr ref; struct Item { String first; String last; String nick; String email; JID jid; }; SearchPayload() {} Form::ref getForm() const { return form; } void setForm(Form::ref f) { form = f; } const boost::optional& getInstructions() const { return instructions; } const boost::optional& getNick() const { return nick; } const boost::optional& getFirst() const { return first; } const boost::optional& getLast() const { return last; } const boost::optional& getEMail() const { return email; } void setInstructions(const String& v) { this->instructions = v; } void setNick(const String& v) { this->nick = v; } void setFirst(const String& v) { this->first = v; } void setLast(const String& v) { this->last = v; } void setEMail(const String& v) { this->email = v; } const std::vector getItems() const { return items; } void addItem(const Item& item) { items.push_back(item); } private: Form::ref form; boost::optional instructions; boost::optional nick; boost::optional first; boost::optional last; boost::optional email; std::vector items; }; }