objc2-watch-kit 0.3.2

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

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfacepicker?language=objc)
    #[unsafe(super(WKInterfaceObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "WKInterfaceObject")]
    pub struct WKInterfacePicker;
);

#[cfg(feature = "WKInterfaceObject")]
extern_conformance!(
    unsafe impl NSObjectProtocol for WKInterfacePicker {}
);

#[cfg(feature = "WKInterfaceObject")]
impl WKInterfacePicker {
    extern_methods!(
        #[unsafe(method(focus))]
        #[unsafe(method_family = none)]
        pub unsafe fn focus(&self);

        #[unsafe(method(resignFocus))]
        #[unsafe(method_family = none)]
        pub unsafe fn resignFocus(&self);

        #[unsafe(method(setSelectedItemIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectedItemIndex(&self, item_index: NSInteger);

        #[unsafe(method(setItems:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setItems(&self, items: Option<&NSArray<WKPickerItem>>);

        #[cfg(feature = "WKInterfaceImage")]
        /// # Safety
        ///
        /// `coordinated_animations` generic must implement WKImageAnimatable.
        #[unsafe(method(setCoordinatedAnimations:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCoordinatedAnimations(
            &self,
            coordinated_animations: Option<&NSArray<WKInterfaceObject>>,
        );

        #[unsafe(method(setEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEnabled(&self, enabled: bool);
    );
}

/// Methods declared on superclass `WKInterfaceObject`.
#[cfg(feature = "WKInterfaceObject")]
impl WKInterfacePicker {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "WKInterfaceObject")]
impl WKInterfacePicker {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkpickeritem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WKPickerItem;
);

extern_conformance!(
    unsafe impl NSCoding for WKPickerItem {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for WKPickerItem {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for WKPickerItem {}
);

impl WKPickerItem {
    extern_methods!(
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub unsafe fn title(&self) -> Option<Retained<NSString>>;

        /// Setter for [`title`][Self::title].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTitle(&self, title: Option<&NSString>);

        #[unsafe(method(caption))]
        #[unsafe(method_family = none)]
        pub unsafe fn caption(&self) -> Option<Retained<NSString>>;

        /// Setter for [`caption`][Self::caption].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCaption:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCaption(&self, caption: Option<&NSString>);

        #[cfg(feature = "WKImage")]
        #[unsafe(method(accessoryImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn accessoryImage(&self) -> Option<Retained<WKImage>>;

        #[cfg(feature = "WKImage")]
        /// Setter for [`accessoryImage`][Self::accessoryImage].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAccessoryImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessoryImage(&self, accessory_image: Option<&WKImage>);

        #[cfg(feature = "WKImage")]
        #[unsafe(method(contentImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn contentImage(&self) -> Option<Retained<WKImage>>;

        #[cfg(feature = "WKImage")]
        /// Setter for [`contentImage`][Self::contentImage].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setContentImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContentImage(&self, content_image: Option<&WKImage>);
    );
}

/// Methods declared on superclass `NSObject`.
impl WKPickerItem {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}