1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GMimeFilterBest</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GMime 2.6 Reference Manual">
8 <link rel="up" href="Filters.html" title="Stream Filters">
9 <link rel="prev" href="GMimeFilterBasic.html" title="GMimeFilterBasic">
10 <link rel="next" href="GMimeFilterCharset.html" title="GMimeFilterCharset">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="GMimeFilterBasic.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="Filters.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GMime 2.6 Reference Manual</th>
21 <td><a accesskey="n" href="GMimeFilterCharset.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GMimeFilterBest.synopsis" class="shortcut">Top</a>
26 <a href="#GMimeFilterBest.description" class="shortcut">Description</a>
28 <a href="#GMimeFilterBest.object-hierarchy" class="shortcut">Object Hierarchy</a>
31 <div class="refentry">
32 <a name="GMimeFilterBest"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
35 <h2><span class="refentrytitle"><a name="GMimeFilterBest.top_of_page"></a>GMimeFilterBest</span></h2>
36 <p>GMimeFilterBest — Determine the best charset/encoding to use for a stream</p>
38 <td valign="top" align="right"></td>
40 <div class="refsynopsisdiv">
41 <a name="GMimeFilterBest.synopsis"></a><h2>Synopsis</h2>
42 <pre class="synopsis">struct <a class="link" href="GMimeFilterBest.html#GMimeFilterBest-struct" title="struct GMimeFilterBest">GMimeFilterBest</a>;
43 enum <a class="link" href="GMimeFilterBest.html#GMimeFilterBestFlags" title="enum GMimeFilterBestFlags">GMimeFilterBestFlags</a>;
44 <a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="returnvalue">GMimeFilter</span></a> * <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-new" title="g_mime_filter_best_new ()">g_mime_filter_best_new</a> (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html#GMimeFilterBestFlags" title="enum GMimeFilterBestFlags"><span class="type">GMimeFilterBestFlags</span></a> flags</code></em>);
45 const <span class="returnvalue">char</span> * <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-charset" title="g_mime_filter_best_charset ()">g_mime_filter_best_charset</a> (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a> *best</code></em>);
46 <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a> <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-encoding" title="g_mime_filter_best_encoding ()">g_mime_filter_best_encoding</a> (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a> *best</code></em>,
47 <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint"><span class="type">GMimeEncodingConstraint</span></a> constraint</code></em>);
50 <div class="refsect1">
51 <a name="GMimeFilterBest.object-hierarchy"></a><h2>Object Hierarchy</h2>
52 <pre class="synopsis">
54 +----<a class="link" href="GMimeFilter.html" title="GMimeFilter">GMimeFilter</a>
58 <div class="refsect1">
59 <a name="GMimeFilterBest.description"></a><h2>Description</h2>
61 A <a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="type">GMimeFilter</span></a> which is meant to determine the best charset and/or
62 transfer encoding suitable for the stream which is filtered through
66 <div class="refsect1">
67 <a name="GMimeFilterBest.details"></a><h2>Details</h2>
68 <div class="refsect2">
69 <a name="GMimeFilterBest-struct"></a><h3>struct GMimeFilterBest</h3>
70 <pre class="programlisting">struct GMimeFilterBest;</pre>
72 A filter for calculating the best encoding and/or charset to encode
73 the data passed through it.
75 <div class="variablelist"><table border="0">
76 <col align="left" valign="top">
81 <div class="refsect2">
82 <a name="GMimeFilterBestFlags"></a><h3>enum GMimeFilterBestFlags</h3>
83 <pre class="programlisting">typedef enum {
84 GMIME_FILTER_BEST_CHARSET = (1 << 0),
85 GMIME_FILTER_BEST_ENCODING = (1 << 1)
86 } GMimeFilterBestFlags;
89 Bit flags to enable charset and/or encoding scanning to make
90 educated guesses as to what the best charset and/or encodings to
91 use for the content passed through the filter.
93 <div class="variablelist"><table border="0">
94 <col align="left" valign="top">
97 <td><p><a name="GMIME-FILTER-BEST-CHARSET:CAPS"></a><span class="term"><code class="literal">GMIME_FILTER_BEST_CHARSET</code></span></p></td>
98 <td>Enable best-charset detection.
102 <td><p><a name="GMIME-FILTER-BEST-ENCODING:CAPS"></a><span class="term"><code class="literal">GMIME_FILTER_BEST_ENCODING</code></span></p></td>
103 <td>Enable best-encoding detection.
110 <div class="refsect2">
111 <a name="g-mime-filter-best-new"></a><h3>g_mime_filter_best_new ()</h3>
112 <pre class="programlisting"><a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="returnvalue">GMimeFilter</span></a> * g_mime_filter_best_new (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html#GMimeFilterBestFlags" title="enum GMimeFilterBestFlags"><span class="type">GMimeFilterBestFlags</span></a> flags</code></em>);</pre>
114 Creates a new GMimeFilterBest filter. <em class="parameter"><code>flags</code></em> are used to determine
115 which information to keep statistics of. If the
116 <a class="link" href="GMimeFilterBest.html#GMIME-FILTER-BEST-CHARSET:CAPS"><span class="type">GMIME_FILTER_BEST_CHARSET</span></a> bit is set, the filter will be able to
117 compute the best charset for encoding the stream of data
118 filtered. If the <a class="link" href="GMimeFilterBest.html#GMIME-FILTER-BEST-ENCODING:CAPS"><span class="type">GMIME_FILTER_BEST_ENCODING</span></a> bit is set, the filter
119 will be able to compute the best Content-Transfer-Encoding for use
120 with the stream being filtered.
123 Note: In order for the <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-charset" title="g_mime_filter_best_charset ()"><code class="function">g_mime_filter_best_charset()</code></a> function to
124 work, the stream being filtered MUST already be encoded in UTF-8.
126 <div class="variablelist"><table border="0">
127 <col align="left" valign="top">
130 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
131 <td>filter flags</td>
134 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
135 <td>a new best filter with flags <em class="parameter"><code>flags</code></em>.</td>
141 <div class="refsect2">
142 <a name="g-mime-filter-best-charset"></a><h3>g_mime_filter_best_charset ()</h3>
143 <pre class="programlisting">const <span class="returnvalue">char</span> * g_mime_filter_best_charset (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a> *best</code></em>);</pre>
145 Calculates the best charset for encoding the stream filtered
146 through the <em class="parameter"><code>best</code></em> filter.
148 <div class="variablelist"><table border="0">
149 <col align="left" valign="top">
152 <td><p><span class="term"><em class="parameter"><code>best</code></em> :</span></p></td>
156 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
157 <td>a pointer to a string containing the name of the charset
158 best suited for the text filtered through <em class="parameter"><code>best</code></em>.</td>
164 <div class="refsect2">
165 <a name="g-mime-filter-best-encoding"></a><h3>g_mime_filter_best_encoding ()</h3>
166 <pre class="programlisting"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a> g_mime_filter_best_encoding (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a> *best</code></em>,
167 <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint"><span class="type">GMimeEncodingConstraint</span></a> constraint</code></em>);</pre>
169 Calculates the most efficient Content-Transfer-Encoding for the
170 stream filtered through <em class="parameter"><code>best</code></em> that fits within the encoding
171 <em class="parameter"><code>constraint</code></em>.
173 <div class="variablelist"><table border="0">
174 <col align="left" valign="top">
177 <td><p><span class="term"><em class="parameter"><code>best</code></em> :</span></p></td>
178 <td>a <a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a>
182 <td><p><span class="term"><em class="parameter"><code>constraint</code></em> :</span></p></td>
183 <td>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint"><span class="type">GMimeEncodingConstraint</span></a>
187 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
188 <td>the best encoding for the stream filtered by <em class="parameter"><code>best</code></em>.</td>
194 <div class="refsect1">
195 <a name="GMimeFilterBest.see-also"></a><h2>See Also</h2>
196 <a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="type">GMimeFilter</span></a>
201 Generated by GTK-Doc V1.18</div>