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_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSTimeZone")]
    pub struct NSTimeZone;

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

#[cfg(feature = "Foundation_NSTimeZone")]
unsafe impl Send for NSTimeZone {}

#[cfg(feature = "Foundation_NSTimeZone")]
unsafe impl Sync for NSTimeZone {}

#[cfg(feature = "Foundation_NSTimeZone")]
unsafe impl NSCoding for NSTimeZone {}

#[cfg(feature = "Foundation_NSTimeZone")]
unsafe impl NSCopying for NSTimeZone {}

#[cfg(feature = "Foundation_NSTimeZone")]
unsafe impl NSObjectProtocol for NSTimeZone {}

#[cfg(feature = "Foundation_NSTimeZone")]
unsafe impl NSSecureCoding for NSTimeZone {}

extern_methods!(
    #[cfg(feature = "Foundation_NSTimeZone")]
    unsafe impl NSTimeZone {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Other data)]
        pub unsafe fn data(&self) -> Id<NSData>;

        #[cfg(feature = "Foundation_NSDate")]
        #[method(secondsFromGMTForDate:)]
        pub unsafe fn secondsFromGMTForDate(&self, a_date: &NSDate) -> NSInteger;

        #[cfg(all(feature = "Foundation_NSDate", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other abbreviationForDate:)]
        pub unsafe fn abbreviationForDate(&self, a_date: &NSDate) -> Option<Id<NSString>>;

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

        #[cfg(feature = "Foundation_NSDate")]
        #[method(daylightSavingTimeOffsetForDate:)]
        pub unsafe fn daylightSavingTimeOffsetForDate(&self, a_date: &NSDate) -> NSTimeInterval;

        #[cfg(feature = "Foundation_NSDate")]
        #[method_id(@__retain_semantics Other nextDaylightSavingTimeTransitionAfterDate:)]
        pub unsafe fn nextDaylightSavingTimeTransitionAfterDate(
            &self,
            a_date: &NSDate,
        ) -> Option<Id<NSDate>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSTimeZone")]
    unsafe impl NSTimeZone {
        #[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>;
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSTimeZoneNameStyle {
        NSTimeZoneNameStyleStandard = 0,
        NSTimeZoneNameStyleShortStandard = 1,
        NSTimeZoneNameStyleDaylightSaving = 2,
        NSTimeZoneNameStyleShortDaylightSaving = 3,
        NSTimeZoneNameStyleGeneric = 4,
        NSTimeZoneNameStyleShortGeneric = 5,
    }
);

extern_methods!(
    /// NSExtendedTimeZone
    #[cfg(feature = "Foundation_NSTimeZone")]
    unsafe impl NSTimeZone {
        #[method_id(@__retain_semantics Other systemTimeZone)]
        pub unsafe fn systemTimeZone() -> Id<NSTimeZone>;

        #[method(resetSystemTimeZone)]
        pub unsafe fn resetSystemTimeZone();

        #[method_id(@__retain_semantics Other defaultTimeZone)]
        pub unsafe fn defaultTimeZone() -> Id<NSTimeZone>;

        #[method(setDefaultTimeZone:)]
        pub unsafe fn setDefaultTimeZone(default_time_zone: &NSTimeZone);

        #[method_id(@__retain_semantics Other localTimeZone)]
        pub unsafe fn localTimeZone() -> Id<NSTimeZone>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other knownTimeZoneNames)]
        pub unsafe fn knownTimeZoneNames() -> Id<NSArray<NSString>>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other abbreviationDictionary)]
        pub unsafe fn abbreviationDictionary() -> Id<NSDictionary<NSString, NSString>>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method(setAbbreviationDictionary:)]
        pub unsafe fn setAbbreviationDictionary(
            abbreviation_dictionary: &NSDictionary<NSString, NSString>,
        );

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

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

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

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

        #[method(daylightSavingTimeOffset)]
        pub unsafe fn daylightSavingTimeOffset(&self) -> NSTimeInterval;

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

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

        #[method(isEqualToTimeZone:)]
        pub unsafe fn isEqualToTimeZone(&self, a_time_zone: &NSTimeZone) -> bool;

        #[cfg(all(feature = "Foundation_NSLocale", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other localizedName:locale:)]
        pub unsafe fn localizedName_locale(
            &self,
            style: NSTimeZoneNameStyle,
            locale: Option<&NSLocale>,
        ) -> Option<Id<NSString>>;
    }
);

extern_methods!(
    /// NSTimeZoneCreation
    #[cfg(feature = "Foundation_NSTimeZone")]
    unsafe impl NSTimeZone {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other timeZoneWithName:)]
        pub unsafe fn timeZoneWithName(tz_name: &NSString) -> Option<Id<Self>>;

        #[cfg(all(feature = "Foundation_NSData", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other timeZoneWithName:data:)]
        pub unsafe fn timeZoneWithName_data(
            tz_name: &NSString,
            a_data: Option<&NSData>,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initWithName:)]
        pub unsafe fn initWithName(this: Allocated<Self>, tz_name: &NSString) -> Option<Id<Self>>;

        #[cfg(all(feature = "Foundation_NSData", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Init initWithName:data:)]
        pub unsafe fn initWithName_data(
            this: Allocated<Self>,
            tz_name: &NSString,
            a_data: Option<&NSData>,
        ) -> Option<Id<Self>>;

        #[method_id(@__retain_semantics Other timeZoneForSecondsFromGMT:)]
        pub unsafe fn timeZoneForSecondsFromGMT(seconds: NSInteger) -> Id<Self>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other timeZoneWithAbbreviation:)]
        pub unsafe fn timeZoneWithAbbreviation(abbreviation: &NSString) -> Option<Id<Self>>;
    }
);

extern_static!(NSSystemTimeZoneDidChangeNotification: &'static NSNotificationName);