00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef DEVICE_STORE_H
00028 #define DEVICE_STORE_H
00029
00030 #include <glib-object.h>
00031
00032 #include "device.h"
00033
00034 typedef struct _HalDeviceStore HalDeviceStore;
00035 typedef struct _HalDeviceStoreClass HalDeviceStoreClass;
00036
00037 struct _HalDeviceStore {
00038 GObject parent;
00039
00040 GSList *devices;
00041 };
00042
00043 struct _HalDeviceStoreClass {
00044 GObjectClass parent_class;
00045
00046
00047 void (*store_changed) (HalDeviceStore *store,
00048 HalDevice *device,
00049 gboolean added);
00050
00051 void (*device_property_changed) (HalDeviceStore *store,
00052 HalDevice *device,
00053 const char *key,
00054 gboolean removed,
00055 gboolean added);
00056
00057 void (*device_capability_added) (HalDeviceStore *store,
00058 HalDevice *device,
00059 const char *capability);
00060
00061 };
00062
00063 #define HAL_TYPE_DEVICE_STORE (hal_device_store_get_type ())
00064 #define HAL_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
00065 HAL_TYPE_DEVICE_STORE, \
00066 HalDeviceStore))
00067 #define HAL_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
00068 HAL_TYPE_DEVICE_STORE, \
00069 HalDeviceStoreClass))
00070 #define HAL_IS_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
00071 HAL_TYPE_DEVICE_STORE))
00072 #define HAL_IS_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
00073 HAL_TYPE_DEVICE_STORE))
00074
00075 typedef void (*HalDeviceStoreAsyncCallback) (HalDeviceStore *store,
00076 HalDevice *device,
00077 gpointer user_data);
00078
00079
00080 typedef gboolean (*HalDeviceStoreForeachFn) (HalDeviceStore *store,
00081 HalDevice *device,
00082 gpointer user_data);
00083
00084 GType hal_device_store_get_type (void);
00085
00086 HalDeviceStore *hal_device_store_new (void);
00087
00088 void hal_device_store_add (HalDeviceStore *store,
00089 HalDevice *device);
00090 gboolean hal_device_store_remove (HalDeviceStore *store,
00091 HalDevice *device);
00092
00093 HalDevice *hal_device_store_find (HalDeviceStore *store,
00094 const char *udi);
00095
00096 void hal_device_store_foreach (HalDeviceStore *store,
00097 HalDeviceStoreForeachFn callback,
00098 gpointer user_data);
00099
00100 HalDevice *hal_device_store_match_key_value_string (HalDeviceStore *store,
00101 const char *key,
00102 const char *value);
00103 GSList *hal_device_store_match_multiple_key_value_string (HalDeviceStore *store,
00104 const char *key,
00105 const char *value);
00106
00107 void hal_device_store_match_key_value_string_async (HalDeviceStore *store,
00108 const char *key,
00109 const char *value,
00110 HalDeviceStoreAsyncCallback callback,
00111 gpointer user_data,
00112 int timeout);
00113
00114 #endif