tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / Contact / ContactFilter.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * @file        ContactFilter.cpp
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  */
21
22 #include "ContactFilter.h"
23
24 namespace {
25 const int CONTACT_FILTER_UNDEFINED_CONTACT_ID = -1;
26 }
27
28 namespace WrtDeviceApis {
29 namespace Contact {
30 namespace Api {
31
32 ContactFilter::ContactFilter() :
33     m_id(CONTACT_FILTER_UNDEFINED_CONTACT_ID),
34     m_fullNameIsSet(false),
35     m_firstNameIsSet(false),
36     m_lastNameIsSet(false),
37     m_phoneticNameIsSet(false),
38     m_companyIsSet(false),
39     m_titleIsSet(false),
40     m_groupIsSet(false)
41 {
42 }
43
44 ContactFilter::~ContactFilter()
45 {
46 }
47
48 int ContactFilter::getIdFilter() const
49 {
50     return m_id;
51 }
52
53 void ContactFilter::setIdFilter(int value)
54 {
55     m_id = value;
56 }
57
58 bool ContactFilter::getIdIsSet() const
59 {
60     return m_id != CONTACT_FILTER_UNDEFINED_CONTACT_ID;
61 }
62
63 std::string ContactFilter::getFullNameFilter() const
64 {
65     return m_fullName;
66 }
67
68 void ContactFilter::setFullNameFilter(const std::string &value)
69 {
70     m_fullName = value;
71     m_fullNameIsSet = true;
72 }
73
74 bool ContactFilter::getFullNameIsSet() const
75 {
76     return m_fullNameIsSet;
77 }
78
79 std::string ContactFilter::getFirstNameFilter() const
80 {
81     return m_firstName;
82 }
83
84 void ContactFilter::setFirstNameFilter(const std::string &value)
85 {
86     m_firstName = value;
87     m_firstNameIsSet = true;
88 }
89
90 bool ContactFilter::getFirstNameIsSet() const
91 {
92     return m_firstNameIsSet;
93 }
94
95 std::string ContactFilter::getLastNameFilter() const
96 {
97     return m_lastName;
98 }
99
100 void ContactFilter::setLastNameFilter(const std::string &value)
101 {
102     m_lastName = value;
103     m_lastNameIsSet = true;
104 }
105
106 bool ContactFilter::getLastNameIsSet() const
107 {
108     return m_lastNameIsSet;
109 }
110
111 std::string ContactFilter::getPhoneticNameFilter() const
112 {
113     return m_phoneticName;
114 }
115
116 void ContactFilter::setPhoneticNameFilter(const std::string &value)
117 {
118     m_phoneticName = value;
119     m_phoneticNameIsSet = true;
120 }
121
122 bool ContactFilter::getPhoneticNameIsSet() const
123 {
124     return m_phoneticNameIsSet;
125 }
126
127 std::string ContactFilter::getCompanyFilter() const
128 {
129     return m_company;
130 }
131
132 void ContactFilter::setCompanyFilter(const std::string &value)
133 {
134     m_company = value;
135     m_companyIsSet = true;
136 }
137
138 bool ContactFilter::getCompanyIsSet() const
139 {
140     return m_companyIsSet;
141 }
142
143 std::string ContactFilter::getTitleFilter() const
144 {
145     return m_title;
146 }
147
148 void ContactFilter::setTitleFilter(const std::string &value)
149 {
150     m_title = value;
151     m_titleIsSet = true;
152 }
153
154 bool ContactFilter::getTitleIsSet() const
155 {
156     return m_titleIsSet;
157 }
158
159 const std::vector<ContactPhoneNumberPtr> &ContactFilter::getPhoneNumberFilter()
160 const
161 {
162     return m_phoneNumber;
163 }
164
165 void ContactFilter::setPhoneNumberFilter(
166         const std::vector<ContactPhoneNumberPtr> &value)
167 {
168     m_phoneNumber = value;
169 }
170
171 bool ContactFilter::getPhoneNumberIsSet() const
172 {
173     return m_phoneNumber.size() != 0;
174 }
175
176 const std::vector<ContactEmailPtr> &ContactFilter::getEmailFilter() const
177 {
178     return m_email;
179 }
180
181 void ContactFilter::setEmailFilter(const std::vector<ContactEmailPtr> &value)
182 {
183     m_email = value;
184 }
185
186 bool ContactFilter::getEmailIsSet() const
187 {
188     return m_email.size() != 0;
189 }
190
191 const std::vector<std::string> &ContactFilter::getNickNameFilter()
192 {
193     return m_nickname;
194 }
195
196 void ContactFilter::setNickNameFilter(const std::vector<std::string> &value)
197 {
198     m_nickname = value;
199 }
200
201 bool ContactFilter::getNickNameIsSet() const
202 {
203     return m_nickname.size() != 0;
204 }
205
206 const std::vector<ContactAddressPtr> &ContactFilter::getAddressFilter()
207 {
208     return m_address;
209 }
210
211 void ContactFilter::setAddressFilter(
212         const std::vector<ContactAddressPtr> &value)
213 {
214     m_address = value;
215 }
216
217 bool ContactFilter::getAddressIsSet() const
218 {
219     return m_address.size() != 0;
220 }
221
222 std::string ContactFilter::getGroupFilter() const
223 {
224     return m_group;
225 }
226
227 void ContactFilter::setGroupFilter(const std::string &value)
228 {
229     m_group = value;
230     m_groupIsSet = true;
231 }
232
233 bool ContactFilter::getGroupIsSet() const
234 {
235     return m_groupIsSet;
236 }
237
238 }
239 }
240 }