epoc32/include/mw/pluginadapterinterface.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 pluginadapterinterface.h
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  The plug-in can use this interface to communicate with the browser.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPLUGINADAPTER_H
       
    20 #define MPLUGINADAPTER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "coecntrl.h"
       
    24 #include "coecobs.h"
       
    25 #include "npupp.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPluginNotifier;
       
    29 
       
    30 
       
    31 class MOptionMenuHandler;
       
    32 class CEikMenuPane;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  The plug-in can use this interface to communicate with the browser.
       
    38 *
       
    39 *  @lib PluginAdapterUtil in Series 80 Platforms and the Nokia 7710 smartphone
       
    40 *  @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    41 */
       
    42 class MPluginAdapter
       
    43     {
       
    44     public: // New functions
       
    45         
       
    46         /**
       
    47         * Gets the pointer to the minor version number of the plug-in version number of the Browser Plug-in API.
       
    48         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    49         * @return Series 60 returns 1. Series 80 and the Nokia 7710 smartphone return 101.
       
    50         */
       
    51     virtual TUint16 GetVersion()=0;
       
    52 
       
    53         /**
       
    54         * Called when the plug-in has completed its creation.
       
    55         * This function is called from the constructL function of the plug-in.
       
    56         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    57         * @param aPluginControl A pointer to the plug-in control window
       
    58         * @return None
       
    59         */
       
    60     virtual void PluginConstructedL(CCoeControl* aPluginControl)=0;
       
    61 
       
    62         /**
       
    63         * Called after the plug-in has been deleted.
       
    64         * This function is called from the destructor of the plug-in.
       
    65         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    66         * @return None
       
    67         */
       
    68     virtual void PluginFinishedL()=0;
       
    69 
       
    70         /**
       
    71         * Returns the window system level control object for the plug-in.
       
    72         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    73         * @return A pointer to the parent control window.
       
    74         */
       
    75     virtual CCoeControl* GetParentControl()=0;
       
    76 
       
    77         /**
       
    78         * Returns the observer for the plug-in control.
       
    79         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    80         * @return Observer that the plug-in can use to send events to the browser.
       
    81         */
       
    82     virtual MCoeControlObserver* GetParentControlObserver()=0;
       
    83 
       
    84         /**
       
    85         * Sets the plug-in notifier allowing the plug-in to control portions of the browser.
       
    86         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
    87         * @param aNotifier Pointer to an interface that the browser can use to send events to the plug-in.
       
    88         * @return None
       
    89         */
       
    90     virtual void SetPluginNotifier(MPluginNotifier *aNotifier)=0;
       
    91         
       
    92 
       
    93         /**
       
    94         * Sets the plug-in option menu handler allowing the plug-in to handle the custom menu commands
       
    95         * from the browser.
       
    96         * @since Series 60 3nd Edition
       
    97         * @param aOptionMenuHandler Pointer to an interface that the browser can use to send option menu
       
    98         * commands to the plug-in.
       
    99         * @return None
       
   100         */
       
   101     virtual void SetOptionMenuHandler(MOptionMenuHandler* /*aOptionMenuHandler*/) {};
       
   102     };
       
   103 
       
   104 
       
   105 /**
       
   106 *  Contains notification ability for plug-ins.
       
   107 *  These methods are implemented in the plugin.
       
   108 *
       
   109 *  @lib
       
   110 *  @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
   111 */
       
   112 class MPluginNotifier
       
   113     {
       
   114     public:     // Data
       
   115         // Types of notifications which can be passed to the plugin.
       
   116     enum TNotificationType {
       
   117        EEditCut,
       
   118        EEditCopy, 
       
   119        EEditPaste, 
       
   120        EEditDelete, 
       
   121        EApplicationFocusChanged, 
       
   122        ESystemNotification,
       
   123        EPluginInvisible,
       
   124        EPluginActivated,
       
   125        EPluginDeactivated,
       
   126        EMenuOptionEnableDecider,
       
   127        EPluginPause
       
   128     };
       
   129 
       
   130 
       
   131     public: // New functions
       
   132         
       
   133         /**
       
   134         * Notifies the plugin of an event.
       
   135         * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
       
   136         * @param aCallType The event type that is passed to the plug-in
       
   137         * @param aParam The parameter associated with the event
       
   138         * @return Not used
       
   139         */
       
   140     virtual TInt NotifyL (TNotificationType aCallType, TAny *aParam)=0;
       
   141 
       
   142     };
       
   143 
       
   144 
       
   145 /**
       
   146 *  Contains the ability for plug-ins to handle the menu option commands.
       
   147 *  These methods are implemented in the plugin.
       
   148 *
       
   149 *  @lib
       
   150 *  @since Series 60 3rd Edition
       
   151 */
       
   152 class MOptionMenuHandler
       
   153     {
       
   154     public: // New functions
       
   155         
       
   156         /**
       
   157         * AddPluginOptionMenuItemsL
       
   158         * Add the Option Menu items to the menuPane, these will be handled by plugin.
       
   159         *
       
   160         * @since 3.1
       
   161         * @param aMenuPane handle of the menu that will contain the options 
       
   162         * @param aCommandBase base id that needs to be added to the command ID 
       
   163         * @param aAfter Plugin options should be added after this index
       
   164         * @return void
       
   165         */
       
   166     virtual void AddPluginOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aCommandBase, TInt aAfter)=0;
       
   167     
       
   168         /**
       
   169         * HandlePluginCommandL
       
   170         * Handle the user command from the option menu to the plugin.
       
   171         *
       
   172         * @since 3.1
       
   173         * @param aCommandId the command ID of the option
       
   174         * @return void
       
   175         */
       
   176     virtual void HandlePluginCommandL(TInt aCommandId)=0;
       
   177 
       
   178     };
       
   179 
       
   180 #endif      // MPLUGINADAPTER_H   
       
   181 
       
   182             
       
   183 // End of File