1 /* Copyright (c) 2006, Nokia Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Nokia Corporation nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 /* modest-text-utils.h */
33 #ifndef __MODEST_TEXT_UTILS_H__
34 #define __MODEST_TEXT_UTILS_H__
39 * modest_text_utils_quote:
40 * @buf: a string which contains the message to quote
41 * @from: the sender of the original message
42 * @sent_date: sent date/time of the original message
43 * @limit: specifies the maximum characters per line in the quoted text
45 * quote an existing message
47 * Returns: a newly allocated string containing the quoted message
49 gchar* modest_text_utils_quote(const gchar *buf, const gchar *from,
50 const time_t sent_date, const int limit);
54 * modest_text_utils_derived_subject:
55 * @subject: a string which contains the original subject
56 * @prefix: the prefix for the new subject (such as 'Re:' or 'Fwd:')
58 * create a 'derived' subject line for eg. replies and forwards
60 * Returns: a newly allocated string containing the resulting subject
62 gchar* modest_text_utils_derived_subject (const gchar *subject, const gchar* prefix);
66 * modest_text_utils_cited_text:
67 * @from: sender of the message
68 * @sent_date: the sent date of the original message
69 * @text: the text of the original message
71 * cite the text in a message
73 * Returns: a newly allocated string containing the cited text
75 gchar* modest_text_utils_cited_text (const gchar *from,
80 * modest_text_utils_inlined_text
81 * @from: the sender of the original message
82 * @sent_date: sent date/time of the original message
83 * @to: sent date/time of the original message
84 * @subject: sent date/time of the original message
85 * @text: sent date/time of the original message
87 * creates a new string with the "Original message" text prepended to
88 * the text passed as argument and some data of the header
90 * Returns: a newly allocated string containing the quoted message
92 gchar* modest_text_utils_inlined_text (const gchar *from,
99 * modest_text_utils_remove_address
100 * @address_list: string with a comma-separated list of email addresses
101 * @address: an specific e-mail address
103 * remove a specific address from a list of email addresses
105 * Returns: a newly allocated string containing the new list
107 gchar* modest_text_utils_remove_address (const gchar *address_list,
108 const gchar *address);
111 * modest_text_utils_convert_to_html:
112 * @txt: a string which contains the message to quote
114 * convert plain text (utf8) into html
116 * Returns: a newly allocated string containing the html
118 gchar* modest_text_utils_convert_to_html (const gchar *data);
122 * modest_text_utils_strftime:
128 * this is just an alias for strftime(3), so we can use that without
129 * getting warning from gcc
131 * Returns: a formatted string of max length @max in @s
133 size_t modest_text_utils_strftime(char *s, size_t max, const char *fmt, const struct tm *tm);
136 #endif /* __MODEST_TEXT_UTILS_H__ */