objc2_web_kit/generated/
WebFrame.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// Every web page is represented by at least one WebFrame.  A WebFrame
12    /// has a WebFrameView and a WebDataSource.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webframe?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[deprecated]
18    pub struct WebFrame;
19);
20
21unsafe impl NSObjectProtocol for WebFrame {}
22
23impl WebFrame {
24    extern_methods!(
25        #[cfg(all(
26            feature = "WebFrameView",
27            feature = "WebView",
28            feature = "objc2-app-kit"
29        ))]
30        #[cfg(target_os = "macos")]
31        /// The designated initializer of WebFrame.
32        ///
33        /// WebFrames are normally created for you by the WebView.  You should
34        /// not need to invoke this method directly.
35        ///
36        /// Parameter `name`: The name of the frame.
37        ///
38        /// Parameter `view`: The WebFrameView for the frame.
39        ///
40        /// Parameter `webView`: The WebView that manages the frame.
41        ///
42        /// Returns: Returns an initialized WebFrame.
43        #[deprecated]
44        #[unsafe(method(initWithName:webFrameView:webView:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithName_webFrameView_webView(
47            this: Allocated<Self>,
48            name: Option<&NSString>,
49            view: Option<&WebFrameView>,
50            web_view: Option<&WebView>,
51        ) -> Option<Retained<Self>>;
52
53        /// The frame name.
54        #[deprecated]
55        #[unsafe(method(name))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn name(&self) -> Retained<NSString>;
58
59        #[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
60        #[cfg(target_os = "macos")]
61        /// The WebView for the document that includes this frame.
62        #[deprecated]
63        #[unsafe(method(webView))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn webView(&self, mtm: MainThreadMarker) -> Option<Retained<WebView>>;
66
67        #[cfg(all(feature = "WebFrameView", feature = "objc2-app-kit"))]
68        #[cfg(target_os = "macos")]
69        /// The WebFrameView for this frame.
70        #[deprecated]
71        #[unsafe(method(frameView))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn frameView(&self, mtm: MainThreadMarker) -> Option<Retained<WebFrameView>>;
74
75        #[cfg(all(
76            feature = "DOMDocument",
77            feature = "DOMNode",
78            feature = "DOMObject",
79            feature = "WebScriptObject"
80        ))]
81        /// The DOM document of the frame.
82        /// Returns nil if the frame does not contain a DOM document such as a standalone image.
83        #[deprecated]
84        #[unsafe(method(DOMDocument))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn DOMDocument(&self) -> Option<Retained<DOMDocument>>;
87
88        #[cfg(all(
89            feature = "DOMElement",
90            feature = "DOMHTMLElement",
91            feature = "DOMNode",
92            feature = "DOMObject",
93            feature = "WebScriptObject"
94        ))]
95        /// The frame element of the frame.
96        /// The class of the result is either DOMHTMLFrameElement, DOMHTMLIFrameElement or DOMHTMLObjectElement.
97        /// Returns nil if the frame is the main frame since there is no frame element for the frame in this case.
98        #[deprecated]
99        #[unsafe(method(frameElement))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn frameElement(&self) -> Option<Retained<DOMHTMLElement>>;
102
103        /// Parameter `request`: The web request to load.
104        #[deprecated]
105        #[unsafe(method(loadRequest:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn loadRequest(&self, request: Option<&NSURLRequest>);
108
109        /// Parameter `data`: The data to use for the main page of the document.
110        ///
111        /// Parameter `MIMEType`: The MIME type of the data.
112        ///
113        /// Parameter `encodingName`: The encoding of the data.
114        ///
115        /// Parameter `URL`: The base URL to apply to relative URLs within the document.
116        #[deprecated]
117        #[unsafe(method(loadData:MIMEType:textEncodingName:baseURL:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn loadData_MIMEType_textEncodingName_baseURL(
120            &self,
121            data: Option<&NSData>,
122            mime_type: Option<&NSString>,
123            encoding_name: Option<&NSString>,
124            url: Option<&NSURL>,
125        );
126
127        /// Parameter `string`: The string to use for the main page of the document.
128        ///
129        /// Parameter `URL`: The base URL to apply to relative URLs within the document.
130        #[deprecated]
131        #[unsafe(method(loadHTMLString:baseURL:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn loadHTMLString_baseURL(&self, string: Option<&NSString>, url: Option<&NSURL>);
134
135        /// Loads a page to display as a substitute for a URL that could not be reached.
136        ///
137        /// This allows clients to display page-loading errors in the webview itself.
138        /// This is typically called while processing the WebFrameLoadDelegate method
139        /// -webView:didFailProvisionalLoadWithError:forFrame: or one of the WebPolicyDelegate methods
140        /// -webView:decidePolicyForMIMEType:request:frame:decisionListener: or
141        /// -webView:unableToImplementPolicyWithError:frame:. If it is called from within one of those
142        /// three delegate methods then the back/forward list will be maintained appropriately.
143        ///
144        /// Parameter `string`: The string to use for the main page of the document.
145        ///
146        /// Parameter `baseURL`: The baseURL to apply to relative URLs within the document.
147        ///
148        /// Parameter `unreachableURL`: The URL for which this page will serve as alternate content.
149        #[deprecated]
150        #[unsafe(method(loadAlternateHTMLString:baseURL:forUnreachableURL:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn loadAlternateHTMLString_baseURL_forUnreachableURL(
153            &self,
154            string: Option<&NSString>,
155            base_url: Option<&NSURL>,
156            unreachable_url: Option<&NSURL>,
157        );
158
159        #[cfg(feature = "WebArchive")]
160        /// Causes WebFrame to load a WebArchive.
161        ///
162        /// Parameter `archive`: The archive to be loaded.
163        #[deprecated]
164        #[unsafe(method(loadArchive:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn loadArchive(&self, archive: Option<&WebArchive>);
167
168        #[cfg(feature = "WebDataSource")]
169        /// The datasource for this frame.
170        ///
171        /// Returns the committed data source.  Will return nil if the
172        /// provisional data source hasn't yet been loaded.
173        #[deprecated]
174        #[unsafe(method(dataSource))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn dataSource(&self) -> Option<Retained<WebDataSource>>;
177
178        #[cfg(feature = "WebDataSource")]
179        /// The provisional datasource of this frame.
180        ///
181        /// Will return the provisional data source.  The provisional data source will
182        /// be nil if no data source has been set on the frame, or the data source
183        /// has successfully transitioned to the committed data source.
184        #[deprecated]
185        #[unsafe(method(provisionalDataSource))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn provisionalDataSource(&self) -> Option<Retained<WebDataSource>>;
188
189        /// Stop any pending loads on the frame's data source,
190        /// and its children.
191        #[deprecated]
192        #[unsafe(method(stopLoading))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn stopLoading(&self);
195
196        /// Performs HTTP/1.1 end-to-end revalidation using cache-validating conditionals if possible.
197        #[deprecated]
198        #[unsafe(method(reload))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn reload(&self);
201
202        /// Performs HTTP/1.1 end-to-end reload.
203        #[deprecated]
204        #[unsafe(method(reloadFromOrigin))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn reloadFromOrigin(&self);
207
208        /// This method returns a frame with the given name. findFrameNamed returns self
209        /// for _self and _current, the parent frame for _parent and the main frame for _top.
210        /// findFrameNamed returns self for _parent and _top if the receiver is the mainFrame.
211        /// findFrameNamed first searches from the current frame to all descending frames then the
212        /// rest of the frames in the WebView. If still not found, findFrameNamed searches the
213        /// frames of the other WebViews.
214        ///
215        /// Parameter `name`: The name of the frame to find.
216        ///
217        /// Returns: The frame matching the provided name. nil if the frame is not found.
218        #[deprecated]
219        #[unsafe(method(findFrameNamed:))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn findFrameNamed(&self, name: Option<&NSString>) -> Option<Retained<WebFrame>>;
222
223        /// The frame containing this frame, or nil if this is a top level frame.
224        #[deprecated]
225        #[unsafe(method(parentFrame))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn parentFrame(&self) -> Option<Retained<WebFrame>>;
228
229        /// An array of WebFrame.
230        ///
231        /// The frames in the array are associated with a frame set or iframe.
232        #[deprecated]
233        #[unsafe(method(childFrames))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn childFrames(&self) -> Retained<NSArray>;
236
237        #[cfg(feature = "WebScriptObject")]
238        /// The WebScriptObject representing the frame's JavaScript window object.
239        #[deprecated]
240        #[unsafe(method(windowObject))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn windowObject(&self) -> Option<Retained<WebScriptObject>>;
243    );
244}
245
246/// Methods declared on superclass `NSObject`.
247impl WebFrame {
248    extern_methods!(
249        #[unsafe(method(init))]
250        #[unsafe(method_family = init)]
251        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
252
253        #[unsafe(method(new))]
254        #[unsafe(method_family = new)]
255        pub unsafe fn new() -> Retained<Self>;
256    );
257}