objc2-clock-kit 0.3.2

Bindings to the ClockKit 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 "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkwatchfacelibraryerrordomain?language=objc)
    pub static CLKWatchFaceLibraryErrorDomain: &'static NSString;
}

/// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkwatchfacelibraryerrorcode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLKWatchFaceLibraryErrorCode(pub NSInteger);
impl CLKWatchFaceLibraryErrorCode {
    #[doc(alias = "CLKWatchFaceLibraryErrorCodeNotFileURL")]
    pub const NotFileURL: Self = Self(1);
    #[doc(alias = "CLKWatchFaceLibraryErrorCodeInvalidFile")]
    pub const InvalidFile: Self = Self(2);
    #[doc(alias = "CLKWatchFaceLibraryErrorCodePermissionDenied")]
    pub const PermissionDenied: Self = Self(3);
    #[doc(alias = "CLKWatchFaceLibraryErrorCodeFaceNotAvailable")]
    pub const FaceNotAvailable: Self = Self(4);
    #[doc(alias = "CLKWatchFaceLibraryErrorCodeNoURL")]
    pub const NoURL: Self = Self(5);
}

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

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

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

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

impl CLKWatchFaceLibrary {
    extern_methods!(
        #[cfg(feature = "block2")]
        #[unsafe(method(addWatchFaceAtURL:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addWatchFaceAtURL_completionHandler(
            &self,
            file_url: &NSURL,
            handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );
    );
}

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