use cocoa::base::{id, BOOL};
use crate::constants::ICEXIFOrientationType;
use core_graphics::image::CGImageRef;
use libc::c_uint;
use libc::{c_double, off_t};
use objc::*;
pub trait ICCameraItem: Sized {
unsafe fn device(self) -> id;
unsafe fn parentFolder(self) -> id;
unsafe fn name(self) -> id;
unsafe fn UTI(self) -> id;
unsafe fn fileSystemPath(self) -> id;
unsafe fn isLocked(self) -> BOOL;
unsafe fn isRaw(self) -> BOOL;
unsafe fn isInTemporaryStore(self) -> BOOL;
unsafe fn creationDate(self) -> id;
unsafe fn modificationDate(self) -> id;
unsafe fn thumbnailIfAvailable(self) -> CGImageRef;
unsafe fn largeThumbnailIfAvailable(self) -> CGImageRef;
unsafe fn metadataIfAvailable(self) -> id;
unsafe fn userData(self) -> id;
unsafe fn ptpObjectHandle(self) -> c_uint;
unsafe fn wasAddedAfterContentCatalogCompleted(self) -> BOOL;
}
impl ICCameraItem for id {
unsafe fn device(self) -> id {
msg_send![self, device]
}
unsafe fn parentFolder(self) -> id {
msg_send![self, parentFolder]
}
unsafe fn name(self) -> id {
msg_send![self, name]
}
unsafe fn UTI(self) -> id {
msg_send![self, UTI]
}
unsafe fn fileSystemPath(self) -> id {
msg_send![self, fileSystemPath]
}
unsafe fn isLocked(self) -> BOOL {
msg_send![self, isLocked]
}
unsafe fn isRaw(self) -> BOOL {
msg_send![self, isRaw]
}
unsafe fn isInTemporaryStore(self) -> BOOL {
msg_send![self, isInTemporaryStore]
}
unsafe fn creationDate(self) -> id {
msg_send![self, creationDate]
}
unsafe fn modificationDate(self) -> id {
msg_send![self, modificationDate]
}
unsafe fn thumbnailIfAvailable(self) -> CGImageRef {
msg_send![self, thumbnailIfAvailable]
}
unsafe fn largeThumbnailIfAvailable(self) -> CGImageRef {
msg_send![self, largeThumbnailIfAvailable]
}
unsafe fn metadataIfAvailable(self) -> id {
msg_send![self, metadataIfAvailable]
}
unsafe fn userData(self) -> id {
msg_send![self, userData]
}
unsafe fn ptpObjectHandle(self) -> c_uint {
msg_send![self, ptpObjectHandle]
}
unsafe fn wasAddedAfterContentCatalogCompleted(self) -> BOOL {
msg_send![self, wasAddedAfterContentCatalogCompleted]
}
}
pub trait ICCameraFolder: Sized {
unsafe fn contents(self) -> id;
}
impl ICCameraFolder for id {
unsafe fn contents(self) -> id {
msg_send![self, contents]
}
}
pub trait ICCameraFile: Sized {
unsafe fn fileSize(self) -> off_t;
unsafe fn orientation(self) -> ICEXIFOrientationType;
unsafe fn duration(self) -> c_double;
unsafe fn sidecarFiles(self) -> id;
}
impl ICCameraFile for id {
unsafe fn fileSize(self) -> off_t {
msg_send![self, fileSize]
}
unsafe fn orientation(self) -> ICEXIFOrientationType {
msg_send![self, orientation]
}
unsafe fn duration(self) -> c_double {
msg_send![self, duration]
}
unsafe fn sidecarFiles(self) -> id {
msg_send![self, sidecarFiles]
}
}