<refentry id="libtracker-module-Metadata-Object">
<refmeta>
<refentrytitle role="top_of_page" id="libtracker-module-Metadata-Object.top_of_page">Metadata Object</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBTRACKER-MODULE Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Metadata Object</refname>
<refpurpose>Object used to exchange metadata information between the modules and Tracker indexer</refpurpose>
</refnamediv>

<refsynopsisdiv id="libtracker-module-Metadata-Object.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="TrackerModuleMetadata"/>
<synopsis>

#include &lt;libtracker-module/tracker-module-metadata.h&gt;

typedef             <link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link>;
<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> * <link linkend="tracker-module-metadata-new">tracker_module_metadata_new</link>     (void);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-clear-field">tracker_module_metadata_clear_field</link> (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name);
<link linkend="gboolean">gboolean</link>            <link linkend="tracker-module-metadata-add-take-string">tracker_module_metadata_add_take_string</link>
                                                        (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gchar">gchar</link> *value);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-add-string">tracker_module_metadata_add_string</link>  (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         const <link linkend="gchar">gchar</link> *value);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-add-int">tracker_module_metadata_add_int</link>     (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gint">gint</link> value);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-add-uint">tracker_module_metadata_add_uint</link>    (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="guint">guint</link> value);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-add-double">tracker_module_metadata_add_double</link>  (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gdouble">gdouble</link> value);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-add-float">tracker_module_metadata_add_float</link>   (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gfloat">gfloat</link> value);
<link linkend="void">void</link>                <link linkend="tracker-module-metadata-add-date">tracker_module_metadata_add_date</link>    (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="time-t">time_t</link> value);
</synopsis>
</refsynopsisdiv>

<refsect1 id="libtracker-module-Metadata-Object.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="TrackerDataMetadata">TrackerDataMetadata</link>
         +----TrackerModuleMetadata
</synopsis>
</refsect1>








<refsect1 id="libtracker-module-Metadata-Object.description" role="desc">
<title role="desc.title">Description</title>
<para>
TrackerModuleMetadata is used by the modules to provide
metadata information to Tracker indexer. Conceptually it's
a hash table, where you can pile up metadata. Depending
on the metadata type, it could store single (Email:Subject
for example) or multiple values (like Email:CC)
</para>
</refsect1>

<refsect1 id="libtracker-module-Metadata-Object.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="TrackerModuleMetadata" role="typedef">
<title>TrackerModuleMetadata</title>
<indexterm zone="TrackerModuleMetadata"><primary sortas="TrackerModuleMetadata">TrackerModuleMetadata</primary></indexterm><programlisting>typedef struct TrackerModuleMetadata TrackerModuleMetadata;           /* dummy typedef */
</programlisting>
<para>
Metadata object
</para></refsect2>
<refsect2 id="tracker-module-metadata-new" role="function">
<title>tracker_module_metadata_new ()</title>
<indexterm zone="tracker-module-metadata-new"><primary sortas="tracker_module_metadata_new">tracker_module_metadata_new</primary></indexterm><programlisting><link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> * tracker_module_metadata_new     (void);</programlisting>
<para>
Creates a new <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A newly created <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-clear-field" role="function">
<title>tracker_module_metadata_clear_field ()</title>
<indexterm zone="tracker-module-metadata-clear-field"><primary sortas="tracker_module_metadata_clear_field">tracker_module_metadata_clear_field</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_clear_field (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-take-string" role="function">
<title>tracker_module_metadata_add_take_string ()</title>
<indexterm zone="tracker-module-metadata-add-take-string"><primary sortas="tracker_module_metadata_add_take_string">tracker_module_metadata_add_take_string</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            tracker_module_metadata_add_take_string
                                                        (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gchar">gchar</link> *value);</programlisting>
<para>
Adds a new metadata element as a string into <parameter>metadata</parameter>.
For ontology fields that can take several values, this
function will allow adding several elements to the same
field name.
</para>
<para>
If the function returns <link linkend="TRUE--CAPS"><type>TRUE</type></link>, <parameter>metadata</parameter> will take
ownership on <parameter>value</parameter>, else you are responsible of
freeing it.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><type>TRUE</type></link> if the value was added successfully.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-string" role="function">
<title>tracker_module_metadata_add_string ()</title>
<indexterm zone="tracker-module-metadata-add-string"><primary sortas="tracker_module_metadata_add_string">tracker_module_metadata_add_string</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_add_string  (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         const <link linkend="gchar">gchar</link> *value);</programlisting>
<para>
Adds a new metadata element as a string into <parameter>metadata</parameter>.
see <link linkend="tracker-module-metadata-add-take-string"><function>tracker_module_metadata_add_take_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-int" role="function">
<title>tracker_module_metadata_add_int ()</title>
<indexterm zone="tracker-module-metadata-add-int"><primary sortas="tracker_module_metadata_add_int">tracker_module_metadata_add_int</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_add_int     (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gint">gint</link> value);</programlisting>
<para>
Adds a new metadata element as a integer into <parameter>metadata</parameter>.
see <link linkend="tracker-module-metadata-add-take-string"><function>tracker_module_metadata_add_take_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-uint" role="function">
<title>tracker_module_metadata_add_uint ()</title>
<indexterm zone="tracker-module-metadata-add-uint"><primary sortas="tracker_module_metadata_add_uint">tracker_module_metadata_add_uint</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_add_uint    (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="guint">guint</link> value);</programlisting>
<para>
Adds a new metadata element as an unsigned integer into <parameter>metadata</parameter>.
see <link linkend="tracker-module-metadata-add-take-string"><function>tracker_module_metadata_add_take_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-double" role="function">
<title>tracker_module_metadata_add_double ()</title>
<indexterm zone="tracker-module-metadata-add-double"><primary sortas="tracker_module_metadata_add_double">tracker_module_metadata_add_double</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_add_double  (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gdouble">gdouble</link> value);</programlisting>
<para>
Adds a new metadata element as a double into <parameter>metadata</parameter>.
see <link linkend="tracker-module-metadata-add-take-string"><function>tracker_module_metadata_add_take_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-float" role="function">
<title>tracker_module_metadata_add_float ()</title>
<indexterm zone="tracker-module-metadata-add-float"><primary sortas="tracker_module_metadata_add_float">tracker_module_metadata_add_float</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_add_float   (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="gfloat">gfloat</link> value);</programlisting>
<para>
Adds a new metadata element as a float into <parameter>metadata</parameter>.
see <link linkend="tracker-module-metadata-add-take-string"><function>tracker_module_metadata_add_take_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-module-metadata-add-date" role="function">
<title>tracker_module_metadata_add_date ()</title>
<indexterm zone="tracker-module-metadata-add-date"><primary sortas="tracker_module_metadata_add_date">tracker_module_metadata_add_date</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_module_metadata_add_date    (<link linkend="TrackerModuleMetadata">TrackerModuleMetadata</link> *metadata,
                                                         const <link linkend="gchar">gchar</link> *field_name,
                                                         <link linkend="time-t">time_t</link> value);</programlisting>
<para>
Adds a new metadata element as a time_t into <parameter>metadata</parameter>.
see <link linkend="tracker-module-metadata-add-take-string"><function>tracker_module_metadata_add_take_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>metadata</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="TrackerModuleMetadata"><type>TrackerModuleMetadata</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>field_name</parameter>&#160;:</term>
<listitem><simpara> Field name for the metadata to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> Value for the metadata
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1 id="libtracker-module-Metadata-Object.see-also">
<title>See Also</title>
<para>
<link linkend="tracker-module-file-get-metadata"><function>tracker_module_file_get_metadata()</function></link>
</para>
</refsect1>

</refentry>
