wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Contact / ContactRef.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        ContactRef.cpp
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief
23  */
24
25 #include "ContactRef.h"
26 #include <Logger.h>
27
28 namespace DeviceAPI {
29 namespace Contact {
30
31 ContactRef::ContactRef() :
32                 m_addressBookIdIsSet(false),
33                 m_contactIdIsSet(false)
34 {
35 }
36
37 ContactRef::~ContactRef()
38 {
39 }
40
41 std::string ContactRef::getAddressBookId() const
42 {
43         return m_addressBookId;
44 }
45
46 void ContactRef::setAddressBookId(const std::string value)
47 {
48         m_addressBookId = value;
49         m_addressBookIdIsSet = true;
50 }
51
52 bool ContactRef::getAddressBookIdIsSet() const
53 {
54         return m_addressBookIdIsSet;
55 }
56
57 void ContactRef::setAddressBookId(const int value)
58 {
59         std::stringstream oss;
60         oss << value;
61         m_addressBookId = oss.str();
62         m_addressBookIdIsSet = true;
63 }
64
65 std::string ContactRef::getContactId() const
66 {
67         return m_contactId;
68 }
69
70 void ContactRef::setContactId(const std::string value)
71 {
72         m_contactId = value;
73         m_contactIdIsSet = true;
74 }
75
76 bool ContactRef::getContactIdIsSet() const
77 {
78         return m_contactIdIsSet;
79 }
80
81 void ContactRef::setContactId(const int value)
82 {
83         std::stringstream oss;
84         oss << value;
85         m_contactId = oss.str();
86         m_contactIdIsSet = true;
87 }
88
89 void ContactRef::clear()
90 {
91         m_addressBookId = "";
92         m_addressBookIdIsSet = false;
93
94         m_contactId = "";
95         m_contactIdIsSet = false;
96 }
97
98 ContactRefPtr ContactRef::clone()
99 {
100         ContactRefPtr result(new ContactRef());
101
102         result->m_addressBookId = m_addressBookId;
103         result->m_addressBookIdIsSet = m_addressBookIdIsSet;
104
105         result->m_contactId = m_contactId;
106         result->m_contactIdIsSet = m_contactIdIsSet;
107
108         return result;
109 }
110
111 } // Contact
112 } // DeviceAPI