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.
17 * @file ContactPhoneNumber.cpp
18 * @author Lukasz Marek (l.marek@samsung.com)
22 #include "ContactPhoneNumber.h"
24 namespace WrtDeviceApis {
28 ContactPhoneNumber::ContactPhoneNumber()
32 ContactPhoneNumber::~ContactPhoneNumber()
36 std::string ContactPhoneNumber::getNumber() const
41 void ContactPhoneNumber::setNumber(const std::string &value)
46 std::vector<ContactPhoneNumber::ContactPhoneNumberType> ContactPhoneNumber::
52 void ContactPhoneNumber::addType(const ContactPhoneNumberType value)
54 m_types.push_back(value);
57 void ContactPhoneNumber::setTypes(
58 const std::vector<ContactPhoneNumberType> value)
63 bool ContactPhoneNumber::isTypeOf(
64 ContactPhoneNumber::ContactPhoneNumberType value) const
66 return std::find(m_types.begin(), m_types.end(), value) != m_types.end();
69 ContactPhoneNumber::ContactPhoneNumberType ContactPhoneNumber::getTypeFilter()
72 return m_types.size() == 0 ? CONTACT_PHONE_NUMBER_TYPE_PREF : m_types[0];
75 void ContactPhoneNumber::setTypeFilter(
76 ContactPhoneNumber::ContactPhoneNumberType value)
79 m_types.push_back(value);
82 ContactPhoneNumberPtr ContactPhoneNumber::clone() const
84 return ContactPhoneNumberPtr(new ContactPhoneNumber(*this));