objc2_clock_kit/generated/
CLKWatchFaceLibrary.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkwatchfacelibraryerrordomain?language=objc)
12    pub static CLKWatchFaceLibraryErrorDomain: &'static NSString;
13}
14
15/// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkwatchfacelibraryerrorcode?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct CLKWatchFaceLibraryErrorCode(pub NSInteger);
20impl CLKWatchFaceLibraryErrorCode {
21    #[doc(alias = "CLKWatchFaceLibraryErrorCodeNotFileURL")]
22    pub const NotFileURL: Self = Self(1);
23    #[doc(alias = "CLKWatchFaceLibraryErrorCodeInvalidFile")]
24    pub const InvalidFile: Self = Self(2);
25    #[doc(alias = "CLKWatchFaceLibraryErrorCodePermissionDenied")]
26    pub const PermissionDenied: Self = Self(3);
27    #[doc(alias = "CLKWatchFaceLibraryErrorCodeFaceNotAvailable")]
28    pub const FaceNotAvailable: Self = Self(4);
29}
30
31unsafe impl Encode for CLKWatchFaceLibraryErrorCode {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for CLKWatchFaceLibraryErrorCode {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkwatchfacelibrary?language=objc)
41    #[unsafe(super(NSObject))]
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    pub struct CLKWatchFaceLibrary;
44);
45
46extern_conformance!(
47    unsafe impl NSObjectProtocol for CLKWatchFaceLibrary {}
48);
49
50impl CLKWatchFaceLibrary {
51    extern_methods!(
52        #[cfg(feature = "block2")]
53        #[unsafe(method(addWatchFaceAtURL:completionHandler:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn addWatchFaceAtURL_completionHandler(
56            &self,
57            file_url: &NSURL,
58            handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
59        );
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl CLKWatchFaceLibrary {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}