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