objc2-foundation 0.2.2

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

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSDateInterval;

    unsafe impl ClassType for NSDateInterval {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl Send for NSDateInterval {}

unsafe impl Sync for NSDateInterval {}

#[cfg(feature = "NSObject")]
unsafe impl NSCoding for NSDateInterval {}

#[cfg(feature = "NSObject")]
unsafe impl NSCopying for NSDateInterval {}

unsafe impl NSObjectProtocol for NSDateInterval {}

#[cfg(feature = "NSObject")]
unsafe impl NSSecureCoding for NSDateInterval {}

extern_methods!(
    unsafe impl NSDateInterval {
        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Other startDate)]
        pub unsafe fn startDate(&self) -> Retained<NSDate>;

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Other endDate)]
        pub unsafe fn endDate(&self) -> Retained<NSDate>;

        #[cfg(feature = "NSDate")]
        #[method(duration)]
        pub unsafe fn duration(&self) -> NSTimeInterval;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Init initWithStartDate:duration:)]
        pub unsafe fn initWithStartDate_duration(
            this: Allocated<Self>,
            start_date: &NSDate,
            duration: NSTimeInterval,
        ) -> Retained<Self>;

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Init initWithStartDate:endDate:)]
        pub unsafe fn initWithStartDate_endDate(
            this: Allocated<Self>,
            start_date: &NSDate,
            end_date: &NSDate,
        ) -> Retained<Self>;

        #[cfg(feature = "NSObjCRuntime")]
        #[method(compare:)]
        pub unsafe fn compare(&self, date_interval: &NSDateInterval) -> NSComparisonResult;

        #[method(isEqualToDateInterval:)]
        pub unsafe fn isEqualToDateInterval(&self, date_interval: &NSDateInterval) -> bool;

        #[method(intersectsDateInterval:)]
        pub unsafe fn intersectsDateInterval(&self, date_interval: &NSDateInterval) -> bool;

        #[method_id(@__retain_semantics Other intersectionWithDateInterval:)]
        pub unsafe fn intersectionWithDateInterval(
            &self,
            date_interval: &NSDateInterval,
        ) -> Option<Retained<NSDateInterval>>;

        #[cfg(feature = "NSDate")]
        #[method(containsDate:)]
        pub unsafe fn containsDate(&self, date: &NSDate) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSDateInterval {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);