use cocoa::base::id;
use objc::*;
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ICScannerTransferMode {
ICScannerTransferModeFileBased = 0,
ICScannerTransferModeMemoryBased = 1,
}
pub trait ICScannerDevice: Sized {
unsafe fn availableFunctionalUnitTypes(self) -> id;
unsafe fn selectedFunctionalUnit(self) -> id;
unsafe fn transferMode(self) -> ICScannerTransferMode;
unsafe fn setTransferMode(self, transferMode: ICScannerTransferMode);
unsafe fn maxMemoryBandSize(self) -> u32;
unsafe fn setMaxMemoryBandSize(self, maxMemoryBandSize: u32);
unsafe fn downloadsDirectory(self) -> id;
unsafe fn setDownloadsDirectory(self, downloadsDirectory: id);
unsafe fn documentName(self) -> id;
unsafe fn setDocumentName(self, documentName: id);
unsafe fn documentUTI(self) -> id;
unsafe fn setDocumentUTI(self, documentUTI: id);
unsafe fn defaultUsername(self) -> id;
unsafe fn setDefaultUsername(self, defaultUsername: id);
unsafe fn requestOpenSessionWithCredentials(self, username: id, password: id);
unsafe fn requestSelectFunctionalUnit(self, type_: id);
unsafe fn requestOverviewScan(self);
unsafe fn requestScan(self);
unsafe fn cancelScan(self);
}
impl ICScannerDevice for id {
unsafe fn availableFunctionalUnitTypes(self) -> id {
msg_send![self, availableFunctionalUnitTypes]
}
unsafe fn selectedFunctionalUnit(self) -> id {
msg_send![self, selectedFunctionalUnit]
}
unsafe fn transferMode(self) -> ICScannerTransferMode {
msg_send![self, transferMode]
}
unsafe fn setTransferMode(self, transferMode: ICScannerTransferMode) {
msg_send![self, setTransferMode: transferMode]
}
unsafe fn maxMemoryBandSize(self) -> u32 {
msg_send![self, maxMemoryBandSize]
}
unsafe fn setMaxMemoryBandSize(self, maxMemoryBandSize: u32) {
msg_send![self, setMaxMemoryBandSize: maxMemoryBandSize]
}
unsafe fn downloadsDirectory(self) -> id {
msg_send![self, downloadsDirectory]
}
unsafe fn setDownloadsDirectory(self, downloadsDirectory: id) {
msg_send![self, setDownloadsDirectory: downloadsDirectory]
}
unsafe fn documentName(self) -> id {
msg_send![self, documentName]
}
unsafe fn setDocumentName(self, documentName: id) {
msg_send![self, setDocumentName: documentName]
}
unsafe fn documentUTI(self) -> id {
msg_send![self, documentUTI]
}
unsafe fn setDocumentUTI(self, documentUTI: id) {
msg_send![self, setDocumentUTI: documentUTI]
}
unsafe fn defaultUsername(self) -> id {
msg_send![self, defaultUsername]
}
unsafe fn setDefaultUsername(self, defaultUsername: id) {
msg_send![self, setDefaultUsername: defaultUsername]
}
unsafe fn requestOpenSessionWithCredentials(self, username: id, password: id) {
msg_send![self, requestOpenSessionWithCredentials:username password:password]
}
unsafe fn requestSelectFunctionalUnit(self, type_: id) {
msg_send![self, requestSelectFunctionalUnit: type_]
}
unsafe fn requestOverviewScan(self) {
msg_send![self, requestOverviewScan]
}
unsafe fn requestScan(self) {
msg_send![self, requestScan]
}
unsafe fn cancelScan(self) {
msg_send![self, cancelScan]
}
}
#[link(name = "ImageCaptureCore", kind = "framework")]
extern "C" {
pub static ICScannerStatusWarmingUp: id;
pub static ICScannerStatusWarmUpDone: id;
pub static ICScannerStatusRequestsOverviewScan: id;
}