• Main Page
  • Classes
  • Files
  • File List

Swiften/Elements/SearchPayload.h

00001 /*
00002  * Copyright (c) 2010 Remko Tronçon
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <boost/shared_ptr.hpp>
00010 #include <boost/optional.hpp>
00011 
00012 #include <Swiften/Elements/Payload.h>
00013 #include <Swiften/Elements/Form.h>
00014 #include <string>
00015 
00016 namespace Swift {
00020   class SearchPayload : public Payload {
00021     public:
00022       typedef boost::shared_ptr<SearchPayload> ref;
00023 
00024       struct Item {
00025         std::string first;
00026         std::string last;
00027         std::string nick;
00028         std::string email;
00029         JID jid;
00030       };
00031 
00032       SearchPayload() {}
00033 
00034       Form::ref getForm() const { return form; }
00035       void setForm(Form::ref f) { form = f; }
00036 
00037       const boost::optional<std::string>& getInstructions() const {
00038         return instructions;
00039       }
00040 
00041       const boost::optional<std::string>& getNick() const {
00042         return nick;
00043       }
00044 
00045       const boost::optional<std::string>& getFirst() const {
00046         return first;
00047       }
00048 
00049       const boost::optional<std::string>& getLast() const {
00050         return last;
00051       }
00052 
00053       const boost::optional<std::string>& getEMail() const {
00054         return email;
00055       }
00056 
00057       void setInstructions(const std::string& v) {
00058         this->instructions = v;
00059       }
00060 
00061       void setNick(const std::string& v) {
00062         this->nick = v;
00063       }
00064 
00065       void setFirst(const std::string& v) {
00066         this->first = v;
00067       }
00068 
00069       void setLast(const std::string& v) {
00070         this->last = v;
00071       }
00072 
00073       void setEMail(const std::string& v) {
00074         this->email = v;
00075       }
00076 
00077       const std::vector<Item>& getItems() const {
00078         return items;
00079       }
00080 
00081       void addItem(const Item& item) {
00082         items.push_back(item);
00083       }
00084 
00085     private:
00086       Form::ref form;
00087       boost::optional<std::string> instructions;
00088       boost::optional<std::string> nick;
00089       boost::optional<std::string> first;
00090       boost::optional<std::string> last;
00091       boost::optional<std::string> email;
00092       std::vector<Item> items;
00093   };
00094 }

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1