dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / hal / hald / device_store.h
blob6a03ea8cefb0296ba68b2d8c44f223e1c94fd738
1 /***************************************************************************
2 * CVSID: $Id$
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>
32 #include "device.h"
34 typedef struct _HalDeviceStore HalDeviceStore;
35 typedef struct _HalDeviceStoreClass HalDeviceStoreClass;
37 struct _HalDeviceStore {
38 GObject parent;
40 GSList *devices;
43 struct _HalDeviceStoreClass {
44 GObjectClass parent_class;
46 /* signals */
47 void (*store_changed) (HalDeviceStore *store,
48 HalDevice *device,
49 gboolean added);
51 void (*device_property_changed) (HalDeviceStore *store,
52 HalDevice *device,
53 const char *key,
54 gboolean removed,
55 gboolean added);
57 void (*device_capability_added) (HalDeviceStore *store,
58 HalDevice *device,
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, \
66 HalDeviceStore))
67 #define HAL_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
68 HAL_TYPE_DEVICE_STORE, \
69 HalDeviceStoreClass))
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,
76 HalDevice *device,
77 gpointer user_data);
79 /* Return value of FALSE means that the foreach should be short-circuited */
80 typedef gboolean (*HalDeviceStoreForeachFn) (HalDeviceStore *store,
81 HalDevice *device,
82 gpointer user_data);
84 GType hal_device_store_get_type (void);
86 HalDeviceStore *hal_device_store_new (void);
88 void hal_device_store_add (HalDeviceStore *store,
89 HalDevice *device);
90 gboolean hal_device_store_remove (HalDeviceStore *store,
91 HalDevice *device);
93 HalDevice *hal_device_store_find (HalDeviceStore *store,
94 const char *udi);
96 void hal_device_store_foreach (HalDeviceStore *store,
97 HalDeviceStoreForeachFn callback,
98 gpointer user_data);
100 HalDevice *hal_device_store_match_key_value_string (HalDeviceStore *store,
101 const char *key,
102 const char *value);
104 HalDevice *hal_device_store_match_key_value_int (HalDeviceStore *store,
105 const char *key,
106 int value);
108 GSList *hal_device_store_match_multiple_key_value_string (HalDeviceStore *store,
109 const char *key,
110 const char *value);
112 void hal_device_store_match_key_value_string_async (HalDeviceStore *store,
113 const char *key,
114 const char *value,
115 HalDeviceStoreAsyncCallback callback,
116 gpointer user_data,
117 int timeout);
119 void hal_device_store_print (HalDeviceStore *store);
122 #endif /* DEVICE_STORE_H */