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 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
20 #ifndef WAC_MESSAGING_EMAILUTILS_H_
21 #define WAC_MESSAGING_EMAILUTILS_H_
25 #include <API/Messaging/Recipient.h>
27 namespace WrtDeviceApis {
29 namespace EmailUtils {
31 * Formats address as: "Name" <address>.
32 * @param address E-mail address.
33 * @param name Name, omitted if empty.
34 * @return Formatted address.
36 std::string formatAddress(const std::string& address,
37 const std::string& name = std::string());
40 * Formats multiple addresses as: "Name1" <address1>;"Name2" <address2>...
41 * @param recipients Recipients to build address line from.
42 * @return Formatted addresses.
44 std::string formatAddressLine(const Api::Recipients& recipients);
47 * Extracts bare e-mail address.
48 * @param address Address to strip.
49 * @return E-mail address.
51 std::string stripAddress(const std::string& address);
54 * Extracts recipients bare e-mail addresses.
55 * @param addressLine Address line to split and strip.
58 Api::Recipients stripAddressLine(const std::string& addressLine);