(informal protocol)
| Framework | /System/Library/Frameworks/WebKit.framework |
| Availability | Available in Mac OS X v10.3.9 and later. |
| Declared in | WebPlugin.h |
| Companion guides |
The WebPlugIn informal protocol defines methods that enable interaction between an application using the WebKit framework and any WebKit-based plug-ins it may use.
– objectForWebScript required method
– webPlugInSetIsSelected: required method
– webPlugInDestroy required method
– webPlugInInitialize required method
– webPlugInStart required method
– webPlugInStop required method
– webPlugInMainResourceDidFailWithError: required method
– webPlugInMainResourceDidFinishLoading required method
– webPlugInMainResourceDidReceiveData: required method
– webPlugInMainResourceDidReceiveResponse: required method
Returns an object that exposes the plug-in’s scripting interface. (required)
- (id)objectForWebScript
An object representing the plug-in’s scripting interface.
The methods of the object are exposed to the script environment. Messages sent to the returned object will be invoked in the scripting environment. See the WebScripting Protocol Reference informal protocol for more details.
WebPlugin.hPrepares the plug-in for deallocation. (required)
- (void)webPlugInDestroy
Typically, this method releases the memory and other resources used by the plug-in. For example, if the plug-in retained a WebPlugInContainer object, this method should release that object. Do not send any other messages to the plug-in after invoking this method, because calling this method destroys the plug-in. No other methods in this interface may be called after the application has called this method.
WebPlugin.hInitializes the plug-in. (required)
- (void)webPlugInInitialize
Tells the plug-in to perform one-time initialization. This method must be called only once per instance of the plug-in object, before any other methods in the protocol are called.
WebPlugin.hInvoked when an error occurs loading the main resource. (required)
- (void)webPlugInMainResourceDidFailWithError:(NSError *)error
An error object containing details of why the connection failed to load the request successfully.
This message is invoked when the underlying NSURLConnection object for the main resource sends the connection:didFailWithError: message to its delegate.
WebPlugin.hInvoked when the connection successfully finishes loading data. (required)
- (void)webPlugInMainResourceDidFinishLoading
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connectionDidFinishLoading: message to its delegate.
WebPlugin.hInvoked when the connection loads data incrementally. (required)
- (void)webPlugInMainResourceDidReceiveData:(NSData *)data
The newly available data.
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connection:didReceiveData: message to its delegate.
WebPlugin.hInvoked when the connection receives sufficient data to construct the URL response for its request. (required)
- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response
The URL response for the connection's request.
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connection:didReceiveResponse: message to its delegate.
WebPlugin.hControls plug-in behavior based on its selection. (required)
- (void)webPlugInSetIsSelected:(BOOL)selected
If YES, the plug-in is currently selected. Otherwise, it is not selected.
This may be used, for example, to change the plug-in’s appearance when it is selected by the user.
WebPlugin.hTells the plug-in to start normal operation. (required)
- (void)webPlugInStart
The plug-in usually begins its primary task (such as drawing, playing sounds, or animating) in this method. This method may be called more than once, provided that the application has already called webPlugInInitialize and that each call to this method is followed later by a call to webPlugInStop.
WebPlugin.hTells the plug-in to stop normal operation. (required)
- (void)webPlugInStop
This method may be called more than once, provided that the application has already called webPlugInInitialize and that each call to this method is preceded by a call to webPlugInStart.
WebPlugin.hLast updated: 2009-03-27