blob: 61b85473648fcf74e61ef438c1a3eb9c62b22207 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
/*
* 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 <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
#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<SearchPayload> 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<String>& getInstructions() const {
return instructions;
}
const boost::optional<String>& getNick() const {
return nick;
}
const boost::optional<String>& getFirst() const {
return first;
}
const boost::optional<String>& getLast() const {
return last;
}
const boost::optional<String>& 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<Item> getItems() const {
return items;
}
void addItem(const Item& item) {
items.push_back(item);
}
private:
Form::ref form;
boost::optional<String> instructions;
boost::optional<String> nick;
boost::optional<String> first;
boost::optional<String> last;
boost::optional<String> email;
std::vector<Item> items;
};
}
|