18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
28e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
38e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without
58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions
68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met:
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1.  Redistributions of source code must retain the above copyright
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     notice, this list of conditions and the following disclaimer.
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2.  Redistributions in binary form must reproduce the above copyright
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     notice, this list of conditions and the following disclaimer in the
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     documentation and/or other materials provided with the distribution.
138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     its contributors may be used to endorse or promote products derived
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *     from this software without specific prior written permission.
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#import <Cocoa/Cocoa.h>
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#import <JavaScriptCore/WebKitAvailability.h>
318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    WebPlugIn is an informal protocol that enables interaction between an application
348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    and web related plug-ins it may contain.
358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@interface NSObject (WebPlugIn)
388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInInitialize
418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Tell the plug-in to perform one-time initialization.
428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion This method must be only called once per instance of the plug-in
438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    object and must be called before any other methods in this protocol.
448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)webPlugInInitialize;
468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInStart
498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Tell the plug-in to start normal operation.
508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion The plug-in usually begins drawing, playing sounds and/or
518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    animation in this method.  This method must be called before calling webPlugInStop.
528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    This method may called more than once, provided that the application has
538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    already called webPlugInInitialize and that each call to webPlugInStart is followed
548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    by a call to webPlugInStop.
558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)webPlugInStart;
578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInStop
608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Tell the plug-in to stop normal operation.
618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion webPlugInStop must be called before this method.  This method may be
628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    called more than once, provided that the application has already called
638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    webPlugInInitialize and that each call to webPlugInStop is preceded by a call to
648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    webPlugInStart.
658e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
668e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)webPlugInStop;
678e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
688e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
698e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInDestroy
708e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Tell the plug-in perform cleanup and prepare to be deallocated.
718e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion The plug-in typically releases memory and other resources in this
728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    method.  If the plug-in has retained the WebPlugInContainer, it must release
738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    it in this mehthod.  This method must be only called once per instance of the
748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    plug-in object.  No other methods in this interface may be called after the
758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    application has called webPlugInDestroy.
768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)webPlugInDestroy;
788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInSetIsSelected:
818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discusssion Informs the plug-in whether or not it is selected.  This is typically
828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    used to allow the plug-in to alter it's appearance when selected.
838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
848e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)webPlugInSetIsSelected:(BOOL)isSelected;
858e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
868e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
878e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method objectForWebScript
888e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion objectForWebScript is used to expose a plug-in's scripting interface.  The
898e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    methods of the object are exposed to the script environment.  See the WebScripting
908e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    informal protocol for more details.
918e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @result Returns the object that exposes the plug-in's interface.  The class of this
928e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    object can implement methods from the WebScripting informal protocol.
938e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
948e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (id)objectForWebScript;
958e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
968e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
978e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInMainResourceDidReceiveResponse:
988e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Called on the plug-in when WebKit receives -connection:didReceiveResponse:
998e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    for the plug-in's main resource.
1008e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion This method is only sent to the plug-in if the
1018e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
1028e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
103563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
1048e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1058e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1068e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInMainResourceDidReceiveData:
1078e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Called on the plug-in when WebKit recieves -connection:didReceiveData:
1088e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    for the plug-in's main resource.
1098e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion This method is only sent to the plug-in if the
1108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
1118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
112563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark- (void)webPlugInMainResourceDidReceiveData:(NSData *)data WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
1138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInMainResourceDidFailWithError:
1168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Called on the plug-in when WebKit receives -connection:didFailWithError:
1178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    for the plug-in's main resource.
1188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion This method is only sent to the plug-in if the
1198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
1208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
121563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark- (void)webPlugInMainResourceDidFailWithError:(NSError *)error WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
1228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*!
1248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @method webPlugInMainResourceDidFinishLoading
1258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @abstract Called on the plug-in when WebKit receives -connectionDidFinishLoading:
1268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    for the plug-in's main resource.
1278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    @discussion This method is only sent to the plug-in if the
1288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
1298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project*/
130563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark- (void)webPlugInMainResourceDidFinishLoading WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
1318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
1328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@end
133