objc2_clock_kit/generated/
CLKWatchFaceLibrary.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static CLKWatchFaceLibraryErrorDomain: &'static NSString;
13}
14
15#[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 #[doc(alias = "CLKWatchFaceLibraryErrorCodeNoURL")]
30 pub const NoURL: Self = Self(5);
31}
32
33unsafe impl Encode for CLKWatchFaceLibraryErrorCode {
34 const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for CLKWatchFaceLibraryErrorCode {
38 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41extern_class!(
42 #[unsafe(super(NSObject))]
44 #[derive(Debug, PartialEq, Eq, Hash)]
45 pub struct CLKWatchFaceLibrary;
46);
47
48extern_conformance!(
49 unsafe impl NSObjectProtocol for CLKWatchFaceLibrary {}
50);
51
52impl CLKWatchFaceLibrary {
53 extern_methods!(
54 #[cfg(feature = "block2")]
55 #[unsafe(method(addWatchFaceAtURL:completionHandler:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn addWatchFaceAtURL_completionHandler(
58 &self,
59 file_url: &NSURL,
60 handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
61 );
62 );
63}
64
65impl CLKWatchFaceLibrary {
67 extern_methods!(
68 #[unsafe(method(init))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
71
72 #[unsafe(method(new))]
73 #[unsafe(method_family = new)]
74 pub unsafe fn new() -> Retained<Self>;
75 );
76}