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
29extern_conformance!(
30    unsafe impl NSCoding for WebArchive {}
31);
32
33extern_conformance!(
34    unsafe impl NSCopying for WebArchive {}
35);
36
37unsafe impl CopyingHelper for WebArchive {
38    type Result = Self;
39}
40
41extern_conformance!(
42    unsafe impl NSObjectProtocol for WebArchive {}
43);
44
45impl WebArchive {
46    extern_methods!(
47        #[cfg(feature = "WebResource")]
48        /// The initializer for WebArchive.
49        ///
50        /// Parameter `mainResource`: The main resource of the archive.
51        ///
52        /// Parameter `subresources`: The subresources of the archive (can be nil).
53        ///
54        /// Parameter `subframeArchives`: The archives representing the subframes of the archive (can be nil).
55        ///
56        /// Returns: An initialized WebArchive.
57        #[deprecated]
58        #[unsafe(method(initWithMainResource:subresources:subframeArchives:))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn initWithMainResource_subresources_subframeArchives(
61            this: Allocated<Self>,
62            main_resource: Option<&WebResource>,
63            subresources: Option<&NSArray>,
64            subframe_archives: Option<&NSArray>,
65        ) -> Option<Retained<Self>>;
66
67        /// The initializer for creating a WebArchive from data.
68        ///
69        /// Parameter `data`: The data representing the archive. This can be obtained using WebArchive's data method.
70        ///
71        /// Returns: An initialized WebArchive.
72        #[deprecated]
73        #[unsafe(method(initWithData:))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn initWithData(
76            this: Allocated<Self>,
77            data: Option<&NSData>,
78        ) -> Option<Retained<Self>>;
79
80        #[cfg(feature = "WebResource")]
81        /// The main resource of the archive.
82        #[deprecated]
83        #[unsafe(method(mainResource))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn mainResource(&self) -> Option<Retained<WebResource>>;
86
87        /// The subresource of the archive (can be nil).
88        #[deprecated]
89        #[unsafe(method(subresources))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn subresources(&self) -> Retained<NSArray>;
92
93        /// The archives representing the subframes of the archive (can be nil).
94        #[deprecated]
95        #[unsafe(method(subframeArchives))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn subframeArchives(&self) -> Retained<NSArray>;
98
99        /// The data representation of the archive.
100        ///
101        /// 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
102        /// using WebArchivePboardType. To create a WebArchive using the returned data, call initWithData:.
103        #[deprecated]
104        #[unsafe(method(data))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn data(&self) -> Retained<NSData>;
107    );
108}
109
110/// Methods declared on superclass `NSObject`.
111impl WebArchive {
112    extern_methods!(
113        #[unsafe(method(init))]
114        #[unsafe(method_family = init)]
115        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
116
117        #[unsafe(method(new))]
118        #[unsafe(method_family = new)]
119        pub unsafe fn new() -> Retained<Self>;
120    );
121}