Implement hit collection provider and add the category to the required args.
[mmediamanager.git] / src / mm-hit-collection-provider.c
blobf2dc44e7728b1e8e95464e9d47051816a07e350f
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-category-provider.h"
25 static void
26 mm_hit_collection_provider_base_init (gpointer klass)
31 GType
32 mm_hit_collection_provider_get_type (void)
34 static GType type = 0;
36 if (!type) {
37 const GTypeInfo info = {
38 sizeof (MMHitCollectionProviderIface),
39 mm_hit_collection_provider_base_init,
40 NULL,
41 NULL,
42 NULL,
43 NULL,
46 NULL
49 type = g_type_register_static (G_TYPE_INTERFACE,
50 "MMHitCollectionProvider",
51 &info, 0);
52 g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
55 return type;
58 GList *
59 mm_hit_collection_provider_get_hits (MMHitCollectionProvider *provider,
60 MMCategory *category,
61 MMFilter *filter)
63 g_return_val_if_fail (MM_IS_HIT_COLLECTION_PROVIDER (provider), NULL);
64 g_return_val_if_fail (MM_IS_CATEGORY (category), NULL);
65 g_return_val_if_fail (MM_IS_FILTER (filter), NULL);
66 g_return_val_if_fail (MM_HIT_COLLECTION_PROVIDER_GET_IFACE (provider)->get_hits != NULL, NULL);
68 return MM_HIT_COLLECTION_PROVIDER_GET_IFACE (provider)->get_hits (provider,
69 category,
70 filter);