1N/A/***************************************************************************
1N/A * CVSID: $Id$
1N/A *
1N/A * device.c : HalDevice methods
1N/A *
1N/A * Copyright (C) 2003 David Zeuthen, <david@fubar.dk>
1N/A * Copyright (C) 2004 Novell, Inc.
1N/A *
1N/A * Licensed under the Academic Free License version 2.1
1N/A *
1N/A * This program is free software; you can redistribute it and/or modify
1N/A * it under the terms of the GNU General Public License as published by
1N/A * the Free Software Foundation; either version 2 of the License, or
1N/A * (at your option) any later version.
1N/A *
1N/A * This program is distributed in the hope that it will be useful,
1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A * GNU General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU General Public License
1N/A * along with this program; if not, write to the Free Software
1N/A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1N/A *
1N/A **************************************************************************/
1N/A
1N/A#ifndef DEVICE_STORE_H
1N/A#define DEVICE_STORE_H
1N/A
1N/A#include <glib-object.h>
1N/A
1N/A#include "device.h"
1N/A
1N/Atypedef struct _HalDeviceStore HalDeviceStore;
1N/Atypedef struct _HalDeviceStoreClass HalDeviceStoreClass;
1N/A
1N/Astruct _HalDeviceStore {
1N/A GObject parent;
1N/A
1N/A GSList *devices;
1N/A};
1N/A
1N/Astruct _HalDeviceStoreClass {
1N/A GObjectClass parent_class;
1N/A
1N/A /* signals */
1N/A void (*store_changed) (HalDeviceStore *store,
1N/A HalDevice *device,
1N/A gboolean added);
1N/A
1N/A void (*device_property_changed) (HalDeviceStore *store,
1N/A HalDevice *device,
1N/A const char *key,
1N/A gboolean removed,
1N/A gboolean added);
1N/A
1N/A void (*device_capability_added) (HalDeviceStore *store,
1N/A HalDevice *device,
1N/A const char *capability);
1N/A
1N/A};
1N/A
1N/A#define HAL_TYPE_DEVICE_STORE (hal_device_store_get_type ())
1N/A#define HAL_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
1N/A HAL_TYPE_DEVICE_STORE, \
1N/A HalDeviceStore))
1N/A#define HAL_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
1N/A HAL_TYPE_DEVICE_STORE, \
1N/A HalDeviceStoreClass))
1N/A#define HAL_IS_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
1N/A HAL_TYPE_DEVICE_STORE))
1N/A#define HAL_IS_DEVICE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
1N/A HAL_TYPE_DEVICE_STORE))
1N/A
1N/Atypedef void (*HalDeviceStoreAsyncCallback) (HalDeviceStore *store,
1N/A HalDevice *device,
1N/A gpointer user_data);
1N/A
1N/A/* Return value of FALSE means that the foreach should be short-circuited */
1N/Atypedef gboolean (*HalDeviceStoreForeachFn) (HalDeviceStore *store,
1N/A HalDevice *device,
1N/A gpointer user_data);
1N/A
1N/AGType hal_device_store_get_type (void);
1N/A
1N/AHalDeviceStore *hal_device_store_new (void);
1N/A
1N/Avoid hal_device_store_add (HalDeviceStore *store,
1N/A HalDevice *device);
1N/Agboolean hal_device_store_remove (HalDeviceStore *store,
1N/A HalDevice *device);
1N/A
1N/AHalDevice *hal_device_store_find (HalDeviceStore *store,
1N/A const char *udi);
1N/A
1N/Avoid hal_device_store_foreach (HalDeviceStore *store,
1N/A HalDeviceStoreForeachFn callback,
1N/A gpointer user_data);
1N/A
1N/AHalDevice *hal_device_store_match_key_value_string (HalDeviceStore *store,
1N/A const char *key,
1N/A const char *value);
1N/A
1N/AHalDevice *hal_device_store_match_key_value_int (HalDeviceStore *store,
1N/A const char *key,
1N/A int value);
1N/A
1N/AGSList *hal_device_store_match_multiple_key_value_string (HalDeviceStore *store,
1N/A const char *key,
1N/A const char *value);
1N/A
1N/Avoid hal_device_store_match_key_value_string_async (HalDeviceStore *store,
1N/A const char *key,
1N/A const char *value,
1N/A HalDeviceStoreAsyncCallback callback,
1N/A gpointer user_data,
1N/A int timeout);
1N/A
1N/Avoid hal_device_store_print (HalDeviceStore *store);
1N/A
1N/A
1N/A#endif /* DEVICE_STORE_H */