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}
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 #[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
63impl 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}