<?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="GnomeDesktopThumbnailFactory">
<refmeta>
<refentrytitle role="top_of_page" id="GnomeDesktopThumbnailFactory.top_of_page">GnomeDesktopThumbnailFactory</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GNOME-DESKTOP3 Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GnomeDesktopThumbnailFactory</refname>
<refpurpose></refpurpose>
</refnamediv>

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

<synopsis>
#include &lt;libgnomeui/gnome-thumbnail.h&gt;

                    <link linkend="GnomeDesktopThumbnailFactory-struct">GnomeDesktopThumbnailFactory</link>;
enum                <link linkend="GnomeDesktopThumbnailSize">GnomeDesktopThumbnailSize</link>;
<link linkend="GnomeDesktopThumbnailFactory"><returnvalue>GnomeDesktopThumbnailFactory</returnvalue></link> * <link linkend="gnome-desktop-thumbnail-factory-new">gnome_desktop_thumbnail_factory_new</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailSize"><type>GnomeDesktopThumbnailSize</type></link> size</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="gnome-desktop-thumbnail-factory-lookup">gnome_desktop_thumbnail_factory_lookup</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gnome-desktop-thumbnail-factory-has-valid-failed-thumbnail">gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gnome-desktop-thumbnail-factory-can-thumbnail">gnome_desktop_thumbnail_factory_can_thumbnail</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *mime_type</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);
<link linkend="GdkPixbuf"><returnvalue>GdkPixbuf</returnvalue></link> *         <link linkend="gnome-desktop-thumbnail-factory-generate-thumbnail">gnome_desktop_thumbnail_factory_generate_thumbnail</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *mime_type</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gnome-desktop-thumbnail-factory-save-thumbnail">gnome_desktop_thumbnail_factory_save_thumbnail</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter><link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> *thumbnail</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> original_mtime</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gnome-desktop-thumbnail-factory-create-failed-thumbnail">gnome_desktop_thumbnail_factory_create_failed_thumbnail</link>
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GnomeDesktopThumbnailFactory.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GnomeDesktopThumbnailFactory
</synopsis>
</refsect1>

<refsect1 id="GnomeDesktopThumbnailFactory.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>
<refsect1 id="GnomeDesktopThumbnailFactory.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GnomeDesktopThumbnailFactory-struct" role="struct">
<title>GnomeDesktopThumbnailFactory</title>
<indexterm zone="GnomeDesktopThumbnailFactory-struct"><primary>GnomeDesktopThumbnailFactory</primary></indexterm>
<programlisting>typedef struct _GnomeDesktopThumbnailFactory GnomeDesktopThumbnailFactory;</programlisting>
<para>
</para></refsect2>
<refsect2 id="GnomeDesktopThumbnailSize" role="enum">
<title>enum GnomeDesktopThumbnailSize</title>
<indexterm zone="GnomeDesktopThumbnailSize"><primary>GnomeDesktopThumbnailSize</primary></indexterm>
<programlisting>typedef enum {
  GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL,
  GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE
} GnomeDesktopThumbnailSize;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-new" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_new ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-new" role="2.2"><primary>gnome_desktop_thumbnail_factory_new</primary></indexterm>
<programlisting><link linkend="GnomeDesktopThumbnailFactory"><returnvalue>GnomeDesktopThumbnailFactory</returnvalue></link> * gnome_desktop_thumbnail_factory_new
                                                        (<parameter><link linkend="GnomeDesktopThumbnailSize"><type>GnomeDesktopThumbnailSize</type></link> size</parameter>);</programlisting>
<para>
Creates a new <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>.
</para>
<para>
This function must be called on the main thread.
</para><variablelist role="params">
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>The thumbnail size to use
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-lookup" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_lookup ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-lookup" role="2.2"><primary>gnome_desktop_thumbnail_factory_lookup</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              gnome_desktop_thumbnail_factory_lookup
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);</programlisting>
<para>
Tries to locate an existing thumbnail for the file specified.
</para>
<para>
Usage of this function is threadsafe.
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara>the mtime of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The absolute path of the thumbnail, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none exist.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-has-valid-failed-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-has-valid-failed-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);</programlisting>
<para>
Tries to locate an failed thumbnail for the file specified. Writing
and looking for failed thumbnails is important to avoid to try to
thumbnail e.g. broken images several times.
</para>
<para>
Usage of this function is threadsafe.
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara>the mtime of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if there is a failed thumbnail for the file.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-can-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_can_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-can-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_can_thumbnail</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gnome_desktop_thumbnail_factory_can_thumbnail
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *mime_type</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);</programlisting>
<para>
Returns TRUE if this GnomeIconFactory can (at least try) to thumbnail
this file. Thumbnails or files with failed thumbnails won't be thumbnailed.
</para>
<para>
Usage of this function is threadsafe.
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>the mime type of the file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara>the mtime of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if the file can be thumbnailed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-generate-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_generate_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-generate-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_generate_thumbnail</primary></indexterm>
<programlisting><link linkend="GdkPixbuf"><returnvalue>GdkPixbuf</returnvalue></link> *         gnome_desktop_thumbnail_factory_generate_thumbnail
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *mime_type</parameter>);</programlisting>
<para>
Tries to generate a thumbnail for the specified file. If it succeeds
it returns a pixbuf that can be used as a thumbnail.
</para>
<para>
Usage of this function is threadsafe.
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara>the mime type of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> thumbnail pixbuf if thumbnailing succeeded, <link linkend="NULL:CAPS"><literal>NULL</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-save-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_save_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-save-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_save_thumbnail</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gnome_desktop_thumbnail_factory_save_thumbnail
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter><link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> *thumbnail</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> original_mtime</parameter>);</programlisting>
<para>
Saves <parameter>thumbnail</parameter> at the right place. If the save fails a
failed thumbnail is written.
</para>
<para>
Usage of this function is threadsafe.
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>thumbnail</parameter>&#160;:</term>
<listitem><simpara>the thumbnail as a pixbuf 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>original_mtime</parameter>&#160;:</term>
<listitem><simpara>the modification time of the original file 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-create-failed-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_create_failed_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-create-failed-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_create_failed_thumbnail</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gnome_desktop_thumbnail_factory_create_failed_thumbnail
                                                        (<parameter><link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link> *factory</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *uri</parameter>,
                                                         <parameter><link linkend="time-t"><type>time_t</type></link> mtime</parameter>);</programlisting>
<para>
Creates a failed thumbnail for the file so that we don't try
to re-thumbnail the file later.
</para>
<para>
Usage of this function is threadsafe.
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara>the modification time of the file
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>

</refsect1>

</refentry>
