<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<refentry id="zeitgeist-2.0-mimetype">
<refmeta>
<refentrytitle role="top_of_page" id="zeitgeist-2.0-mimetype.top_of_page">mimetype</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  ZEITGEIST-2.0 Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>mimetype</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="zeitgeist-2.0-mimetype.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis><link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="zeitgeist-register-mimetype">zeitgeist_register_mimetype</link>         (<parameter>const <link linkend="gchar"><type>gchar</type></link> *mimetype</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *interpretation_uri</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="zeitgeist-register-mimetype-regex">zeitgeist_register_mimetype_regex</link>   (<parameter>const <link linkend="gchar"><type>gchar</type></link> *mimetype_regex</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *interpretation_uri</parameter>);
const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="zeitgeist-interpretation-for-mimetype">zeitgeist_interpretation_for_mimetype</link>
                                                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *mimetype</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="zeitgeist-register-uri-scheme">zeitgeist_register_uri_scheme</link>       (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_scheme</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *manifestation_type</parameter>);
const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       <link linkend="zeitgeist-manifestation-for-uri">zeitgeist_manifestation_for_uri</link>     (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>);
</synopsis>
</refsynopsisdiv>

<refsect1 id="zeitgeist-2.0-mimetype.description" role="desc">
<title role="desc.title">Description</title>

</refsect1>
<refsect1 id="zeitgeist-2.0-mimetype.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="zeitgeist-register-mimetype" role="function">
<title>zeitgeist_register_mimetype ()</title>
<indexterm zone="zeitgeist-register-mimetype"><primary>zeitgeist_register_mimetype</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                zeitgeist_register_mimetype         (<parameter>const <link linkend="gchar"><type>gchar</type></link> *mimetype</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *interpretation_uri</parameter>);</programlisting>
<para>
zeitgeist_register_mimetype:
</para>
<para>
<para>Associate a MIME-type with a given interpretation type. Registered MIME-types can be looked up with <link linkend="zeitgeist-interpretation-for-mimetype"><function>zeitgeist_interpretation_for_mimetype()</function></link>.</para><para>You can register a regular expression as mimetype if instead of this function you invoke <link linkend="zeitgeist-register-mimetype-regex"><function>zeitgeist_register_mimetype_regex()</function></link>.</para><para>MIME-types are first looked up by their exact name and then if none is found the regular expressions will be checked as fallbacks.</para><para>This library will install a wide range a common mimetypes for you, so unless you have very specific needs you will normally not have to call this function.</para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mimetype</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A MIME-type string. Eg. <emphasis>text/plain</emphasis>. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
<varlistentry><term><parameter>interpretation_uri</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A URI defining the subject interpretation type to associate with &quot;mimetype&quot;. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-register-mimetype-regex" role="function">
<title>zeitgeist_register_mimetype_regex ()</title>
<indexterm zone="zeitgeist-register-mimetype-regex"><primary>zeitgeist_register_mimetype_regex</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                zeitgeist_register_mimetype_regex   (<parameter>const <link linkend="gchar"><type>gchar</type></link> *mimetype_regex</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *interpretation_uri</parameter>);</programlisting>
<para>
zeitgeist_register_mimetype_regex:
</para>
<para>
<para>Associate a range of MIME-types with a given interpretation type. Registered MIME-types can be looked up with <link linkend="zeitgeist-interpretation-for-mimetype"><function>zeitgeist_interpretation_for_mimetype()</function></link>.</para><para>If you only need to register one specific MIME-type, it is more efficient to use <link linkend="zeitgeist-register-mimetype"><function>zeitgeist_register_mimetype()</function></link> instead of this function.</para><para>MIME-types are first looked up by their exact name and then if none is found the regular expressions will be checked as fallbacks.</para><para>This library will install a wide range a common mimetypes for you, so unless you have very specific needs you will normally not have to call this function.</para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mimetype_regex</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A regular expression matching a certain range of mimetypes. Eg. <emphasis>text/.* </emphasis> to match all <emphasis>text</emphasis> subtypes. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
<varlistentry><term><parameter>interpretation_uri</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A URI defining the subject interpretation type to associate with the matched MIME-types. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-interpretation-for-mimetype" role="function">
<title>zeitgeist_interpretation_for_mimetype ()</title>
<indexterm zone="zeitgeist-interpretation-for-mimetype"><primary>zeitgeist_interpretation_for_mimetype</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       zeitgeist_interpretation_for_mimetype
                                                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *mimetype</parameter>);</programlisting>
<para>
zeitgeist_interpretation_for_mimetype:
</para>
<para>
<para>Look up the subject interpretation type associated with <parameter>mimetype</parameter>.</para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mimetype</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A MIME-type string. Eg. <emphasis>text/plain</emphasis>. <emphasis role="annotation">[<acronym>in</acronym>][<acronym>allow-none</acronym>]</emphasis></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>A URI defining the subject interpretation type associated with &quot;mimetype&quot; or <link linkend="NULL:CAPS"><literal>NULL</literal></link> in case &quot;mimetype&quot; is unknown. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-register-uri-scheme" role="function">
<title>zeitgeist_register_uri_scheme ()</title>
<indexterm zone="zeitgeist-register-uri-scheme"><primary>zeitgeist_register_uri_scheme</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                zeitgeist_register_uri_scheme       (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri_scheme</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *manifestation_type</parameter>);</programlisting>
<para>
zeitgeist_register_uri_scheme:
</para>
<para>
<para>Associate a URI scheme with a given subject manifestation type. You can find the manifestation type of a given URI by passing it to <link linkend="zeitgeist-manifestation-for-uri"><function>zeitgeist_manifestation_for_uri()</function></link>.</para><para>This library will install a range a common URI schemes for you, so unless you have very specific needs you will normally not have to call this function.</para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri_scheme</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A URI scheme such as <emphasis>http:\/\</emphasis>/. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
<varlistentry><term><parameter>manifestation_type</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  A URI defining the subject manifestation type to associate with &quot;uri_scheme&quot;. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="zeitgeist-manifestation-for-uri" role="function">
<title>zeitgeist_manifestation_for_uri ()</title>
<indexterm zone="zeitgeist-manifestation-for-uri"><primary>zeitgeist_manifestation_for_uri</primary></indexterm>
<programlisting>const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> *       zeitgeist_manifestation_for_uri     (<parameter>const <link linkend="gchar"><type>gchar</type></link> *uri</parameter>);</programlisting>
<para>
zeitgeist_manifestation_for_uri
</para>
<para>
<para>Look up a subject manifestation type for a given URI. Eg. if you pass in <emphasis>file:\/\/\/tmp/foo.txt</emphasis> you will get back ZEITGEIST_NFO_FILE_DATA_OBJECT.</para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>the (null) instance</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>&nbsp;.  An URI. <emphasis role="annotation">[<acronym>in</acronym>]</emphasis></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>A subject manifestation type for <parameter>uri</parameter> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> in case no suitable manifestation type is known. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
