1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
|
<?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="RhythmDBImportJob">
<refmeta>
<refentrytitle role="top_of_page" id="RhythmDBImportJob.top_of_page">RhythmDBImportJob</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>RHYTHMBOX Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>RhythmDBImportJob</refname>
<refpurpose>batch import job</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv id="RhythmDBImportJob.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="RhythmDBImportJob-struct">RhythmDBImportJob</link>;
<link linkend="RhythmDBImportJobClass">RhythmDBImportJobClass</link>;
<link linkend="RhythmDBImportJob">RhythmDBImportJob</link>* <link linkend="rhythmdb-import-job-new">rhythmdb_import_job_new</link> (<link linkend="RhythmDB">RhythmDB</link> *db,
<link linkend="RhythmDBEntryType">RhythmDBEntryType</link> entry_type,
<link linkend="RhythmDBEntryType">RhythmDBEntryType</link> ignore_type,
<link linkend="RhythmDBEntryType">RhythmDBEntryType</link> error_type);
<link linkend="void">void</link> <link linkend="rhythmdb-import-job-add-uri">rhythmdb_import_job_add_uri</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job,
const <link linkend="char">char</link> *uri);
<link linkend="void">void</link> <link linkend="rhythmdb-import-job-start">rhythmdb_import_job_start</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);
<link linkend="void">void</link> <link linkend="rhythmdb-import-job-cancel">rhythmdb_import_job_cancel</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);
<link linkend="gboolean">gboolean</link> <link linkend="rhythmdb-import-job-complete">rhythmdb_import_job_complete</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);
<link linkend="gboolean">gboolean</link> <link linkend="rhythmdb-import-job-scan-complete">rhythmdb_import_job_scan_complete</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);
<link linkend="int">int</link> <link linkend="rhythmdb-import-job-get-total">rhythmdb_import_job_get_total</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);
<link linkend="int">int</link> <link linkend="rhythmdb-import-job-get-imported">rhythmdb_import_job_get_imported</link> (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);
</synopsis>
</refsynopsisdiv>
<refsect1 id="RhythmDBImportJob.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
<link linkend="GObject">GObject</link>
+----RhythmDBImportJob
</synopsis>
</refsect1>
<refsect1 id="RhythmDBImportJob.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
"<link linkend="RhythmDBImportJob--db">db</link>" <link linkend="RhythmDB">RhythmDB</link>* : Read / Write / Construct Only
"<link linkend="RhythmDBImportJob--entry-type">entry-type</link>" <link linkend="RhythmDBEntryType">RhythmDBEntryType</link>* : Read / Write / Construct Only
"<link linkend="RhythmDBImportJob--error-type">error-type</link>" <link linkend="RhythmDBEntryType">RhythmDBEntryType</link>* : Read / Write / Construct Only
"<link linkend="RhythmDBImportJob--ignore-type">ignore-type</link>" <link linkend="RhythmDBEntryType">RhythmDBEntryType</link>* : Read / Write / Construct Only
</synopsis>
</refsect1>
<refsect1 id="RhythmDBImportJob.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
"<link linkend="RhythmDBImportJob-complete">complete</link>" : Run Last
"<link linkend="RhythmDBImportJob-entry-added">entry-added</link>" : Run Last
"<link linkend="RhythmDBImportJob-scan-complete">scan-complete</link>" : Run Last
"<link linkend="RhythmDBImportJob-status-changed">status-changed</link>" : Run Last
</synopsis>
</refsect1>
<refsect1 id="RhythmDBImportJob.description" role="desc">
<title role="desc.title">Description</title>
<para>
Tracks the addition to the database of files under a set of
directories, providing status information.
</para>
<para>
The entry types to use for the database entries added by the import
job are specified on creation.</para>
<para>
</para>
</refsect1>
<refsect1 id="RhythmDBImportJob.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="RhythmDBImportJob-struct" role="struct">
<title>RhythmDBImportJob</title>
<indexterm zone="RhythmDBImportJob-struct"><primary>RhythmDBImportJob</primary></indexterm><programlisting>typedef struct _RhythmDBImportJob RhythmDBImportJob;</programlisting>
<para>
</para></refsect2>
<refsect2 id="RhythmDBImportJobClass" role="struct">
<title>RhythmDBImportJobClass</title>
<indexterm zone="RhythmDBImportJobClass"><primary>RhythmDBImportJobClass</primary></indexterm><programlisting>typedef struct {
GObjectClass parent_class;
/* signals */
void (*entry_added) (RhythmDBImportJob *job, RhythmDBEntry *entry);
void (*status_changed) (RhythmDBImportJob *job, int total, int imported);
void (*scan_complete) (RhythmDBImportJob *job, int total);
void (*complete) (RhythmDBImportJob *job, int total);
} RhythmDBImportJobClass;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="rhythmdb-import-job-new" role="function">
<title>rhythmdb_import_job_new ()</title>
<indexterm zone="rhythmdb-import-job-new"><primary>rhythmdb_import_job_new</primary></indexterm><programlisting><link linkend="RhythmDBImportJob">RhythmDBImportJob</link>* rhythmdb_import_job_new (<link linkend="RhythmDB">RhythmDB</link> *db,
<link linkend="RhythmDBEntryType">RhythmDBEntryType</link> entry_type,
<link linkend="RhythmDBEntryType">RhythmDBEntryType</link> ignore_type,
<link linkend="RhythmDBEntryType">RhythmDBEntryType</link> error_type);</programlisting>
<para>
Creates a new import job with the specified entry types.
Before starting the job, the caller must add one or more
paths to import.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>db</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDB"><type>RhythmDB</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>entry_type</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBEntryType"><type>RhythmDBEntryType</type></link> to use for normal entries
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ignore_type</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBEntryType"><type>RhythmDBEntryType</type></link> to use for ignored files
(or RHYTHMDB_ENTRY_TYPE_INVALID to not create ignore entries)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error_type</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBEntryType"><type>RhythmDBEntryType</type></link> to use for import error
entries (or RHYTHMDB_ENTRY_TYPE_INVALID for none)
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> new <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link> object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-add-uri" role="function">
<title>rhythmdb_import_job_add_uri ()</title>
<indexterm zone="rhythmdb-import-job-add-uri"><primary>rhythmdb_import_job_add_uri</primary></indexterm><programlisting><link linkend="void">void</link> rhythmdb_import_job_add_uri (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job,
const <link linkend="char">char</link> *uri);</programlisting>
<para>
Adds a URI to import. All files under the specified
URI will be imported.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> a <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter> :</term>
<listitem><simpara> the URI to import
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-start" role="function">
<title>rhythmdb_import_job_start ()</title>
<indexterm zone="rhythmdb-import-job-start"><primary>rhythmdb_import_job_start</primary></indexterm><programlisting><link linkend="void">void</link> rhythmdb_import_job_start (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);</programlisting>
<para>
Starts the import job. After this method has been called,
no more URIs may be added to the import job. May only be
called once for a given import job.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-cancel" role="function">
<title>rhythmdb_import_job_cancel ()</title>
<indexterm zone="rhythmdb-import-job-cancel"><primary>rhythmdb_import_job_cancel</primary></indexterm><programlisting><link linkend="void">void</link> rhythmdb_import_job_cancel (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);</programlisting>
<para>
Cancels the import job. The job will cease as soon
as possible. More directories may be scanned and
more files may be imported before the job actually
ceases.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-complete" role="function">
<title>rhythmdb_import_job_complete ()</title>
<indexterm zone="rhythmdb-import-job-complete"><primary>rhythmdb_import_job_complete</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> rhythmdb_import_job_complete (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the import job is complete.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-scan-complete" role="function">
<title>rhythmdb_import_job_scan_complete ()</title>
<indexterm zone="rhythmdb-import-job-scan-complete"><primary>rhythmdb_import_job_scan_complete</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> rhythmdb_import_job_scan_complete (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE if the directory scan is complete
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-get-total" role="function">
<title>rhythmdb_import_job_get_total ()</title>
<indexterm zone="rhythmdb-import-job-get-total"><primary>rhythmdb_import_job_get_total</primary></indexterm><programlisting><link linkend="int">int</link> rhythmdb_import_job_get_total (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);</programlisting>
<para>
Returns the total number of files that will be processed by
this import job. This increases as the import directories are
scanned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the total number of files to be processed
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rhythmdb-import-job-get-imported" role="function">
<title>rhythmdb_import_job_get_imported ()</title>
<indexterm zone="rhythmdb-import-job-get-imported"><primary>rhythmdb_import_job_get_imported</primary></indexterm><programlisting><link linkend="int">int</link> rhythmdb_import_job_get_imported (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of files processed so far
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1 id="RhythmDBImportJob.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="RhythmDBImportJob--db"><title>The <literal>"db"</literal> property</title>
<indexterm zone="RhythmDBImportJob--db"><primary>RhythmDBImportJob:db</primary></indexterm><programlisting> "db" <link linkend="RhythmDB">RhythmDB</link>* : Read / Write / Construct Only</programlisting>
<para>RhythmDB object.</para></refsect2>
<refsect2 id="RhythmDBImportJob--entry-type"><title>The <literal>"entry-type"</literal> property</title>
<indexterm zone="RhythmDBImportJob--entry-type"><primary>RhythmDBImportJob:entry-type</primary></indexterm><programlisting> "entry-type" <link linkend="RhythmDBEntryType">RhythmDBEntryType</link>* : Read / Write / Construct Only</programlisting>
<para>Entry type to use for entries added by this job.</para></refsect2>
<refsect2 id="RhythmDBImportJob--error-type"><title>The <literal>"error-type"</literal> property</title>
<indexterm zone="RhythmDBImportJob--error-type"><primary>RhythmDBImportJob:error-type</primary></indexterm><programlisting> "error-type" <link linkend="RhythmDBEntryType">RhythmDBEntryType</link>* : Read / Write / Construct Only</programlisting>
<para>Entry type to use for import error entries added by this job.</para></refsect2>
<refsect2 id="RhythmDBImportJob--ignore-type"><title>The <literal>"ignore-type"</literal> property</title>
<indexterm zone="RhythmDBImportJob--ignore-type"><primary>RhythmDBImportJob:ignore-type</primary></indexterm><programlisting> "ignore-type" <link linkend="RhythmDBEntryType">RhythmDBEntryType</link>* : Read / Write / Construct Only</programlisting>
<para>Entry type to use for ignored entries added by this job.</para></refsect2>
</refsect1>
<refsect1 id="RhythmDBImportJob.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="RhythmDBImportJob-complete"><title>The <literal>"complete"</literal> signal</title>
<indexterm zone="RhythmDBImportJob-complete"><primary>RhythmDBImportJob::complete</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job,
<link linkend="gint">gint</link> arg1,
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
<para>
Emitted when the whole import job is complete.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="RhythmDBImportJob-entry-added"><title>The <literal>"entry-added"</literal> signal</title>
<indexterm zone="RhythmDBImportJob-entry-added"><primary>RhythmDBImportJob::entry-added</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job,
<link linkend="RhythmDBEntry">RhythmDBEntry</link> *entry,
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
<para>
Emitted when an entry has been added to the database by the
import job.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>entry</parameter> :</term>
<listitem><simpara> the newly added <link linkend="RhythmDBEntry"><type>RhythmDBEntry</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="RhythmDBImportJob-scan-complete"><title>The <literal>"scan-complete"</literal> signal</title>
<indexterm zone="RhythmDBImportJob-scan-complete"><primary>RhythmDBImportJob::scan-complete</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job,
<link linkend="gint">gint</link> arg1,
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
<para>
Emitted when the directory scan is complete. Once
the scan is complete, the total number of files to
be processed will not change.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="RhythmDBImportJob-status-changed"><title>The <literal>"status-changed"</literal> signal</title>
<indexterm zone="RhythmDBImportJob-status-changed"><primary>RhythmDBImportJob::status-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="RhythmDBImportJob">RhythmDBImportJob</link> *job,
<link linkend="gint">gint</link> total,
<link linkend="gint">gint</link> imported,
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
<para>
Emitted when the status of the import job has changed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>job</parameter> :</term>
<listitem><simpara> the <link linkend="RhythmDBImportJob"><type>RhythmDBImportJob</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>total</parameter> :</term>
<listitem><simpara> the current total number of files to process
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>imported</parameter> :</term>
<listitem><simpara> the current count of files imported
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|