2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
4
<refentry id="RhythmDBQueryResults">
6
<refentrytitle role="top_of_page" id="RhythmDBQueryResults.top_of_page">RhythmDBQueryResults</refentrytitle>
7
<manvolnum>3</manvolnum>
8
<refmiscinfo>RHYTHMBOX Library</refmiscinfo>
12
<refname>RhythmDBQueryResults</refname>
13
<refpurpose>interface for receiving query results from RhythmDB</refpurpose>
16
<refsynopsisdiv id="RhythmDBQueryResults.synopsis" role="synopsis">
17
<title role="synopsis.title">Synopsis</title>
20
<link linkend="RhythmDBQueryResults-struct">RhythmDBQueryResults</link>;
21
<link linkend="RhythmDBQueryResultsIface">RhythmDBQueryResultsIface</link>;
22
<link linkend="void">void</link> <link linkend="rhythmdb-query-results-set-query">rhythmdb_query_results_set_query</link> (<link linkend="RhythmDBQueryResults">RhythmDBQueryResults</link> *results,
23
<link linkend="GPtrArray">GPtrArray</link> *query);
24
<link linkend="void">void</link> <link linkend="rhythmdb-query-results-add-results">rhythmdb_query_results_add_results</link> (<link linkend="RhythmDBQueryResults">RhythmDBQueryResults</link> *results,
25
<link linkend="GPtrArray">GPtrArray</link> *entries);
26
<link linkend="void">void</link> <link linkend="rhythmdb-query-results-query-complete">rhythmdb_query_results_query_complete</link>
27
(<link linkend="RhythmDBQueryResults">RhythmDBQueryResults</link> *results);
31
<refsect1 id="RhythmDBQueryResults.object-hierarchy" role="object_hierarchy">
32
<title role="object_hierarchy.title">Object Hierarchy</title>
34
<link linkend="GInterface">GInterface</link>
35
+----RhythmDBQueryResults
42
<refsect1 id="RhythmDBQueryResults.implementations" role="implementations">
43
<title role="implementations.title">Known Implementations</title>
45
RhythmDBQueryResults is implemented by
46
<link linkend="RhythmDBQueryModel">RhythmDBQueryModel</link>.</para>
52
<refsect1 id="RhythmDBQueryResults.description" role="desc">
53
<title role="desc.title">Description</title>
55
This is the interface that <link linkend="RhythmDB"><type>RhythmDB</type></link> uses to report results of database
56
queries. When running a query, it first calls rhythmdb_query_results_set_query,
57
then passes entries matching the query to rhythmdb_query_results_add_results
58
in batches, and finally calls rhythmdb_query_results_query_complete.
59
There are no guarantees as to which threads the calls are made from.</para>
64
<refsect1 id="RhythmDBQueryResults.details" role="details">
65
<title role="details.title">Details</title>
66
<refsect2 id="RhythmDBQueryResults-struct" role="struct">
67
<title>RhythmDBQueryResults</title>
68
<indexterm zone="RhythmDBQueryResults-struct"><primary sortas="RhythmDBQueryResults">RhythmDBQueryResults</primary></indexterm><programlisting>typedef struct _RhythmDBQueryResults RhythmDBQueryResults;</programlisting>
71
<refsect2 id="RhythmDBQueryResultsIface" role="struct">
72
<title>RhythmDBQueryResultsIface</title>
73
<indexterm zone="RhythmDBQueryResultsIface"><primary sortas="RhythmDBQueryResultsIface">RhythmDBQueryResultsIface</primary></indexterm><programlisting>typedef struct {
74
GTypeInterface g_iface;
77
void (*set_query) (RhythmDBQueryResults *results,
80
void (*add_results) (RhythmDBQueryResults *results,
83
void (*query_complete) (RhythmDBQueryResults *results);
84
} RhythmDBQueryResultsIface;
88
<refsect2 id="rhythmdb-query-results-set-query" role="function">
89
<title>rhythmdb_query_results_set_query ()</title>
90
<indexterm zone="rhythmdb-query-results-set-query"><primary sortas="rhythmdb_query_results_set_query">rhythmdb_query_results_set_query</primary></indexterm><programlisting><link linkend="void">void</link> rhythmdb_query_results_set_query (<link linkend="RhythmDBQueryResults">RhythmDBQueryResults</link> *results,
91
<link linkend="GPtrArray">GPtrArray</link> *query);</programlisting>
93
When a new query is run, this method is invoked to give the
94
object implementing this interface a chance to take a copy of the
95
query criteria, so that it can evaluate the query for newly added
96
or changed entries once the query is complete.</para>
98
</para><variablelist role="params">
99
<varlistentry><term><parameter>results</parameter> :</term>
100
<listitem><simpara> the <link linkend="RhythmDBQueryResults"><type>RhythmDBQueryResults</type></link> implementation
101
</simpara></listitem></varlistentry>
102
<varlistentry><term><parameter>query</parameter> :</term>
103
<listitem><simpara> the new query
104
</simpara></listitem></varlistentry>
105
</variablelist></refsect2>
106
<refsect2 id="rhythmdb-query-results-add-results" role="function">
107
<title>rhythmdb_query_results_add_results ()</title>
108
<indexterm zone="rhythmdb-query-results-add-results"><primary sortas="rhythmdb_query_results_add_results">rhythmdb_query_results_add_results</primary></indexterm><programlisting><link linkend="void">void</link> rhythmdb_query_results_add_results (<link linkend="RhythmDBQueryResults">RhythmDBQueryResults</link> *results,
109
<link linkend="GPtrArray">GPtrArray</link> *entries);</programlisting>
111
Provides a new set of query results. References must be taken on the
114
</para><variablelist role="params">
115
<varlistentry><term><parameter>results</parameter> :</term>
116
<listitem><simpara> the <link linkend="RhythmDBQueryResults"><type>RhythmDBQueryResults</type></link> implementation
117
</simpara></listitem></varlistentry>
118
<varlistentry><term><parameter>entries</parameter> :</term>
119
<listitem><simpara> <link linkend="GPtrArray"><type>GPtrArray</type></link> containing <link linkend="RhythmDBEntry"><type>RhythmDBEntry</type></link> results
120
</simpara></listitem></varlistentry>
121
</variablelist></refsect2>
122
<refsect2 id="rhythmdb-query-results-query-complete" role="function">
123
<title>rhythmdb_query_results_query_complete ()</title>
124
<indexterm zone="rhythmdb-query-results-query-complete"><primary sortas="rhythmdb_query_results_query_complete">rhythmdb_query_results_query_complete</primary></indexterm><programlisting><link linkend="void">void</link> rhythmdb_query_results_query_complete
125
(<link linkend="RhythmDBQueryResults">RhythmDBQueryResults</link> *results);</programlisting>
127
Called when the query is complete and all entries that match the query
128
have been supplied to rhythmdb_query_results_add_results. If the object
129
implementing this interface needs to identify newly added or changed entries
130
that match the query, it needs to use the entry-added, entry-deleted and
131
entry-changed signals from <link linkend="RhythmDB"><type>RhythmDB</type></link>.</para>
133
</para><variablelist role="params">
134
<varlistentry><term><parameter>results</parameter> :</term>
135
<listitem><simpara> the <link linkend="RhythmDBQueryResults"><type>RhythmDBQueryResults</type></link>
136
</simpara></listitem></varlistentry>
137
</variablelist></refsect2>