~ubuntu-branches/ubuntu/precise/rhythmbox/precise-201203091205

« back to all changes in this revision

Viewing changes to rhythmdb/rhythmdb-query-results.c

Tags: upstream-0.9.5
ImportĀ upstreamĀ versionĀ 0.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 
2
 *
 
3
 *  Copyright (C) 2006  Jonathan Matthew  <jonathan@kaolin.wh9.net>
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
18
 *
 
19
 */
 
20
 
 
21
#include <config.h>
 
22
 
 
23
#include "rhythmdb-query-results.h"
 
24
 
 
25
GType
 
26
rhythmdb_query_results_get_type (void)
 
27
{
 
28
        static GType our_type = 0;
 
29
 
 
30
        if (!our_type) {
 
31
                static const GTypeInfo our_info = {
 
32
                        sizeof (RhythmDBQueryResultsIface),
 
33
                        NULL,   /* base_init */
 
34
                        NULL,   /* base_finalize */
 
35
                        NULL,
 
36
                        NULL,   /* class_finalize */
 
37
                        NULL,   /* class_data */
 
38
                        0,
 
39
                        0,
 
40
                        NULL
 
41
                };
 
42
 
 
43
                our_type = g_type_register_static (G_TYPE_INTERFACE, "RhythmDBQueryResults", &our_info, 0);
 
44
        }
 
45
 
 
46
        return our_type;
 
47
}
 
48
 
 
49
void
 
50
rhythmdb_query_results_set_query (RhythmDBQueryResults *results,
 
51
                                  GPtrArray *query)
 
52
{
 
53
        RhythmDBQueryResultsIface *iface = RHYTHMDB_QUERY_RESULTS_GET_IFACE (results);
 
54
        if (iface->set_query)
 
55
                iface->set_query (results, query);
 
56
}
 
57
 
 
58
void
 
59
rhythmdb_query_results_add_results (RhythmDBQueryResults *results,
 
60
                                    GPtrArray *entries)
 
61
{
 
62
        RhythmDBQueryResultsIface *iface = RHYTHMDB_QUERY_RESULTS_GET_IFACE (results);
 
63
        if (iface->add_results)
 
64
                iface->add_results (results, entries);
 
65
}
 
66
 
 
67
void
 
68
rhythmdb_query_results_query_complete (RhythmDBQueryResults *results)
 
69
{
 
70
        RhythmDBQueryResultsIface *iface = RHYTHMDB_QUERY_RESULTS_GET_IFACE (results);
 
71
        if (iface->query_complete)
 
72
                iface->query_complete (results);
 
73
}
 
74