/* libinsane.vapi generated by vapigen, do not modify. */

[CCode (cprefix = "Libinsane", gir_namespace = "Libinsane", gir_version = "1.0", lower_case_cprefix = "libinsane_")]
namespace Libinsane {
	[CCode (cheader_filename = "Libinsane-1.0.h", type_id = "libinsane_api_get_type ()")]
	public class Api : GLib.Object {
		[CCode (has_construct_function = false)]
		protected Api ();
		public void cleanup ();
		[CCode (has_construct_function = false)]
		public Api.from_string (string desc) throws GLib.Error;
		public Libinsane.Item get_device (string dev_id) throws GLib.Error;
		public static unowned string get_version ();
		public GLib.List<Libinsane.DeviceDescriptor> list_devices (Libinsane.DeviceLocations locations) throws GLib.Error;
		[CCode (has_construct_function = false)]
		public Api.safebet () throws GLib.Error;
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", type_id = "libinsane_device_descriptor_get_type ()")]
	public class DeviceDescriptor : GLib.Object {
		[CCode (has_construct_function = false)]
		protected DeviceDescriptor ();
		public unowned string get_dev_id ();
		public unowned string get_dev_model ();
		public unowned string get_dev_type ();
		public unowned string get_dev_vendor ();
		public unowned string to_string ();
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", type_id = "libinsane_item_get_type ()")]
	public class Item : GLib.Object {
		[CCode (has_construct_function = false)]
		protected Item ();
		public void close () throws GLib.Error;
		public GLib.List<Libinsane.Item> get_children () throws GLib.Error;
		public Libinsane.ItemType get_item_type ();
		public unowned string get_name ();
		public GLib.List<Libinsane.OptionDescriptor> get_options () throws GLib.Error;
		public Libinsane.ScanSession scan_start () throws GLib.Error;
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", type_id = "libinsane_option_descriptor_get_type ()")]
	public class OptionDescriptor : GLib.Object {
		[CCode (has_construct_function = false)]
		protected OptionDescriptor ();
		public Libinsane.Capability get_capabilities ();
		public GLib.Array<weak GLib.Value?> get_constraint ();
		public Libinsane.ConstraintType get_constraint_type ();
		public unowned string get_desc ();
		public unowned string get_name ();
		public unowned string get_title ();
		public unowned GLib.Value? get_value () throws GLib.Error;
		public GLib.Type get_value_type ();
		public Libinsane.Unit get_value_unit ();
		public bool is_readable ();
		public bool is_writable ();
		public Libinsane.SetFlag set_value (GLib.Value value) throws GLib.Error;
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", type_id = "libinsane_scan_parameters_get_type ()")]
	public class ScanParameters : GLib.Object {
		[CCode (has_construct_function = false)]
		protected ScanParameters ();
		public Libinsane.ImgFormat get_format ();
		public int get_height ();
		public size_t get_image_size ();
		public int get_width ();
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", type_id = "libinsane_scan_session_get_type ()")]
	public class ScanSession : GLib.Object {
		[CCode (has_construct_function = false)]
		protected ScanSession ();
		public void cancel ();
		public bool end_of_feed ();
		public bool end_of_page ();
		public Libinsane.ScanParameters get_scan_parameters () throws GLib.Error;
		public ssize_t read ([CCode (array_length_cname = "lng", array_length_pos = 1.1, array_length_type = "gsize")] uint8[] buffer) throws GLib.Error;
		public GLib.Bytes read_bytes (size_t lng) throws GLib.Error;
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", type_cname = "LibinsaneLoggerInterface", type_id = "libinsane_logger_get_type ()")]
	public interface Logger : GLib.Object {
		public abstract void log (Libinsane.LogLevel lvl, string msg);
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_CAPABILITY_", has_type_id = false)]
	[Flags]
	public enum Capability {
		NONE,
		EMULATED,
		AUTOMATIC,
		HW_SELECT,
		SW_SELECT,
		INACTIVE
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_CONSTRAINT_TYPE_", has_type_id = false)]
	public enum ConstraintType {
		NONE,
		RANGE,
		LIST
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_DEVICE_LOCATIONS_", has_type_id = false)]
	public enum DeviceLocations {
		ANY,
		LOCAL_ONLY
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_IMG_FORMAT_", has_type_id = false)]
	public enum ImgFormat {
		RAW_RGB_24,
		GRAYSCALE_8,
		BW_1,
		BMP,
		GIF,
		JPEG,
		PNG,
		CIFF,
		EXIF,
		FLASHPIX,
		ICO,
		JPEG2K,
		JPEG2KX,
		MEMORYBMP,
		PHOTOCD,
		PICT,
		TIFF
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_ITEM_TYPE_", has_type_id = false)]
	public enum ItemType {
		DEVICE,
		FLATBED,
		ADF,
		UNIDENTIFIED
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_LOG_LEVEL_", has_type_id = false)]
	public enum LogLevel {
		DEBUG,
		INFO,
		WARNING,
		ERROR
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_SET_FLAG_", has_type_id = false)]
	[Flags]
	public enum SetFlag {
		NONE,
		INEXACT,
		MUST_RELOAD_OPTIONS,
		MUST_RELOAD_PARAMS
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_UNIT_", has_type_id = false)]
	public enum Unit {
		NONE,
		PIXEL,
		BIT,
		MM,
		DPI,
		PERCENT,
		MICROSECOND
	}
	[CCode (cheader_filename = "Libinsane-1.0.h", cprefix = "LIBINSANE_ERROR_")]
	public errordomain Error {
		OK,
		CANCELLED,
		DEVICE_BUSY,
		UNSUPPORTED,
		INVALID_VALUE,
		JAMMED,
		COVER_OPEN,
		IO_ERROR,
		NO_MEM,
		ACCESS_DENIED,
		HW_IS_LOCKED,
		INTERNAL_IMG_FORMAT_NOT_SUPPORTED,
		INTERNAL_NOT_IMPLEMENTED,
		INTERNAL_UNKNOWN_ERROR;
		public static GLib.Quark quark ();
	}
	[CCode (cheader_filename = "Libinsane-1.0.h")]
	public static void register_logger (Libinsane.Logger logger);
	[CCode (cheader_filename = "Libinsane-1.0.h")]
	public static void unregister_logger ();
}
