objc2_app_kit/generated/
NSFontAssetRequest.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSFontAssetRequestOptions(pub NSUInteger);
15bitflags::bitflags! {
16 impl NSFontAssetRequestOptions: NSUInteger {
17 #[doc(alias = "NSFontAssetRequestOptionUsesStandardUI")]
18 const UsesStandardUI = 1<<0;
19 }
20}
21
22unsafe impl Encode for NSFontAssetRequestOptions {
23 const ENCODING: Encoding = NSUInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NSFontAssetRequestOptions {
27 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31 #[unsafe(super(NSObject))]
33 #[derive(Debug, PartialEq, Eq, Hash)]
34 pub struct NSFontAssetRequest;
35);
36
37unsafe impl NSObjectProtocol for NSFontAssetRequest {}
38
39unsafe impl NSProgressReporting for NSFontAssetRequest {}
40
41impl NSFontAssetRequest {
42 extern_methods!(
43 #[unsafe(method(init))]
44 #[unsafe(method_family = init)]
45 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
46
47 #[cfg(feature = "NSFontDescriptor")]
48 #[unsafe(method(initWithFontDescriptors:options:))]
49 #[unsafe(method_family = init)]
50 pub unsafe fn initWithFontDescriptors_options(
51 this: Allocated<Self>,
52 font_descriptors: &NSArray<NSFontDescriptor>,
53 options: NSFontAssetRequestOptions,
54 ) -> Retained<Self>;
55
56 #[cfg(feature = "NSFontDescriptor")]
57 #[unsafe(method(downloadedFontDescriptors))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn downloadedFontDescriptors(&self) -> Retained<NSArray<NSFontDescriptor>>;
60
61 #[unsafe(method(progress))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn progress(&self) -> Retained<NSProgress>;
64
65 #[cfg(feature = "block2")]
66 #[unsafe(method(downloadFontAssetsWithCompletionHandler:))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn downloadFontAssetsWithCompletionHandler(
69 &self,
70 completion_handler: &block2::Block<dyn Fn(*mut NSError) -> Bool>,
71 );
72 );
73}
74
75impl NSFontAssetRequest {
77 extern_methods!(
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new() -> Retained<Self>;
81 );
82}