1 /***************************************************************************
4 * device.c : HalDevice methods
6 * Copyright (C) 2003 David Zeuthen, <david@fubar.dk>
7 * Copyright (C) 2004 Novell, Inc.
9 * Licensed under the Academic Free License version 2.1
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 **************************************************************************/
27 #ifndef DEVICE_STORE_H
28 #define DEVICE_STORE_H
30 #include <glib-object.h>
34 typedef struct _HalDeviceStore HalDeviceStore
;
35 typedef struct _HalDeviceStoreClass HalDeviceStoreClass
;
37 struct _HalDeviceStore
{
43 struct _HalDeviceStoreClass
{
44 GObjectClass parent_class
;
47 void (*store_changed
) (HalDeviceStore
*store
,
51 void (*device_property_changed
) (HalDeviceStore
*store
,
57 void (*device_capability_added
) (HalDeviceStore
*store
,
59 const char *capability
);
63 #define HAL_TYPE_DEVICE_STORE (hal_device_store_get_type ())
64 #define HAL_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
65 HAL_TYPE_DEVICE_STORE, \
67 #define HAL_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
68 HAL_TYPE_DEVICE_STORE, \
70 #define HAL_IS_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
71 HAL_TYPE_DEVICE_STORE))
72 #define HAL_IS_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
73 HAL_TYPE_DEVICE_STORE))
75 typedef void (*HalDeviceStoreAsyncCallback
) (HalDeviceStore
*store
,
79 /* Return value of FALSE means that the foreach should be short-circuited */
80 typedef gboolean (*HalDeviceStoreForeachFn
) (HalDeviceStore
*store
,
84 GType
hal_device_store_get_type (void);
86 HalDeviceStore
*hal_device_store_new (void);
88 void hal_device_store_add (HalDeviceStore
*store
,
90 gboolean
hal_device_store_remove (HalDeviceStore
*store
,
93 HalDevice
*hal_device_store_find (HalDeviceStore
*store
,
96 void hal_device_store_foreach (HalDeviceStore
*store
,
97 HalDeviceStoreForeachFn callback
,
100 HalDevice
*hal_device_store_match_key_value_string (HalDeviceStore
*store
,
104 HalDevice
*hal_device_store_match_key_value_int (HalDeviceStore
*store
,
108 GSList
*hal_device_store_match_multiple_key_value_string (HalDeviceStore
*store
,
112 void hal_device_store_match_key_value_string_async (HalDeviceStore
*store
,
115 HalDeviceStoreAsyncCallback callback
,
119 void hal_device_store_print (HalDeviceStore
*store
);
122 #endif /* DEVICE_STORE_H */