Mac Developer Library

Developer

WebKit Framework Reference WebPlugInViewFactory Protocol Reference

Options
Deployment Target:

On This Page
Language:

WebPlugInViewFactory

Inheritance


Not Applicable

Conforms To


Import Statement


Swift

import WebKit

Objective-C

@import WebKit;

Availability


Available in OS X v10.3.9 and later.

A WebPlugInViewFactory object is used to create an NSView for a plug-in. The principal class in a plug-in bundle must conform to this protocol.

  • Creates a new plug-in view.

    Declaration

    Swift

    static func plugInViewWithArguments(_ arguments: [NSObject : AnyObject]!) -> NSView!

    Objective-C

    + (NSView *)plugInViewWithArguments:(NSDictionary *)arguments

    Parameters

    arguments

    Arguments used in creating the view.

    Return Value

    The created view.

    Discussion

    This method returns an NSView object that conforms to the WebPlugIn informal protocol. The arguments dictionary should be specified by the keys and objects described in Constants. This method is required.

    Import Statement

    Objective-C

    @import WebKit;

    Swift

    import WebKit

    Availability

    Available in OS X v10.3.9 and later.

  • The following constants define the keys used to access the values in the arguments dictionary passed in to the plugInViewWithArguments:method. Note that WebPlugInBaseURLKey and WebPlugInAttributesKey will always correspond to data, the others may be nil.

    Declaration

    Swift

    let WebPlugInBaseURLKey: String let WebPlugInAttributesKey: String let WebPlugInContainerKey: String let WebPlugInContainingElementKey: String let WebPlugInShouldLoadMainResourceKey: String

    Objective-C

    extern NSString *WebPlugInBaseURLKey; extern NSString *WebPlugInAttributesKey; extern NSString *WebPlugInContainerKey; extern NSString *WebPlugInContainingElementKey; extern NSString *WebPlugInShouldLoadMainResourceKey;

    Constants

    • WebPlugInBaseURLKey

      WebPlugInBaseURLKey

      The base URL of the document containing the plug-in's view. Required key.

      Available in OS X v10.3 and later.

    • WebPlugInAttributesKey

      WebPlugInAttributesKey

      The NSDictionary object containing all names and values of all attributes of the plug-in’s associated HTML element, as well as all names and values of the parameters to be passed to the plug-in. For example, this dictionary will contain all PARAM elements within an APPLET element. If attribute and parameter names conflict, the attributes of an element take precedence over any of its parameters. All keys and values in this dictionary must be of type NSString. Required key.

      Available in OS X v10.3 and later.

    • WebPlugInContainerKey

      WebPlugInContainerKey

      An object that conforms to the WebPlugInContainer informal protocol. This object is used for callbacks from the plug-in to the enclosing application. If WebPlugInContainerKey is nil, no callbacks will occur.

      Available in OS X v10.3 and later.

    • WebPlugInContainingElementKey

      WebPlugInContainingElementKey

      If an element of the page’s Document Object Model was used to specify the plug-in, this will contain that element. Otherwise, it will be nil.

      Available in OS X v10.3 and later.

    • WebPlugInShouldLoadMainResourceKey

      WebPlugInShouldLoadMainResourceKey

      A Boolean value indicating whether the plug-in should load its own main resource (the src URL, in most cases). If YEStrue, the plug-in should load its own main resource. If NOfalse, the plug-in uses the data provided by WebKit and the webPlugInMainResourceDidReceiveData: message is sent to the plug-in when data is received. The default value is NOfalse.

      Available in OS X v10.6 and later.