objc2-watch-connectivity 0.3.2

Bindings to the WatchConnectivity 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_class!(
    /// Contains file information, such as the file's location and optional user info
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchconnectivity/wcsessionfile?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WCSessionFile;
);

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

impl WCSessionFile {
    extern_methods!(
        #[unsafe(method(fileURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn fileURL(&self) -> Retained<NSURL>;

        #[unsafe(method(metadata))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadata(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
    );
}

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

extern_class!(
    /// Used to track a file being transferred.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchconnectivity/wcsessionfiletransfer?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WCSessionFileTransfer;
);

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

impl WCSessionFileTransfer {
    extern_methods!(
        #[unsafe(method(file))]
        #[unsafe(method_family = none)]
        pub unsafe fn file(&self) -> Retained<WCSessionFile>;

        #[unsafe(method(progress))]
        #[unsafe(method_family = none)]
        pub unsafe fn progress(&self) -> Retained<NSProgress>;

        #[unsafe(method(isTransferring))]
        #[unsafe(method_family = none)]
        pub unsafe fn isTransferring(&self) -> bool;

        #[unsafe(method(cancel))]
        #[unsafe(method_family = none)]
        pub unsafe fn cancel(&self);
    );
}

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