2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: The plug-in can use this interface to communicate with the browser.
19 #ifndef MPLUGINADAPTER_H
20 #define MPLUGINADAPTER_H
27 // FORWARD DECLARATIONS
28 class MPluginNotifier;
31 class MOptionMenuHandler;
37 * The plug-in can use this interface to communicate with the browser.
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
44 public: // New functions
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.
51 virtual TUint16 GetVersion()=0;
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
60 virtual void PluginConstructedL(CCoeControl* aPluginControl)=0;
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
68 virtual void PluginFinishedL()=0;
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.
75 virtual CCoeControl* GetParentControl()=0;
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.
82 virtual MCoeControlObserver* GetParentControlObserver()=0;
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.
90 virtual void SetPluginNotifier(MPluginNotifier *aNotifier)=0;
94 * Sets the plug-in option menu handler allowing the plug-in to handle the custom menu commands
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.
101 virtual void SetOptionMenuHandler(MOptionMenuHandler* /*aOptionMenuHandler*/) {};
106 * Contains notification ability for plug-ins.
107 * These methods are implemented in the plugin.
110 * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone
112 class MPluginNotifier
115 // Types of notifications which can be passed to the plugin.
116 enum TNotificationType {
121 EApplicationFocusChanged,
126 EMenuOptionEnableDecider,
131 public: // New functions
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
140 virtual TInt NotifyL (TNotificationType aCallType, TAny *aParam)=0;
146 * Contains the ability for plug-ins to handle the menu option commands.
147 * These methods are implemented in the plugin.
150 * @since Series 60 3rd Edition
152 class MOptionMenuHandler
154 public: // New functions
157 * AddPluginOptionMenuItemsL
158 * Add the Option Menu items to the menuPane, these will be handled by plugin.
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
166 virtual void AddPluginOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aCommandBase, TInt aAfter)=0;
169 * HandlePluginCommandL
170 * Handle the user command from the option menu to the plugin.
173 * @param aCommandId the command ID of the option
176 virtual void HandlePluginCommandL(TInt aCommandId)=0;
180 #endif // MPLUGINADAPTER_H