objc2_web_kit/generated/
WebResource.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// A WebResource represents a fully downloaded URL.
11    /// It includes the data of the resource as well as the metadata associated with the resource.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webresource?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct WebResource;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for WebResource {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for WebResource {}
25);
26
27unsafe impl CopyingHelper for WebResource {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for WebResource {}
33);
34
35impl WebResource {
36    extern_methods!(
37        /// The initializer for WebResource.
38        ///
39        /// Parameter `data`: The data of the resource.
40        ///
41        /// Parameter `URL`: The URL of the resource.
42        ///
43        /// Parameter `MIMEType`: The MIME type of the resource.
44        ///
45        /// Parameter `textEncodingName`: The text encoding name of the resource (can be nil).
46        ///
47        /// Parameter `frameName`: The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil).
48        ///
49        /// Returns: An initialized WebResource.
50        #[unsafe(method(initWithData:URL:MIMEType:textEncodingName:frameName:))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn initWithData_URL_MIMEType_textEncodingName_frameName(
53            this: Allocated<Self>,
54            data: Option<&NSData>,
55            url: Option<&NSURL>,
56            mime_type: Option<&NSString>,
57            text_encoding_name: Option<&NSString>,
58            frame_name: Option<&NSString>,
59        ) -> Option<Retained<Self>>;
60
61        /// The data of the resource.
62        #[unsafe(method(data))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn data(&self) -> Retained<NSData>;
65
66        /// The URL of the resource.
67        #[unsafe(method(URL))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
70
71        /// The MIME type of the resource.
72        #[unsafe(method(MIMEType))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn MIMEType(&self) -> Retained<NSString>;
75
76        /// The text encoding name of the resource (can be nil).
77        #[unsafe(method(textEncodingName))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn textEncodingName(&self) -> Retained<NSString>;
80
81        /// The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil).
82        #[unsafe(method(frameName))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn frameName(&self) -> Retained<NSString>;
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89impl WebResource {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[unsafe(method(new))]
96        #[unsafe(method_family = new)]
97        pub unsafe fn new() -> Retained<Self>;
98    );
99}