#ifndef __ROCCAT_DEVICE_SCANNER_H__
#define __ROCCAT_DEVICE_SCANNER_H__

/*
 * This file is part of roccat-tools.
 *
 * roccat-tools is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * roccat-tools is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with roccat-tools. If not, see <http://www.gnu.org/licenses/>.
 */

#include "roccat_device.h"
#include <glib-object.h>

G_BEGIN_DECLS

#define ROCCAT_DEVICE_SCANNER_TYPE (roccat_device_scanner_get_type())
#define ROCCAT_DEVICE_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ROCCAT_DEVICE_SCANNER_TYPE, RoccatDeviceScanner))
#define IS_ROCCAT_DEVICE_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ROCCAT_DEVICE_SCANNER_TYPE))

typedef struct _RoccatDeviceScanner RoccatDeviceScanner;
typedef struct _RoccatDeviceScannerPrivate RoccatDeviceScannerPrivate;

struct _RoccatDeviceScanner {
	GObject parent;
	RoccatDeviceScannerPrivate *priv;
};

GType roccat_device_scanner_get_type(void);

/* 
 * class_name and device_ids have to be persistent.
 * Possible class_name values:
 *
 * - "hidraw" If no special driver exists, hidraw can be used. RoccatDevice.syspath
 *   and RoccatDevice.roccat are NULL, RoccatDevice.hidraw is set.
 *
 * - name of class of roccat chardev device if special driver exists.
 *   RoccatDevice.syspath and RoccatDevice.roccat are set, RoccatDevice.hidraw is NULL.
 *
 * - "hid" If a special driver has no chardev with associated sysfs-attributes,
 *   sysfs-attrs are on interface level.
 *
 * "roccat" Is always scanned as fallback for old kernels. RoccatDevice.syspath
 * is on interface level.
 */
 
RoccatDeviceScanner *roccat_device_scanner_new(gchar const *class_name, guint const *device_ids, guint interface_protocol);

void roccat_device_scanner_start(RoccatDeviceScanner *device_scanner);
void roccat_device_scanner_stop(RoccatDeviceScanner *device_scanner);

RoccatDevice *roccat_device_first(gchar const *class_name, guint const *device_ids, guint interface_protocol);

G_END_DECLS

#endif
