<refentry id="ThunarVfsJob">
<refmeta>
<refentrytitle>ThunarVfsJob</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>THUNAR-VFS Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>ThunarVfsJob</refname><refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>

<synopsis>

#include &lt;thunar-vfs/thunar-vfs.h&gt;


            <link linkend="ThunarVfsJob-struct">ThunarVfsJob</link>;
<link linkend="ThunarVfsJob">ThunarVfsJob</link>* <link linkend="thunar-vfs-job-launch">thunar_vfs_job_launch</link>         (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job);
<link linkend="void">void</link>        <link linkend="thunar-vfs-job-cancel">thunar_vfs_job_cancel</link>           (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job);
<link linkend="gboolean">gboolean</link>    <link linkend="thunar-vfs-job-cancelled">thunar_vfs_job_cancelled</link>        (const <link linkend="ThunarVfsJob">ThunarVfsJob</link> *job);
<link linkend="void">void</link>        <link linkend="thunar-vfs-job-emit-valist">thunar_vfs_job_emit_valist</link>      (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                             <link linkend="guint">guint</link> signal_id,
                                             <link linkend="GQuark">GQuark</link> signal_detail,
                                             <link linkend="va-list">va_list</link> var_args);
<link linkend="void">void</link>        <link linkend="thunar-vfs-job-emit">thunar_vfs_job_emit</link>             (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                             <link linkend="guint">guint</link> signal_id,
                                             <link linkend="GQuark">GQuark</link> signal_detail,
                                             ...);
<link linkend="void">void</link>        <link linkend="thunar-vfs-job-error">thunar_vfs_job_error</link>            (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                             <link linkend="GError">GError</link> *error);


</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</link>
   +----ThunarVfsJob
         +----<link linkend="ThunarVfsInteractiveJob">ThunarVfsInteractiveJob</link>
</synopsis>

</refsect1>






<refsect1>
<title>Signal Prototypes</title>
<synopsis>

&quot;<link linkend="ThunarVfsJob-error">error</link>&quot;     <link linkend="void">void</link>        user_function      (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                            <link linkend="gpointer">gpointer</link> error,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="ThunarVfsJob-finished">finished</link>&quot;  <link linkend="void">void</link>        user_function      (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                            <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsect1>


<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="ThunarVfsJob-struct"/>ThunarVfsJob</title>
<indexterm><primary>ThunarVfsJob</primary></indexterm><programlisting>typedef struct _ThunarVfsJob ThunarVfsJob;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-job-launch"/>thunar_vfs_job_launch ()</title>
<indexterm><primary>thunar_vfs_job_launch</primary></indexterm><programlisting><link linkend="ThunarVfsJob">ThunarVfsJob</link>* thunar_vfs_job_launch         (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job);</programlisting>
<para>
This functions schedules <parameter>job</parameter> to be run as soon
as possible, in a separate thread.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a pointer to <parameter>job</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-job-cancel"/>thunar_vfs_job_cancel ()</title>
<indexterm><primary>thunar_vfs_job_cancel</primary></indexterm><programlisting><link linkend="void">void</link>        thunar_vfs_job_cancel           (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job);</programlisting>
<para>
Attempts to cancel the operation currently
performed by <parameter>job</parameter>. Even after the cancellation
of <parameter>job</parameter>, it may still emit signals, so you
must take care of disconnecting all handlers
appropriately if you cannot handle signals
after cancellation.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-job-cancelled"/>thunar_vfs_job_cancelled ()</title>
<indexterm><primary>thunar_vfs_job_cancelled</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    thunar_vfs_job_cancelled        (const <link linkend="ThunarVfsJob">ThunarVfsJob</link> *job);</programlisting>
<para>
Checks whether <parameter>job</parameter> was previously cancelled
by a call to <link linkend="thunar-vfs-job-cancel"><function>thunar_vfs_job_cancel()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <literal>TRUE</literal> if <parameter>job</parameter> is cancelled.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-job-emit-valist"/>thunar_vfs_job_emit_valist ()</title>
<indexterm><primary>thunar_vfs_job_emit_valist</primary></indexterm><programlisting><link linkend="void">void</link>        thunar_vfs_job_emit_valist      (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                             <link linkend="guint">guint</link> signal_id,
                                             <link linkend="GQuark">GQuark</link> signal_detail,
                                             <link linkend="va-list">va_list</link> var_args);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_detail</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_args</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-job-emit"/>thunar_vfs_job_emit ()</title>
<indexterm><primary>thunar_vfs_job_emit</primary></indexterm><programlisting><link linkend="void">void</link>        thunar_vfs_job_emit             (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                             <link linkend="guint">guint</link> signal_id,
                                             <link linkend="GQuark">GQuark</link> signal_detail,
                                             ...);</programlisting>
<para>
Convenience wrapper for <link linkend="thunar-vfs-job-emit-valist"><function>thunar_vfs_job_emit_valist()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&nbsp;:</term>
<listitem><simpara> the id of the signal to emit on qjob.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_detail</parameter>&nbsp;:</term>
<listitem><simpara> the signal detail.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&nbsp;:</term>
<listitem><simpara> a list of parameters to be passed to the signal.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="thunar-vfs-job-error"/>thunar_vfs_job_error ()</title>
<indexterm><primary>thunar_vfs_job_error</primary></indexterm><programlisting><link linkend="void">void</link>        thunar_vfs_job_error            (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                             <link linkend="GError">GError</link> *error);</programlisting>
<para>
Emits the ::error signal on <parameter>job</parameter> with the given <parameter>error</parameter>. Whether
or not the <parameter>job</parameter> continues after emitting the error depends on
the particular implementation of <parameter>job</parameter>, but most jobs will
terminate instantly after emitting an error.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> describing the error cause.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

<refsect1>
<title>Signals</title>
<refsect2><title><anchor id="ThunarVfsJob-error"/>The &quot;error&quot; signal</title>
<programlisting><link linkend="void">void</link>        user_function                  (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                            <link linkend="gpointer">gpointer</link> error,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Emitted whenever an error occurs while executing the
<parameter>job</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> describing the cause.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2><title><anchor id="ThunarVfsJob-finished"/>The &quot;finished&quot; signal</title>
<programlisting><link linkend="void">void</link>        user_function                  (<link linkend="ThunarVfsJob">ThunarVfsJob</link> *job,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
This signal will be automatically emitted once the
<parameter>job</parameter> finishes its execution, no matter whether <parameter>job</parameter>
completed successfully or was cancelled by the
user.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="ThunarVfsJob"><type>ThunarVfsJob</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>



</refentry>
