2f5d86c47ad5767374722f5940ada33a76165fc9
[framework/web/wrt-plugins-common.git] / src / modules / tizen / Messaging / EmailUtils.h
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  * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
18  */
19
20 #ifndef WAC_MESSAGING_EMAILUTILS_H_
21 #define WAC_MESSAGING_EMAILUTILS_H_
22
23 #include <string>
24
25 #include <API/Messaging/Recipient.h>
26
27 namespace WrtDeviceApis {
28 namespace Messaging {
29 namespace EmailUtils {
30 /**
31  * Formats address as: "Name" <address>.
32  * @param address E-mail address.
33  * @param name Name, omitted if empty.
34  * @return Formatted address.
35  */
36 std::string formatAddress(const std::string& address,
37         const std::string& name = std::string());
38
39 /**
40  * Formats multiple addresses as: "Name1" <address1>;"Name2" <address2>...
41  * @param recipients Recipients to build address line from.
42  * @return Formatted addresses.
43  */
44 std::string formatAddressLine(const Api::Recipients& recipients);
45
46 /**
47  * Extracts bare e-mail address.
48  * @param address Address to strip.
49  * @return E-mail address.
50  */
51 std::string stripAddress(const std::string& address);
52
53 /**
54  * Extracts recipients bare e-mail addresses.
55  * @param addressLine Address line to split and strip.
56  * @return Recipients.
57  */
58 Api::Recipients stripAddressLine(const std::string& addressLine);
59 }
60 }
61 }
62
63 #endif