<refentry id="GMimeContentType">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeContentType.top_of_page">GMimeContentType</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeContentType</refname>
<refpurpose>Content-Type fields</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMimeContentType.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>                    <link linkend="GMimeContentType-struct">GMimeContentType</link>;
<link linkend="GMimeContentType"><returnvalue>GMimeContentType</returnvalue></link> *  <link linkend="g-mime-content-type-new">g_mime_content_type_new</link>             (<parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);
<link linkend="GMimeContentType"><returnvalue>GMimeContentType</returnvalue></link> *  <link linkend="g-mime-content-type-new-from-string">g_mime_content_type_new_from_string</link> (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-content-type-to-string">g_mime_content_type_to_string</link>       (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-content-type-is-type">g_mime_content_type_is_type</link>         (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-content-type-get-media-type">g_mime_content_type_get_media_type</link>  (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-content-type-set-media-type">g_mime_content_type_set_media_type</link>  (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *type</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-content-type-get-media-subtype">g_mime_content_type_get_media_subtype</link>
                                                        (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-content-type-set-media-subtype">g_mime_content_type_set_media_subtype</link>
                                                        (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);
const <link linkend="GMimeParam"><returnvalue>GMimeParam</returnvalue></link> *  <link linkend="g-mime-content-type-get-params">g_mime_content_type_get_params</link>      (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-content-type-set-params">g_mime_content_type_set_params</link>      (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter><link linkend="GMimeParam"><type>GMimeParam</type></link> *params</parameter>);
const <link linkend="char"><returnvalue>char</returnvalue></link> *        <link linkend="g-mime-content-type-get-parameter">g_mime_content_type_get_parameter</link>   (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-content-type-set-parameter">g_mime_content_type_set_parameter</link>   (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeContentType.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GMimeContentType
</synopsis>
</refsect1>

<refsect1 id="GMimeContentType.description" role="desc">
<title role="desc.title">Description</title>
<para>
A <link linkend="GMimeContentType"><type>GMimeContentType</type></link> represents the pre-parsed contents of a
Content-Type header field.
</para>
</refsect1>
<refsect1 id="GMimeContentType.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeContentType-struct" role="struct">
<title>GMimeContentType</title>
<indexterm zone="GMimeContentType-struct"><primary>GMimeContentType</primary></indexterm>
<programlisting>typedef struct _GMimeContentType GMimeContentType;</programlisting>
<para>
A data structure representing a Content-Type.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-new" role="function">
<title>g_mime_content_type_new ()</title>
<indexterm zone="g-mime-content-type-new"><primary>g_mime_content_type_new</primary></indexterm>
<programlisting><link linkend="GMimeContentType"><returnvalue>GMimeContentType</returnvalue></link> *  g_mime_content_type_new             (<parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);</programlisting>
<para>
Creates a Content-Type object with type <parameter>type</parameter> and subtype <parameter>subtype</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>MIME type (or <link linkend="NULL:CAPS"><literal>NULL</literal></link> for "text")
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subtype</parameter>&#160;:</term>
<listitem><simpara>MIME subtype (or <link linkend="NULL:CAPS"><literal>NULL</literal></link> for "plain")
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-new-from-string" role="function">
<title>g_mime_content_type_new_from_string ()</title>
<indexterm zone="g-mime-content-type-new-from-string"><primary>g_mime_content_type_new_from_string</primary></indexterm>
<programlisting><link linkend="GMimeContentType"><returnvalue>GMimeContentType</returnvalue></link> *  g_mime_content_type_new_from_string (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<para>
Constructs a new Content-Type object based on the input string.
</para><variablelist role="params">
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>input string containing a content-type (and params)
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object based on the input string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-to-string" role="function">
<title>g_mime_content_type_to_string ()</title>
<indexterm zone="g-mime-content-type-to-string"><primary>g_mime_content_type_to_string</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_content_type_to_string       (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);</programlisting>
<para>
Allocates a string buffer containing the type and subtype defined
by the <parameter>mime_type</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an allocated string containing the type and subtype of the
content-type in the format: type/subtype.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-is-type" role="function">
<title>g_mime_content_type_is_type ()</title>
<indexterm zone="g-mime-content-type-is-type"><primary>g_mime_content_type_is_type</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_content_type_is_type         (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);</programlisting>
<para>
Compares the given type and subtype with that of the given mime
type object.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>MIME type to compare against
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subtype</parameter>&#160;:</term>
<listitem><simpara>MIME subtype to compare against
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if the MIME types match or FALSE otherwise. You may
use "*" in place of <parameter>type</parameter> and/or <parameter>subtype</parameter> as a wilcard.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-get-media-type" role="function">
<title>g_mime_content_type_get_media_type ()</title>
<indexterm zone="g-mime-content-type-get-media-type"><primary>g_mime_content_type_get_media_type</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_content_type_get_media_type  (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);</programlisting>
<para>
Gets the Content-Type's media type.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the Content-Type's media type.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-set-media-type" role="function">
<title>g_mime_content_type_set_media_type ()</title>
<indexterm zone="g-mime-content-type-set-media-type"><primary>g_mime_content_type_set_media_type</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_content_type_set_media_type  (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *type</parameter>);</programlisting>
<para>
Sets the Content-Type's media type.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>media type
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-get-media-subtype" role="function">
<title>g_mime_content_type_get_media_subtype ()</title>
<indexterm zone="g-mime-content-type-get-media-subtype"><primary>g_mime_content_type_get_media_subtype</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_content_type_get_media_subtype
                                                        (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);</programlisting>
<para>
Gets the Content-Type's media sub-type.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the Content-Type's media sub-type.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-set-media-subtype" role="function">
<title>g_mime_content_type_set_media_subtype ()</title>
<indexterm zone="g-mime-content-type-set-media-subtype"><primary>g_mime_content_type_set_media_subtype</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_content_type_set_media_subtype
                                                        (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *subtype</parameter>);</programlisting>
<para>
Sets the Content-Type's media subtype.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>subtype</parameter>&#160;:</term>
<listitem><simpara>media subtype
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-get-params" role="function">
<title>g_mime_content_type_get_params ()</title>
<indexterm zone="g-mime-content-type-get-params"><primary>g_mime_content_type_get_params</primary></indexterm>
<programlisting>const <link linkend="GMimeParam"><returnvalue>GMimeParam</returnvalue></link> *  g_mime_content_type_get_params      (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>);</programlisting>
<para>
Gets the Content-Type's parameter list.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the Content-Type's parameter list.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-set-params" role="function">
<title>g_mime_content_type_set_params ()</title>
<indexterm zone="g-mime-content-type-set-params"><primary>g_mime_content_type_set_params</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_content_type_set_params      (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter><link linkend="GMimeParam"><type>GMimeParam</type></link> *params</parameter>);</programlisting>
<para>
Sets the Content-Type's parameter list.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>params</parameter>&#160;:</term>
<listitem><simpara>a list of <link linkend="GMimeParam"><type>GMimeParam</type></link> objects
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-get-parameter" role="function">
<title>g_mime_content_type_get_parameter ()</title>
<indexterm zone="g-mime-content-type-get-parameter"><primary>g_mime_content_type_get_parameter</primary></indexterm>
<programlisting>const <link linkend="char"><returnvalue>char</returnvalue></link> *        g_mime_content_type_get_parameter   (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>);</programlisting>
<para>
Gets the parameter value specified by <parameter>attribute</parameter> if it's available.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeContentType"><type>GMimeContentType</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attribute</parameter>&#160;:</term>
<listitem><simpara>parameter name (aka attribute)
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a const pointer to the paramer value specified by
<parameter>attribute</parameter> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-content-type-set-parameter" role="function">
<title>g_mime_content_type_set_parameter ()</title>
<indexterm zone="g-mime-content-type-set-parameter"><primary>g_mime_content_type_set_parameter</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_content_type_set_parameter   (<parameter><link linkend="GMimeContentType"><type>GMimeContentType</type></link> *mime_type</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *attribute</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *value</parameter>);</programlisting>
<para>
Sets a parameter on the Content-Type.
</para><variablelist role="params">
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>MIME Content-Type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attribute</parameter>&#160;:</term>
<listitem><simpara>parameter name (aka attribute)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>parameter value
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
