objc2_ui_kit/generated/
UIScreenshotService.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
17 #[thread_kind = MainThreadOnly]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 pub struct UIScreenshotService;
20);
21
22extern_conformance!(
23 unsafe impl NSObjectProtocol for UIScreenshotService {}
24);
25
26impl UIScreenshotService {
27 extern_methods!(
28 #[unsafe(method(init))]
29 #[unsafe(method_family = init)]
30 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
31
32 #[unsafe(method(new))]
33 #[unsafe(method_family = new)]
34 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
35
36 #[unsafe(method(delegate))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn delegate(
40 &self,
41 ) -> Option<Retained<ProtocolObject<dyn UIScreenshotServiceDelegate>>>;
42
43 #[unsafe(method(setDelegate:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn setDelegate(
48 &self,
49 delegate: Option<&ProtocolObject<dyn UIScreenshotServiceDelegate>>,
50 );
51
52 #[cfg(all(
53 feature = "UIResponder",
54 feature = "UIScene",
55 feature = "UIWindowScene"
56 ))]
57 #[unsafe(method(windowScene))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn windowScene(&self) -> Option<Retained<UIWindowScene>>;
61 );
62}
63
64#[cfg(all(
66 feature = "UIResponder",
67 feature = "UIScene",
68 feature = "UIWindowScene"
69))]
70impl UIWindowScene {
71 extern_methods!(
72 #[unsafe(method(screenshotService))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn screenshotService(&self) -> Option<Retained<UIScreenshotService>>;
78 );
79}
80
81extern_protocol!(
82 pub unsafe trait UIScreenshotServiceDelegate: NSObjectProtocol + MainThreadOnly {
84 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
85 #[optional]
94 #[unsafe(method(screenshotService:generatePDFRepresentationWithCompletion:))]
95 #[unsafe(method_family = none)]
96 unsafe fn screenshotService_generatePDFRepresentationWithCompletion(
97 &self,
98 screenshot_service: &UIScreenshotService,
99 completion_handler: &block2::DynBlock<dyn Fn(*mut NSData, NSInteger, CGRect)>,
100 );
101 }
102);