objc2_web_kit/generated/WebPlugin.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9mod private_NSObjectWebPlugIn {
10 pub trait Sealed {}
11}
12
13/// Category "WebPlugIn" on [`NSObject`].
14///
15/// WebPlugIn is an informal protocol that enables interaction between an application
16/// and web related plug-ins it may contain.
17#[doc(alias = "WebPlugIn")]
18pub unsafe trait NSObjectWebPlugIn:
19 ClassType + Sized + private_NSObjectWebPlugIn::Sealed
20{
21 extern_methods!(
22 /// Tell the plug-in to perform one-time initialization.
23 ///
24 /// This method must be only called once per instance of the plug-in
25 /// object and must be called before any other methods in this protocol.
26 #[unsafe(method(webPlugInInitialize))]
27 #[unsafe(method_family = none)]
28 unsafe fn webPlugInInitialize(&self);
29
30 /// Tell the plug-in to start normal operation.
31 ///
32 /// The plug-in usually begins drawing, playing sounds and/or
33 /// animation in this method. This method must be called before calling webPlugInStop.
34 /// This method may called more than once, provided that the application has
35 /// already called webPlugInInitialize and that each call to webPlugInStart is followed
36 /// by a call to webPlugInStop.
37 #[unsafe(method(webPlugInStart))]
38 #[unsafe(method_family = none)]
39 unsafe fn webPlugInStart(&self);
40
41 /// Tell the plug-in to stop normal operation.
42 ///
43 /// webPlugInStop must be called before this method. This method may be
44 /// called more than once, provided that the application has already called
45 /// webPlugInInitialize and that each call to webPlugInStop is preceded by a call to
46 /// webPlugInStart.
47 #[unsafe(method(webPlugInStop))]
48 #[unsafe(method_family = none)]
49 unsafe fn webPlugInStop(&self);
50
51 /// Tell the plug-in perform cleanup and prepare to be deallocated.
52 ///
53 /// The plug-in typically releases memory and other resources in this
54 /// method. If the plug-in has retained the WebPlugInContainer, it must release
55 /// it in this mehthod. This method must be only called once per instance of the
56 /// plug-in object. No other methods in this interface may be called after the
57 /// application has called webPlugInDestroy.
58 #[unsafe(method(webPlugInDestroy))]
59 #[unsafe(method_family = none)]
60 unsafe fn webPlugInDestroy(&self);
61
62 /// Informs the plug-in whether or not it is selected. This is typically
63 /// used to allow the plug-in to alter it's appearance when selected.
64 #[unsafe(method(webPlugInSetIsSelected:))]
65 #[unsafe(method_family = none)]
66 unsafe fn webPlugInSetIsSelected(&self, is_selected: bool);
67
68 /// objectForWebScript is used to expose a plug-in's scripting interface. The
69 /// methods of the object are exposed to the script environment. See the WebScripting
70 /// informal protocol for more details.
71 ///
72 /// Returns: Returns the object that exposes the plug-in's interface. The class of this
73 /// object can implement methods from the WebScripting informal protocol.
74 #[unsafe(method(objectForWebScript))]
75 #[unsafe(method_family = none)]
76 unsafe fn objectForWebScript(&self) -> Option<Retained<AnyObject>>;
77
78 /// Called on the plug-in when WebKit receives -connection:didReceiveResponse:
79 /// for the plug-in's main resource.
80 ///
81 /// This method is only sent to the plug-in if the
82 /// WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
83 ///
84 /// # Safety
85 ///
86 /// `response` might not allow `None`.
87 #[unsafe(method(webPlugInMainResourceDidReceiveResponse:))]
88 #[unsafe(method_family = none)]
89 unsafe fn webPlugInMainResourceDidReceiveResponse(&self, response: Option<&NSURLResponse>);
90
91 /// Called on the plug-in when WebKit recieves -connection:didReceiveData:
92 /// for the plug-in's main resource.
93 ///
94 /// This method is only sent to the plug-in if the
95 /// WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
96 ///
97 /// # Safety
98 ///
99 /// `data` might not allow `None`.
100 #[unsafe(method(webPlugInMainResourceDidReceiveData:))]
101 #[unsafe(method_family = none)]
102 unsafe fn webPlugInMainResourceDidReceiveData(&self, data: Option<&NSData>);
103
104 /// Called on the plug-in when WebKit receives -connection:didFailWithError:
105 /// for the plug-in's main resource.
106 ///
107 /// This method is only sent to the plug-in if the
108 /// WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
109 ///
110 /// # Safety
111 ///
112 /// `error` might not allow `None`.
113 #[unsafe(method(webPlugInMainResourceDidFailWithError:))]
114 #[unsafe(method_family = none)]
115 unsafe fn webPlugInMainResourceDidFailWithError(&self, error: Option<&NSError>);
116
117 /// Called on the plug-in when WebKit receives -connectionDidFinishLoading:
118 /// for the plug-in's main resource.
119 ///
120 /// This method is only sent to the plug-in if the
121 /// WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
122 #[unsafe(method(webPlugInMainResourceDidFinishLoading))]
123 #[unsafe(method_family = none)]
124 unsafe fn webPlugInMainResourceDidFinishLoading(&self);
125 );
126}
127
128impl private_NSObjectWebPlugIn::Sealed for NSObject {}
129unsafe impl NSObjectWebPlugIn for NSObject {}