icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

extern_protocol!(
    pub unsafe trait NSLocking {
        #[method(lock)]
        unsafe fn lock(&self);

        #[method(unlock)]
        unsafe fn unlock(&self);
    }

    unsafe impl ProtocolType for dyn NSLocking {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSLock")]
    pub struct NSLock;

    #[cfg(feature = "Foundation_NSLock")]
    unsafe impl ClassType for NSLock {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSLock")]
unsafe impl Send for NSLock {}

#[cfg(feature = "Foundation_NSLock")]
unsafe impl Sync for NSLock {}

#[cfg(feature = "Foundation_NSLock")]
unsafe impl NSLocking for NSLock {}

#[cfg(feature = "Foundation_NSLock")]
unsafe impl NSObjectProtocol for NSLock {}

extern_methods!(
    #[cfg(feature = "Foundation_NSLock")]
    unsafe impl NSLock {
        #[method(tryLock)]
        pub unsafe fn tryLock(&self) -> bool;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(lockBeforeDate:)]
        pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub fn name(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setName:)]
        pub fn setName(&self, name: Option<&NSString>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSLock")]
    unsafe impl NSLock {
        #[method_id(@__retain_semantics Init init)]
        pub fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub fn new() -> Id<Self>;
    }
);

#[cfg(feature = "Foundation_NSLock")]
impl DefaultId for NSLock {
    #[inline]
    fn default_id() -> Id<Self> {
        Self::new()
    }
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSConditionLock")]
    pub struct NSConditionLock;

    #[cfg(feature = "Foundation_NSConditionLock")]
    unsafe impl ClassType for NSConditionLock {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSConditionLock")]
unsafe impl Send for NSConditionLock {}

#[cfg(feature = "Foundation_NSConditionLock")]
unsafe impl Sync for NSConditionLock {}

#[cfg(feature = "Foundation_NSConditionLock")]
unsafe impl NSLocking for NSConditionLock {}

#[cfg(feature = "Foundation_NSConditionLock")]
unsafe impl NSObjectProtocol for NSConditionLock {}

extern_methods!(
    #[cfg(feature = "Foundation_NSConditionLock")]
    unsafe impl NSConditionLock {
        #[method_id(@__retain_semantics Init initWithCondition:)]
        pub unsafe fn initWithCondition(this: Allocated<Self>, condition: NSInteger) -> Id<Self>;

        #[method(condition)]
        pub unsafe fn condition(&self) -> NSInteger;

        #[method(lockWhenCondition:)]
        pub unsafe fn lockWhenCondition(&self, condition: NSInteger);

        #[method(tryLock)]
        pub unsafe fn tryLock(&self) -> bool;

        #[method(tryLockWhenCondition:)]
        pub unsafe fn tryLockWhenCondition(&self, condition: NSInteger) -> bool;

        #[method(unlockWithCondition:)]
        pub unsafe fn unlockWithCondition(&self, condition: NSInteger);

        #[cfg(feature = "Foundation_NSDate")]
        #[method(lockBeforeDate:)]
        pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(lockWhenCondition:beforeDate:)]
        pub unsafe fn lockWhenCondition_beforeDate(
            &self,
            condition: NSInteger,
            limit: &NSDate,
        ) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setName:)]
        pub unsafe fn setName(&self, name: Option<&NSString>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSConditionLock")]
    unsafe impl NSConditionLock {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSRecursiveLock")]
    pub struct NSRecursiveLock;

    #[cfg(feature = "Foundation_NSRecursiveLock")]
    unsafe impl ClassType for NSRecursiveLock {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSRecursiveLock")]
unsafe impl Send for NSRecursiveLock {}

#[cfg(feature = "Foundation_NSRecursiveLock")]
unsafe impl Sync for NSRecursiveLock {}

#[cfg(feature = "Foundation_NSRecursiveLock")]
unsafe impl NSLocking for NSRecursiveLock {}

#[cfg(feature = "Foundation_NSRecursiveLock")]
unsafe impl NSObjectProtocol for NSRecursiveLock {}

extern_methods!(
    #[cfg(feature = "Foundation_NSRecursiveLock")]
    unsafe impl NSRecursiveLock {
        #[method(tryLock)]
        pub unsafe fn tryLock(&self) -> bool;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(lockBeforeDate:)]
        pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setName:)]
        pub unsafe fn setName(&self, name: Option<&NSString>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSRecursiveLock")]
    unsafe impl NSRecursiveLock {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSCondition")]
    pub struct NSCondition;

    #[cfg(feature = "Foundation_NSCondition")]
    unsafe impl ClassType for NSCondition {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSCondition")]
unsafe impl Send for NSCondition {}

#[cfg(feature = "Foundation_NSCondition")]
unsafe impl Sync for NSCondition {}

#[cfg(feature = "Foundation_NSCondition")]
unsafe impl NSLocking for NSCondition {}

#[cfg(feature = "Foundation_NSCondition")]
unsafe impl NSObjectProtocol for NSCondition {}

extern_methods!(
    #[cfg(feature = "Foundation_NSCondition")]
    unsafe impl NSCondition {
        #[method(wait)]
        pub unsafe fn wait(&self);

        #[cfg(feature = "Foundation_NSDate")]
        #[method(waitUntilDate:)]
        pub unsafe fn waitUntilDate(&self, limit: &NSDate) -> bool;

        #[method(signal)]
        pub unsafe fn signal(&self);

        #[method(broadcast)]
        pub unsafe fn broadcast(&self);

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setName:)]
        pub unsafe fn setName(&self, name: Option<&NSString>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSCondition")]
    unsafe impl NSCondition {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);