Almost there to pass distcheck.
[mmediamanager.git] / libmmanager / mm-hit-collection-provider.c
blob1d8b5bb450006e84b25e1426c734aa172170429d
1 /* MManager - a Desktop wide manager for multimedia applications.
3 * Copyright (C) 2008 Cosimo Cecchi <cosimoc@gnome.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include <config.h>
22 #include <glib-object.h>
23 #include "mm-hit-collection-provider.h"
24 #include "mm-category.h"
25 #include "mm-filter.h"
26 #include "mm-hit-collection.h"
28 static void
29 mm_hit_collection_provider_base_init (gpointer klass)
34 GType
35 mm_hit_collection_provider_get_type (void)
37 static GType type = 0;
39 if (!type) {
40 const GTypeInfo info = {
41 sizeof (MMHitCollectionProviderIface),
42 mm_hit_collection_provider_base_init,
43 NULL,
44 NULL,
45 NULL,
46 NULL,
49 NULL
52 type = g_type_register_static (G_TYPE_INTERFACE,
53 "MMHitCollectionProvider",
54 &info, 0);
55 g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
58 return type;
61 /* public method */
63 /**
64 * mm_hit_collection_provider_get_hits:
65 * @provider: a #MMHitCollectionProvider.
66 * @category: a #MMCategory.
67 * @filter: a #MMFilter.
69 * Gets the #MMHitCollection provided by @provider, passing to the module
70 * the category and the filter for the query.
72 * Return value: a #MMHitCollection.
75 MMHitCollection *
76 mm_hit_collection_provider_get_hits (MMHitCollectionProvider *provider,
77 MMCategory *category,
78 MMFilter *filter)
80 g_return_val_if_fail (MM_IS_HIT_COLLECTION_PROVIDER (provider), NULL);
81 g_return_val_if_fail (MM_IS_CATEGORY (category), NULL);
82 g_return_val_if_fail (MM_IS_FILTER (filter), NULL);
83 g_return_val_if_fail (MM_HIT_COLLECTION_PROVIDER_GET_IFACE (provider)->get_hits != NULL, NULL);
85 return MM_HIT_COLLECTION_PROVIDER_GET_IFACE (provider)->get_hits (provider,
86 category,
87 filter);