use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct BADownloadState(pub NSInteger);
impl BADownloadState {
#[doc(alias = "BADownloadStateFailed")]
pub const Failed: Self = Self(-1);
#[doc(alias = "BADownloadStateCreated")]
pub const Created: Self = Self(0);
#[doc(alias = "BADownloadStateWaiting")]
pub const Waiting: Self = Self(1);
#[doc(alias = "BADownloadStateDownloading")]
pub const Downloading: Self = Self(2);
#[doc(alias = "BADownloadStateFinished")]
pub const Finished: Self = Self(3);
}
unsafe impl Encode for BADownloadState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for BADownloadState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type BADownloaderPriority = NSInteger;
extern "C" {
pub static BADownloaderPriorityMin: BADownloaderPriority;
}
extern "C" {
pub static BADownloaderPriorityDefault: BADownloaderPriority;
}
extern "C" {
pub static BADownloaderPriorityMax: BADownloaderPriority;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct BADownload;
);
unsafe impl Send for BADownload {}
unsafe impl Sync for BADownload {}
extern_conformance!(
unsafe impl NSCoding for BADownload {}
);
extern_conformance!(
unsafe impl NSCopying for BADownload {}
);
unsafe impl CopyingHelper for BADownload {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for BADownload {}
);
extern_conformance!(
unsafe impl NSSecureCoding for BADownload {}
);
impl BADownload {
extern_methods!(
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub unsafe fn state(&self) -> BADownloadState;
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Retained<NSString>;
#[unsafe(method(uniqueIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn uniqueIdentifier(&self) -> Retained<NSString>;
#[unsafe(method(priority))]
#[unsafe(method_family = none)]
pub unsafe fn priority(&self) -> BADownloaderPriority;
#[unsafe(method(isEssential))]
#[unsafe(method_family = none)]
pub unsafe fn isEssential(&self) -> bool;
#[unsafe(method(copyAsNonEssential))]
#[unsafe(method_family = copy)]
pub unsafe fn copyAsNonEssential(&self) -> Retained<Self>;
#[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>;
);
}