2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file ContactPhoneNumber.cpp
19 * @author Kisub Song (kisubs.song@samsung.com)
24 #include "ContactPhoneNumber.h"
32 ContactPhoneNumber::ContactPhoneNumber() :
35 m_types = ContactPhoneNumberTypeArrayPtr(new ContactPhoneNumberTypeArray());
38 ContactPhoneNumber::~ContactPhoneNumber()
42 std::string ContactPhoneNumber::getNumber() const
47 void ContactPhoneNumber::setNumber(const std::string &value)
53 void ContactPhoneNumber::unsetNumber()
56 m_numberIsSet = false;
59 bool ContactPhoneNumber::getNumberIsSet() const
64 ContactPhoneNumberTypeArrayPtr ContactPhoneNumber::getTypes() const
69 void ContactPhoneNumber::setTypes(const ContactPhoneNumberTypeArrayPtr &value)
74 void ContactPhoneNumber::addType(const ContactPhoneNumberType value)
76 m_types->push_back(value);
79 bool ContactPhoneNumber::isTypeOf(const ContactPhoneNumberType value) const
81 return std::find(m_types->begin(), m_types->end(), value) != m_types->end();
84 int ContactPhoneNumber::getTypesNum() const
86 return m_types->size();
89 void ContactPhoneNumber::clear()
92 m_numberIsSet = false;
94 m_types = ContactPhoneNumberTypeArrayPtr(new ContactPhoneNumberTypeArray());
97 ContactPhoneNumberPtr ContactPhoneNumber::clone() const
99 ContactPhoneNumberPtr result(new ContactPhoneNumber());
101 result->m_number = m_number;
102 result->m_numberIsSet = m_numberIsSet;
104 result->m_types = ContactPhoneNumberTypeArrayPtr(new ContactPhoneNumberTypeArray());
105 ContactPhoneNumberTypeArray::iterator typeIter;
106 for(typeIter = m_types->begin(); typeIter != m_types->end(); typeIter++)
108 ContactPhoneNumberType type = *typeIter;
109 result->m_types->push_back(type);