1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/wksnapshotconfiguration?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKSnapshotConfiguration;
);
extern_conformance!(
unsafe impl NSCopying for WKSnapshotConfiguration {}
);
unsafe impl CopyingHelper for WKSnapshotConfiguration {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for WKSnapshotConfiguration {}
);
impl WKSnapshotConfiguration {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
/// The rect to snapshot in view coordinates.
///
/// This rect should be contained within WKWebView's bounds. If the rect is set to the
/// null rect, the view's bounds will be used. The initial value is the null rect.
#[unsafe(method(rect))]
#[unsafe(method_family = none)]
pub unsafe fn rect(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`rect`][Self::rect].
#[unsafe(method(setRect:))]
#[unsafe(method_family = none)]
pub unsafe fn setRect(&self, rect: CGRect);
/// Specify a custom width to control the size of image you get back. The height will be
/// computed to maintain the aspect ratio established by rect.
///
/// snapshotWidth represents the width in points. If the snapshotWidth is nil, rect's
/// width will be used.
#[unsafe(method(snapshotWidth))]
#[unsafe(method_family = none)]
pub unsafe fn snapshotWidth(&self) -> Option<Retained<NSNumber>>;
/// Setter for [`snapshotWidth`][Self::snapshotWidth].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setSnapshotWidth:))]
#[unsafe(method_family = none)]
pub unsafe fn setSnapshotWidth(&self, snapshot_width: Option<&NSNumber>);
/// A Boolean value that specifies whether the snapshot should be taken after recent
/// changes have been incorporated. The value NO will capture the screen in its current state,
/// which might not include recent changes.
///
/// The default value is YES.
#[unsafe(method(afterScreenUpdates))]
#[unsafe(method_family = none)]
pub unsafe fn afterScreenUpdates(&self) -> bool;
/// Setter for [`afterScreenUpdates`][Self::afterScreenUpdates].
#[unsafe(method(setAfterScreenUpdates:))]
#[unsafe(method_family = none)]
pub unsafe fn setAfterScreenUpdates(&self, after_screen_updates: bool);
);
}
/// Methods declared on superclass `NSObject`.
impl WKSnapshotConfiguration {
extern_methods!(
#[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(mtm: MainThreadMarker) -> Retained<Self>;
);
}