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
22unsafe impl NSObjectProtocol for UIScreenshotService {}
23
24impl UIScreenshotService {
25 extern_methods!(
26 #[unsafe(method(init))]
27 #[unsafe(method_family = init)]
28 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30 #[unsafe(method(new))]
31 #[unsafe(method_family = new)]
32 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
33
34 #[unsafe(method(delegate))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn delegate(
38 &self,
39 ) -> Option<Retained<ProtocolObject<dyn UIScreenshotServiceDelegate>>>;
40
41 #[unsafe(method(setDelegate:))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn setDelegate(
46 &self,
47 delegate: Option<&ProtocolObject<dyn UIScreenshotServiceDelegate>>,
48 );
49
50 #[cfg(all(
51 feature = "UIResponder",
52 feature = "UIScene",
53 feature = "UIWindowScene"
54 ))]
55 #[unsafe(method(windowScene))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn windowScene(&self) -> Option<Retained<UIWindowScene>>;
59 );
60}
61
62#[cfg(all(
64 feature = "UIResponder",
65 feature = "UIScene",
66 feature = "UIWindowScene"
67))]
68impl UIWindowScene {
69 extern_methods!(
70 #[unsafe(method(screenshotService))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn screenshotService(&self) -> Option<Retained<UIScreenshotService>>;
76 );
77}
78
79extern_protocol!(
80 pub unsafe trait UIScreenshotServiceDelegate: NSObjectProtocol + MainThreadOnly {
82 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
83 #[optional]
92 #[unsafe(method(screenshotService:generatePDFRepresentationWithCompletion:))]
93 #[unsafe(method_family = none)]
94 unsafe fn screenshotService_generatePDFRepresentationWithCompletion(
95 &self,
96 screenshot_service: &UIScreenshotService,
97 completion_handler: &block2::Block<dyn Fn(*mut NSData, NSInteger, CGRect)>,
98 );
99 }
100);