objc2-browser-engine-kit 0.3.2

Bindings to the BrowserEngineKit 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::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
use objc2_uniform_type_identifiers::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bedownloadmonitorlocation?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BEDownloadMonitorLocation;
);

unsafe impl Send for BEDownloadMonitorLocation {}

unsafe impl Sync for BEDownloadMonitorLocation {}

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

impl BEDownloadMonitorLocation {
    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>;

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

        #[unsafe(method(bookmarkData))]
        #[unsafe(method_family = none)]
        pub unsafe fn bookmarkData(&self) -> Retained<NSData>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bedownloadmonitor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BEDownloadMonitor;
);

unsafe impl Send for BEDownloadMonitor {}

unsafe impl Sync for BEDownloadMonitor {}

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

impl BEDownloadMonitor {
    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>;

        #[unsafe(method(initWithSourceURL:destinationURL:observedProgress:liveActivityAccessToken:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSourceURL_destinationURL_observedProgress_liveActivityAccessToken(
            this: Allocated<Self>,
            source_url: &NSURL,
            destination_url: &NSURL,
            observed_progress: &NSProgress,
            live_activity_access_token: &NSData,
        ) -> Retained<Self>;

        #[cfg(all(feature = "block2", feature = "objc2-uniform-type-identifiers"))]
        #[unsafe(method(useDownloadsFolderWithPlaceholderType:finalFileCreatedHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn useDownloadsFolderWithPlaceholderType_finalFileCreatedHandler(
            &self,
            r#type: Option<&UTType>,
            final_file_created_handler: &block2::DynBlock<dyn Fn(*mut BEDownloadMonitorLocation)>,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(beginMonitoring:))]
        #[unsafe(method_family = none)]
        pub unsafe fn beginMonitoring(
            &self,
            completion: &block2::DynBlock<dyn Fn(*mut BEDownloadMonitorLocation, *mut NSError)>,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(resumeMonitoring:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn resumeMonitoring_completionHandler(
            &self,
            url: &NSURL,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

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

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

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

        #[unsafe(method(createAccessToken))]
        #[unsafe(method_family = none)]
        pub unsafe fn createAccessToken() -> Option<Retained<NSData>>;
    );
}