objc2_watch_connectivity/generated/
WCSessionFile.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_class!(
11    /// Contains file information, such as the file's location and optional user info
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchconnectivity/wcsessionfile?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct WCSessionFile;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for WCSessionFile {}
21);
22
23impl WCSessionFile {
24    extern_methods!(
25        #[unsafe(method(fileURL))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn fileURL(&self) -> Retained<NSURL>;
28
29        #[unsafe(method(metadata))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
32    );
33}
34
35/// Methods declared on superclass `NSObject`.
36impl WCSessionFile {
37    extern_methods!(
38        #[unsafe(method(init))]
39        #[unsafe(method_family = init)]
40        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
41
42        #[unsafe(method(new))]
43        #[unsafe(method_family = new)]
44        pub unsafe fn new() -> Retained<Self>;
45    );
46}
47
48extern_class!(
49    /// Used to track a file being transferred.
50    ///
51    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchconnectivity/wcsessionfiletransfer?language=objc)
52    #[unsafe(super(NSObject))]
53    #[derive(Debug, PartialEq, Eq, Hash)]
54    pub struct WCSessionFileTransfer;
55);
56
57extern_conformance!(
58    unsafe impl NSObjectProtocol for WCSessionFileTransfer {}
59);
60
61impl WCSessionFileTransfer {
62    extern_methods!(
63        #[unsafe(method(file))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn file(&self) -> Retained<WCSessionFile>;
66
67        #[unsafe(method(progress))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn progress(&self) -> Retained<NSProgress>;
70
71        #[unsafe(method(isTransferring))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn isTransferring(&self) -> bool;
74
75        #[unsafe(method(cancel))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn cancel(&self);
78    );
79}
80
81/// Methods declared on superclass `NSObject`.
82impl WCSessionFileTransfer {
83    extern_methods!(
84        #[unsafe(method(init))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
87
88        #[unsafe(method(new))]
89        #[unsafe(method_family = new)]
90        pub unsafe fn new() -> Retained<Self>;
91    );
92}