webengine/osswebengine/WebKit/Plugins/WebPlugin.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2  * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
       
     3  *
       
     4  * Redistribution and use in source and binary forms, with or without
       
     5  * modification, are permitted provided that the following conditions
       
     6  * are met:
       
     7  *
       
     8  * 1.  Redistributions of source code must retain the above copyright
       
     9  *     notice, this list of conditions and the following disclaimer. 
       
    10  * 2.  Redistributions in binary form must reproduce the above copyright
       
    11  *     notice, this list of conditions and the following disclaimer in the
       
    12  *     documentation and/or other materials provided with the distribution. 
       
    13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
       
    14  *     its contributors may be used to endorse or promote products derived
       
    15  *     from this software without specific prior written permission. 
       
    16  *
       
    17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
       
    18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
    19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       
    20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
       
    21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
       
    22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
       
    23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
       
    24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
       
    25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
       
    26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    27  */
       
    28 
       
    29 #import <Cocoa/Cocoa.h>
       
    30 
       
    31 /*!
       
    32     WebPlugIn is an informal protocol that enables interaction between an application
       
    33     and web related plug-ins it may contain.
       
    34 */
       
    35 
       
    36 @interface NSObject (WebPlugIn)
       
    37 
       
    38 /*!
       
    39     @method webPlugInInitialize
       
    40     @abstract Tell the plug-in to perform one-time initialization.
       
    41     @discussion This method must be only called once per instance of the plug-in
       
    42     object and must be called before any other methods in this protocol.
       
    43 */
       
    44 - (void)webPlugInInitialize;
       
    45 
       
    46 /*!
       
    47     @method webPlugInStart
       
    48     @abstract Tell the plug-in to start normal operation.
       
    49     @discussion The plug-in usually begins drawing, playing sounds and/or
       
    50     animation in this method.  This method must be called before calling webPlugInStop.
       
    51     This method may called more than once, provided that the application has
       
    52     already called webPlugInInitialize and that each call to webPlugInStart is followed
       
    53     by a call to webPlugInStop.
       
    54 */
       
    55 - (void)webPlugInStart;
       
    56 
       
    57 /*!
       
    58     @method webPlugInStop
       
    59     @abstract Tell the plug-in to stop normal operation.
       
    60     @discussion webPlugInStop must be called before this method.  This method may be
       
    61     called more than once, provided that the application has already called
       
    62     webPlugInInitialize and that each call to webPlugInStop is preceded by a call to
       
    63     webPlugInStart.
       
    64 */
       
    65 - (void)webPlugInStop;
       
    66 
       
    67 /*!
       
    68     @method webPlugInDestroy
       
    69     @abstract Tell the plug-in perform cleanup and prepare to be deallocated.
       
    70     @discussion The plug-in typically releases memory and other resources in this
       
    71     method.  If the plug-in has retained the WebPlugInContainer, it must release
       
    72     it in this mehthod.  This method must be only called once per instance of the
       
    73     plug-in object.  No other methods in this interface may be called after the
       
    74     application has called webPlugInDestroy.
       
    75 */
       
    76 - (void)webPlugInDestroy;
       
    77 
       
    78 /*!
       
    79     @method webPlugInSetIsSelected:
       
    80     @discusssion Informs the plug-in whether or not it is selected.  This is typically
       
    81     used to allow the plug-in to alter it's appearance when selected.
       
    82 */
       
    83 - (void)webPlugInSetIsSelected:(BOOL)isSelected;
       
    84 
       
    85 /*!
       
    86     @method objectForWebScript
       
    87     @discussion objectForWebScript is used to expose a plug-in's scripting interface.  The 
       
    88     methods of the object are exposed to the script environment.  See the WebScripting
       
    89     informal protocol for more details.
       
    90     @result Returns the object that exposes the plug-in's interface.  The class of this
       
    91     object can implement methods from the WebScripting informal protocol.
       
    92 */
       
    93 - (id)objectForWebScript;
       
    94 
       
    95 @end