2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
20 * @author Kisub Song (kisubs.song@samsung.com)
23 * ## - Change name to IPerson
27 #include <Commons/ThreadPool.h>
28 #include "ContactFactory.h"
34 using namespace WrtDeviceApis::Commons;
37 EventRequestReceiver< EventPersonLink >(ThreadEnum::NULL_THREAD),
38 EventRequestReceiver< EventPersonUnlink >(ThreadEnum::NULL_THREAD),
40 m_displayNameIsSet(false),
42 m_contactCountIsSet(false),
43 m_hasPhoneNumber(false),
46 m_photoURIIsSet(false),
47 m_ringtoneURIIsSet(false),
48 m_displayContactIdIsSet(false)
56 void IPerson::link(const EventPersonLinkPtr &event)
58 //post event to PLATFORM implementation
59 EventRequestReceiver< EventPersonLink >::PostRequest(event);
62 void IPerson::unlink(const EventPersonUnlinkPtr &event)
64 //post event to PLATFORM implementation
65 EventRequestReceiver< EventPersonUnlink >::PostRequest(event);
68 std::string IPerson::getId() const
73 void IPerson::setId(const std::string value)
79 void IPerson::setId(const int value)
81 std::stringstream oss;
87 void IPerson::unsetId()
93 bool IPerson::getIdIsSet() const
98 std::string IPerson::getDisplayName() const
100 return m_displayName;
103 void IPerson::setDisplayName(const std::string value)
105 m_displayName = value;
106 m_displayNameIsSet = true;
109 void IPerson::unsetDisplayName()
112 m_displayNameIsSet = false;
115 bool IPerson::getDisplayNameIsSet() const
117 return m_displayNameIsSet;
120 long IPerson::getContactCount() const
122 return m_contactCount;
125 void IPerson::setContactCount(const long value)
127 m_contactCount = value;
128 m_contactCountIsSet = true;
130 void IPerson::unsetContactCount()
133 m_contactCountIsSet = false;
136 bool IPerson::getContactCountIsSet() const
138 return m_contactCountIsSet;
141 bool IPerson::getHasPhoneNumber() const
143 return m_hasPhoneNumber;
146 void IPerson::setHasPhoneNumber(const bool &value)
148 m_hasPhoneNumber = value;
151 bool IPerson::getHasEmail() const
156 void IPerson::setHasEmail(const bool &value)
161 bool IPerson::getIsFavorite() const
166 void IPerson::setIsFavorite(const bool &value)
168 m_isFavorite = value;
171 std::string IPerson::getPhotoURI() const
176 void IPerson::setPhotoURI(const std::string &value)
179 m_photoURIIsSet = true;
182 void IPerson::unsetPhotoURI()
185 m_photoURIIsSet = false;
188 bool IPerson::getPhotoURIIsSet() const
190 return m_photoURIIsSet;
193 std::string IPerson::getPhotoURIRealPath() const
195 return m_photoURIRealPath;
198 void IPerson::setPhotoURIRealPath(const std::string &value)
200 m_photoURIRealPath = value;
203 std::string IPerson::getRingtoneURI() const
205 return m_ringtoneURI;
208 void IPerson::setRingtoneURI(const std::string &value)
210 m_ringtoneURI = value;
211 m_ringtoneURIIsSet = true;
214 void IPerson::unsetRingtoneURI()
217 m_ringtoneURIIsSet = false;
220 bool IPerson::getRingtoneURIIsSet() const
222 return m_ringtoneURIIsSet;
225 std::string IPerson::getRingtoneURIRealPath() const
227 return m_ringtoneURIRealPath;
230 void IPerson::setRingtoneURIRealPath(const std::string &value)
232 m_ringtoneURIRealPath = value;
235 std::string IPerson::getDisplayContactId() const
237 return m_displayContactId;
240 void IPerson::setDisplayContactId(const std::string value)
242 m_displayContactId = value;
243 m_displayContactIdIsSet = true;
246 void IPerson::setDisplayContactId(const int value)
248 std::stringstream oss;
250 m_displayContactId = oss.str();
251 m_displayContactIdIsSet = true;
254 void IPerson::unsetDisplayContactId()
256 m_displayContactId = "";
257 m_displayContactIdIsSet = false;
260 bool IPerson::getDisplayContactIdIsSet() const
262 return m_displayContactIdIsSet;
265 void IPerson::copy(const PersonPtr &person)
268 m_idIsSet = person->m_idIsSet;
270 m_displayName = person->m_displayName;
271 m_displayNameIsSet = person->m_displayNameIsSet;
273 m_contactCount = person->m_contactCount;
274 m_contactCountIsSet = person->m_contactCountIsSet;
276 m_hasPhoneNumber = person->m_hasPhoneNumber;
278 m_hasEmail = person->m_hasEmail;
280 m_isFavorite = person->m_isFavorite;
282 m_photoURI = person->m_photoURI;
283 m_photoURIIsSet = person->m_photoURIIsSet;
284 m_photoURIRealPath = person->m_photoURIRealPath;
286 m_ringtoneURI = person->m_ringtoneURI;
287 m_ringtoneURIIsSet = person->m_ringtoneURIIsSet;
288 m_ringtoneURIRealPath = person->m_ringtoneURIRealPath;
290 m_displayContactId = person->m_displayContactId;
291 m_displayContactIdIsSet = person->m_displayContactIdIsSet;
294 void IPerson::clear()
300 m_displayNameIsSet = false;
303 m_contactCountIsSet = false;
305 m_hasPhoneNumber = false;
309 m_isFavorite = false;
312 m_photoURIIsSet = false;
313 m_photoURIRealPath = "";
316 m_ringtoneURIIsSet = false;
317 m_ringtoneURIRealPath = "";
319 m_displayContactId = "";
320 m_displayContactIdIsSet = false;