<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="libedataserver-e-categories">
<refmeta>
<refentrytitle role="top_of_page" id="libedataserver-e-categories.top_of_page">e-categories</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBEDATASERVER Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>e-categories</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="libedataserver-e-categories.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
<link linkend="GList">GList</link>*              <link linkend="e-categories-get-list">e_categories_get_list</link>               (void);
<link linkend="void">void</link>                <link linkend="e-categories-add">e_categories_add</link>                    (const <link linkend="char">char</link> *category,
                                                         const <link linkend="char">char</link> *unused,
                                                         const <link linkend="char">char</link> *icon_file,
                                                         <link linkend="gboolean">gboolean</link> searchable);
<link linkend="void">void</link>                <link linkend="e-categories-remove">e_categories_remove</link>                 (const <link linkend="char">char</link> *category);
<link linkend="gboolean">gboolean</link>            <link linkend="e-categories-exist">e_categories_exist</link>                  (const <link linkend="char">char</link> *category);
const <link linkend="char">char</link>*         <link linkend="e-categories-get-color-for">e_categories_get_color_for</link>          (const <link linkend="char">char</link> *category);
<link linkend="void">void</link>                <link linkend="e-categories-set-color-for">e_categories_set_color_for</link>          (const <link linkend="char">char</link> *category,
                                                         const <link linkend="char">char</link> *color);
const <link linkend="char">char</link>*         <link linkend="e-categories-get-icon-file-for">e_categories_get_icon_file_for</link>      (const <link linkend="char">char</link> *category);
<link linkend="void">void</link>                <link linkend="e-categories-set-icon-file-for">e_categories_set_icon_file_for</link>      (const <link linkend="char">char</link> *category,
                                                         const <link linkend="char">char</link> *icon_file);
<link linkend="gboolean">gboolean</link>            <link linkend="e-categories-is-searchable">e_categories_is_searchable</link>          (const <link linkend="char">char</link> *category);
<link linkend="void">void</link>                <link linkend="e-categories-register-change-listener">e_categories_register_change_listener</link>
                                                        (<link linkend="GCallback">GCallback</link> listener,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="void">void</link>                <link linkend="e-categories-unregister-change-listener">e_categories_unregister_change_listener</link>
                                                        (<link linkend="GCallback">GCallback</link> listener,
                                                         <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsynopsisdiv>









<refsect1 id="libedataserver-e-categories.description" role="desc">
<title role="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 id="libedataserver-e-categories.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="e-categories-get-list" role="function">
<title>e_categories_get_list ()</title>
<indexterm zone="e-categories-get-list"><primary>e_categories_get_list</primary></indexterm><programlisting><link linkend="GList">GList</link>*              e_categories_get_list               (void);</programlisting>
<para>
Returns a sorted list of all the category names currently configured.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a sorted GList containing the names of the categories. The
list should be freed using g_list_free, but the names of the categories
should not be touched at all, they are internal strings.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-add" role="function">
<title>e_categories_add ()</title>
<indexterm zone="e-categories-add"><primary>e_categories_add</primary></indexterm><programlisting><link linkend="void">void</link>                e_categories_add                    (const <link linkend="char">char</link> *category,
                                                         const <link linkend="char">char</link> *unused,
                                                         const <link linkend="char">char</link> *icon_file,
                                                         <link linkend="gboolean">gboolean</link> searchable);</programlisting>
<para>
Adds a new category, with its corresponding icon, to the
configuration database.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> name of category to add.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>unused</parameter>&nbsp;:</term>
<listitem><simpara> DEPRECATED! associated color. DEPRECATED!
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>icon_file</parameter>&nbsp;:</term>
<listitem><simpara> full path of the icon associated to the category.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>searchable</parameter>&nbsp;:</term>
<listitem><simpara> whether the category can be used for searching in the GUI.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-remove" role="function">
<title>e_categories_remove ()</title>
<indexterm zone="e-categories-remove"><primary>e_categories_remove</primary></indexterm><programlisting><link linkend="void">void</link>                e_categories_remove                 (const <link linkend="char">char</link> *category);</programlisting>
<para>
Removes the given category from the configuration.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category to be removed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-exist" role="function">
<title>e_categories_exist ()</title>
<indexterm zone="e-categories-exist"><primary>e_categories_exist</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_categories_exist                  (const <link linkend="char">char</link> *category);</programlisting>
<para>
Checks whether the given category is available in the configuration.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category to be searched.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the category is available, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-get-color-for" role="function" condition="deprecated:">
<title>e_categories_get_color_for ()</title>
<indexterm zone="e-categories-get-color-for" role="deprecated"><primary>e_categories_get_color_for</primary></indexterm><programlisting>const <link linkend="char">char</link>*         e_categories_get_color_for          (const <link linkend="char">char</link> *category);</programlisting>
<warning><para><literal>e_categories_get_color_for</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Gets the color associated with the given category.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category to retrieve the color for.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a string representation of the color.

DEPRECATED!
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-set-color-for" role="function" condition="deprecated:">
<title>e_categories_set_color_for ()</title>
<indexterm zone="e-categories-set-color-for" role="deprecated"><primary>e_categories_set_color_for</primary></indexterm><programlisting><link linkend="void">void</link>                e_categories_set_color_for          (const <link linkend="char">char</link> *category,
                                                         const <link linkend="char">char</link> *color);</programlisting>
<warning><para><literal>e_categories_set_color_for</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Sets the color associated with the given category.
</para>
<para>
DEPRECATED!</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category to set the color for.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&nbsp;:</term>
<listitem><simpara> X color.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-get-icon-file-for" role="function">
<title>e_categories_get_icon_file_for ()</title>
<indexterm zone="e-categories-get-icon-file-for"><primary>e_categories_get_icon_file_for</primary></indexterm><programlisting>const <link linkend="char">char</link>*         e_categories_get_icon_file_for      (const <link linkend="char">char</link> *category);</programlisting>
<para>
Gets the icon file associated with the given category.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category to retrieve the icon file for.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> icon file name.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-set-icon-file-for" role="function">
<title>e_categories_set_icon_file_for ()</title>
<indexterm zone="e-categories-set-icon-file-for"><primary>e_categories_set_icon_file_for</primary></indexterm><programlisting><link linkend="void">void</link>                e_categories_set_icon_file_for      (const <link linkend="char">char</link> *category,
                                                         const <link linkend="char">char</link> *icon_file);</programlisting>
<para>
Sets the icon file associated with the given category.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category to set the icon file for.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>icon_file</parameter>&nbsp;:</term>
<listitem><simpara> icon file.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-is-searchable" role="function">
<title>e_categories_is_searchable ()</title>
<indexterm zone="e-categories-is-searchable"><primary>e_categories_is_searchable</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            e_categories_is_searchable          (const <link linkend="char">char</link> *category);</programlisting>
<para>
Gets whether the given calendar is to be used for searches in the GUI.
</para>
<para>
Return value; <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>% if the category is searchable, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>% if not.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>category</parameter>&nbsp;:</term>
<listitem><simpara> category name.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-register-change-listener" role="function">
<title>e_categories_register_change_listener ()</title>
<indexterm zone="e-categories-register-change-listener"><primary>e_categories_register_change_listener</primary></indexterm><programlisting><link linkend="void">void</link>                e_categories_register_change_listener
                                                        (<link linkend="GCallback">GCallback</link> listener,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Registers callback to be called on change of any category.
Pair listener and user_data is used to distinguish between listeners.
Listeners can be unregistered with <parameter>e_categories_unregister_change_listener</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>listener</parameter>&nbsp;:</term>
<listitem><simpara> the callback to be called on any category change.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara> used data passed to the <parameter>listener</parameter> when called.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="e-categories-unregister-change-listener" role="function">
<title>e_categories_unregister_change_listener ()</title>
<indexterm zone="e-categories-unregister-change-listener"><primary>e_categories_unregister_change_listener</primary></indexterm><programlisting><link linkend="void">void</link>                e_categories_unregister_change_listener
                                                        (<link linkend="GCallback">GCallback</link> listener,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Removes previously registered callback from the list of listeners on changes.
If it was not registered, then does nothing.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>listener</parameter>&nbsp;:</term>
<listitem><simpara> Callback to be removed.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara> User data as passed with call to <parameter>e_categories_register_change_listener</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
