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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfaceobjecthorizontalalignment?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKInterfaceObjectHorizontalAlignment(pub NSInteger);
impl WKInterfaceObjectHorizontalAlignment {
    #[doc(alias = "WKInterfaceObjectHorizontalAlignmentLeft")]
    pub const Left: Self = Self(0);
    #[doc(alias = "WKInterfaceObjectHorizontalAlignmentCenter")]
    pub const Center: Self = Self(1);
    #[doc(alias = "WKInterfaceObjectHorizontalAlignmentRight")]
    pub const Right: Self = Self(2);
}

unsafe impl Encode for WKInterfaceObjectHorizontalAlignment {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKInterfaceObjectHorizontalAlignment {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfaceobjectverticalalignment?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKInterfaceObjectVerticalAlignment(pub NSInteger);
impl WKInterfaceObjectVerticalAlignment {
    #[doc(alias = "WKInterfaceObjectVerticalAlignmentTop")]
    pub const Top: Self = Self(0);
    #[doc(alias = "WKInterfaceObjectVerticalAlignmentCenter")]
    pub const Center: Self = Self(1);
    #[doc(alias = "WKInterfaceObjectVerticalAlignmentBottom")]
    pub const Bottom: Self = Self(2);
}

unsafe impl Encode for WKInterfaceObjectVerticalAlignment {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKInterfaceObjectVerticalAlignment {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

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

impl WKInterfaceObject {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(setHidden:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHidden(&self, hidden: bool);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(setAlpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAlpha(&self, alpha: CGFloat);

        #[cfg(feature = "WKInterfaceDevice")]
        #[unsafe(method(setSemanticContentAttribute:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSemanticContentAttribute(
            &self,
            semantic_content_attribute: WKInterfaceSemanticContentAttribute,
        );

        #[unsafe(method(setHorizontalAlignment:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHorizontalAlignment(
            &self,
            horizontal_alignment: WKInterfaceObjectHorizontalAlignment,
        );

        #[unsafe(method(setVerticalAlignment:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVerticalAlignment(
            &self,
            vertical_alignment: WKInterfaceObjectVerticalAlignment,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(setWidth:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setWidth(&self, width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(setHeight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHeight(&self, height: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(setRelativeWidth:withAdjustment:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRelativeWidth_withAdjustment(&self, width: CGFloat, adjustment: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(setRelativeHeight:withAdjustment:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRelativeHeight_withAdjustment(&self, height: CGFloat, adjustment: CGFloat);

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

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

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

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

/// WKAccessibility.
impl WKInterfaceObject {
    extern_methods!(
        #[unsafe(method(setAccessibilityIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessibilityIdentifier(
            &self,
            accessibility_identifier: Option<&NSString>,
        );

        #[unsafe(method(setAccessibilityLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessibilityLabel(&self, accessibility_label: Option<&NSString>);

        #[unsafe(method(setAccessibilityHint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessibilityHint(&self, accessibility_hint: Option<&NSString>);

        #[unsafe(method(setAccessibilityValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessibilityValue(&self, accessibility_value: Option<&NSString>);

        #[unsafe(method(setIsAccessibilityElement:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIsAccessibilityElement(&self, is_accessibility_element: bool);

        #[cfg(feature = "objc2-ui-kit")]
        #[unsafe(method(setAccessibilityTraits:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessibilityTraits(&self, accessibility_traits: UIAccessibilityTraits);

        #[unsafe(method(setAccessibilityImageRegions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccessibilityImageRegions(
            &self,
            accessibility_image_regions: &NSArray<WKAccessibilityImageRegion>,
        );
    );
}

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

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

impl WKAccessibilityImageRegion {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(frame))]
        #[unsafe(method_family = none)]
        pub unsafe fn frame(&self) -> CGRect;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`frame`][Self::frame].
        #[unsafe(method(setFrame:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFrame(&self, frame: CGRect);

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

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

/// Methods declared on superclass `NSObject`.
impl WKAccessibilityImageRegion {
    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>;
    );
}