Almost there to pass distcheck.
[mmediamanager.git] / libmmanager / mm-hit.h
blob6bfd565ac0abae151c417c24448618a85503e251
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 #ifndef __MM_HIT_H__
22 #define __MM_HIT_H__
24 #include <glib.h>
26 #include "mm-attribute.h"
28 #define MM_TYPE_HIT (mm_hit_get_type())
29 #define MM_HIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
30 MM_TYPE_HIT, MMHit))
31 #define MM_HIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),\
32 MM_TYPE_HIT, MMHitClass))
33 #define MM_IS_HIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
34 MM_TYPE_HIT))
35 #define MM_IS_HIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj),\
36 MM_TYPE_HIT))
37 #define MM_HIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\
38 MM_TYPE_HIT, MMHitClass))
40 /**
41 * SECTION:mm-hit
42 * @short_description: a hit (i.e. a result of a query).
44 * #MMHit is a single result of a query. It's worth to note that #MMHit objects
45 * are created by the application, so they could have some blank attribute, if
46 * the application doesn't support it. More generally, a #MMHit should have all
47 * the basic attributes and all those supported by its media type set, but it's
48 * up to the applications to fill them in.
51 /**
52 * MMHit:
54 * An object identifying a single result of a query.
57 typedef struct _MMHit MMHit;
58 typedef struct _MMHitPrivate MMHitPrivate;
59 typedef struct _MMHitClass MMHitClass;
61 struct _MMHit {
62 GObject parent_object;
63 MMHitPrivate *details;
66 struct _MMHitClass {
67 GObjectClass parent_class;
70 /* public methods */
72 GType mm_hit_get_type (void);
74 GHashTable * mm_hit_get_values (MMHit *hit,
75 const char *ids);
76 GHashTable * mm_hit_get_all_values (MMHit *hit);
78 /* this should be private to module implementations */
79 void mm_hit_set_values (MMHit *hit,
80 GList *attributes,
81 GList *values);
82 void mm_hit_set_value (MMHit *hit,
83 MMAttribute *attribute,
84 GValue *value);
85 #endif /* __MM_HIT_H__ */