objc2_web_kit/generated/
WebArchive.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 "C" {
10    /// The pasteboard type constant used when adding or accessing a WebArchive on the pasteboard.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webarchivepboardtype?language=objc)
13    pub static WebArchivePboardType: Option<&'static NSString>;
14}
15
16extern_class!(
17    /// WebArchive represents a main resource as well as all the subresources and subframes associated with the main resource.
18    /// The main resource can be an entire web page, a portion of a web page, or some other kind of data such as an image.
19    /// This class can be used for saving standalone web pages, representing portions of a web page on the pasteboard, or any other
20    /// application where one class is needed to represent rich web content.
21    ///
22    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webarchive?language=objc)
23    #[unsafe(super(NSObject))]
24    #[derive(Debug, PartialEq, Eq, Hash)]
25    #[deprecated]
26    pub struct WebArchive;
27);
28
29unsafe impl NSCoding for WebArchive {}
30
31unsafe impl NSCopying for WebArchive {}
32
33unsafe impl CopyingHelper for WebArchive {
34    type Result = Self;
35}
36
37unsafe impl NSObjectProtocol for WebArchive {}
38
39impl WebArchive {
40    extern_methods!(
41        #[cfg(feature = "WebResource")]
42        /// The initializer for WebArchive.
43        ///
44        /// Parameter `mainResource`: The main resource of the archive.
45        ///
46        /// Parameter `subresources`: The subresources of the archive (can be nil).
47        ///
48        /// Parameter `subframeArchives`: The archives representing the subframes of the archive (can be nil).
49        ///
50        /// Returns: An initialized WebArchive.
51        #[deprecated]
52        #[unsafe(method(initWithMainResource:subresources:subframeArchives:))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn initWithMainResource_subresources_subframeArchives(
55            this: Allocated<Self>,
56            main_resource: Option<&WebResource>,
57            subresources: Option<&NSArray>,
58            subframe_archives: Option<&NSArray>,
59        ) -> Option<Retained<Self>>;
60
61        /// The initializer for creating a WebArchive from data.
62        ///
63        /// Parameter `data`: The data representing the archive. This can be obtained using WebArchive's data method.
64        ///
65        /// Returns: An initialized WebArchive.
66        #[deprecated]
67        #[unsafe(method(initWithData:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithData(
70            this: Allocated<Self>,
71            data: Option<&NSData>,
72        ) -> Option<Retained<Self>>;
73
74        #[cfg(feature = "WebResource")]
75        /// The main resource of the archive.
76        #[deprecated]
77        #[unsafe(method(mainResource))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn mainResource(&self) -> Option<Retained<WebResource>>;
80
81        /// The subresource of the archive (can be nil).
82        #[deprecated]
83        #[unsafe(method(subresources))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn subresources(&self) -> Retained<NSArray>;
86
87        /// The archives representing the subframes of the archive (can be nil).
88        #[deprecated]
89        #[unsafe(method(subframeArchives))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn subframeArchives(&self) -> Retained<NSArray>;
92
93        /// The data representation of the archive.
94        ///
95        /// The data returned by this method can be used to save a web archive to a file or to place a web archive on the pasteboard
96        /// using WebArchivePboardType. To create a WebArchive using the returned data, call initWithData:.
97        #[deprecated]
98        #[unsafe(method(data))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn data(&self) -> Retained<NSData>;
101    );
102}
103
104/// Methods declared on superclass `NSObject`.
105impl WebArchive {
106    extern_methods!(
107        #[unsafe(method(init))]
108        #[unsafe(method_family = init)]
109        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
110
111        #[unsafe(method(new))]
112        #[unsafe(method_family = new)]
113        pub unsafe fn new() -> Retained<Self>;
114    );
115}