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 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
21 #ifndef TIZEN_MESSAGING_EMAILUTILS_H_
22 #define TIZEN_MESSAGING_EMAILUTILS_H_
26 #include <API/Messaging/Recipient.h>
32 namespace EmailUtils {
34 * Formats address as: "Name" <address>.
35 * @param address E-mail address.
36 * @param name Name, omitted if empty.
37 * @return Formatted address.
39 std::string formatAddress(const std::string& address,
40 const std::string& name = std::string());
43 * Formats multiple addresses as: "Name1" <address1>;"Name2" <address2>...
44 * @param recipients Recipients to build address line from.
45 * @return Formatted addresses.
47 std::string formatAddressLine(const Api::Messaging::Recipients& recipients);
50 * Extracts bare e-mail address.
51 * @param address Address to strip.
52 * @return E-mail address.
54 std::string stripAddress(const std::string& address);
57 * Extracts recipients bare e-mail addresses.
58 * @param addressLine Address line to split and strip.
61 Api::Messaging::Recipients stripAddressLine(const std::string& addressLine);