objc2-background-assets 0.3.2

Bindings to the BackgroundAssets 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_protocol!(
    /// An object that handles status updates when downloading an asset pack.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/bamanagedassetpackdownloaddelegate?language=objc)
    pub unsafe trait BAManagedAssetPackDownloadDelegate:
        NSObjectProtocol + Send + Sync
    {
        #[cfg(feature = "BAAssetPack")]
        /// Notifies the receiver that the download began or resumed after being paused.
        /// - Parameter assetPack: The asset pack.
        #[optional]
        #[unsafe(method(downloadOfAssetPackBegan:))]
        #[unsafe(method_family = none)]
        unsafe fn downloadOfAssetPackBegan(&self, asset_pack: &BAAssetPack);

        #[cfg(feature = "BAAssetPack")]
        /// Notifies the receiver that the download paused.
        /// - Parameter assetPack: The asset pack.
        #[optional]
        #[unsafe(method(downloadOfAssetPackPaused:))]
        #[unsafe(method_family = none)]
        unsafe fn downloadOfAssetPackPaused(&self, asset_pack: &BAAssetPack);

        #[cfg(feature = "BAAssetPack")]
        /// Notifies the receiver that the download is in progress.
        /// - Parameters:
        /// - assetPack: The asset pack.
        /// - progress: The download progress.
        #[optional]
        #[unsafe(method(downloadOfAssetPack:hasProgress:))]
        #[unsafe(method_family = none)]
        unsafe fn downloadOfAssetPack_hasProgress(
            &self,
            asset_pack: &BAAssetPack,
            progress: &NSProgress,
        );

        #[cfg(feature = "BAAssetPack")]
        /// Notifies the receiver that the download completed and that the asset pack is available locally.
        /// - Parameter assetPack: The asset pack.
        #[optional]
        #[unsafe(method(downloadOfAssetPackFinished:))]
        #[unsafe(method_family = none)]
        unsafe fn downloadOfAssetPackFinished(&self, asset_pack: &BAAssetPack);

        #[cfg(feature = "BAAssetPack")]
        /// Notifies the receiver that the download failed.
        /// - Parameters:
        /// - assetPack: The asset pack.
        /// - error: The error that occurred.
        #[optional]
        #[unsafe(method(downloadOfAssetPack:failedWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn downloadOfAssetPack_failedWithError(
            &self,
            asset_pack: &BAAssetPack,
            error: &NSError,
        );
    }
);