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