williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: The plug-in can use this interface to communicate with the browser. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef MPLUGINADAPTER_H williamr@2: #define MPLUGINADAPTER_H williamr@2: williamr@2: // INCLUDES williamr@2: #include "coecntrl.h" williamr@2: #include "coecobs.h" williamr@2: #include "npupp.h" williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MPluginNotifier; williamr@2: williamr@2: williamr@2: class MOptionMenuHandler; williamr@2: class CEikMenuPane; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * The plug-in can use this interface to communicate with the browser. williamr@2: * williamr@2: * @lib PluginAdapterUtil in Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: */ williamr@2: class MPluginAdapter williamr@2: { williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Gets the pointer to the minor version number of the plug-in version number of the Browser Plug-in API. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @return Series 60 returns 1. Series 80 and the Nokia 7710 smartphone return 101. williamr@2: */ williamr@2: virtual TUint16 GetVersion()=0; williamr@2: williamr@2: /** williamr@2: * Called when the plug-in has completed its creation. williamr@2: * This function is called from the constructL function of the plug-in. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @param aPluginControl A pointer to the plug-in control window williamr@2: * @return None williamr@2: */ williamr@2: virtual void PluginConstructedL(CCoeControl* aPluginControl)=0; williamr@2: williamr@2: /** williamr@2: * Called after the plug-in has been deleted. williamr@2: * This function is called from the destructor of the plug-in. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @return None williamr@2: */ williamr@2: virtual void PluginFinishedL()=0; williamr@2: williamr@2: /** williamr@2: * Returns the window system level control object for the plug-in. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @return A pointer to the parent control window. williamr@2: */ williamr@2: virtual CCoeControl* GetParentControl()=0; williamr@2: williamr@2: /** williamr@2: * Returns the observer for the plug-in control. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @return Observer that the plug-in can use to send events to the browser. williamr@2: */ williamr@2: virtual MCoeControlObserver* GetParentControlObserver()=0; williamr@2: williamr@2: /** williamr@2: * Sets the plug-in notifier allowing the plug-in to control portions of the browser. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @param aNotifier Pointer to an interface that the browser can use to send events to the plug-in. williamr@2: * @return None williamr@2: */ williamr@2: virtual void SetPluginNotifier(MPluginNotifier *aNotifier)=0; williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the plug-in option menu handler allowing the plug-in to handle the custom menu commands williamr@2: * from the browser. williamr@2: * @since Series 60 3nd Edition williamr@2: * @param aOptionMenuHandler Pointer to an interface that the browser can use to send option menu williamr@2: * commands to the plug-in. williamr@2: * @return None williamr@2: */ williamr@2: virtual void SetOptionMenuHandler(MOptionMenuHandler* /*aOptionMenuHandler*/) {}; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * Contains notification ability for plug-ins. williamr@2: * These methods are implemented in the plugin. williamr@2: * williamr@2: * @lib williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: */ williamr@2: class MPluginNotifier williamr@2: { williamr@2: public: // Data williamr@2: // Types of notifications which can be passed to the plugin. williamr@2: enum TNotificationType { williamr@2: EEditCut, williamr@2: EEditCopy, williamr@2: EEditPaste, williamr@2: EEditDelete, williamr@2: EApplicationFocusChanged, williamr@2: ESystemNotification, williamr@2: EPluginInvisible, williamr@2: EPluginActivated, williamr@2: EPluginDeactivated, williamr@2: EMenuOptionEnableDecider, williamr@2: EPluginPause williamr@2: }; williamr@2: williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Notifies the plugin of an event. williamr@2: * @since Series 60 2nd Edition, Feature Pack 2 and Series 80 Platforms and the Nokia 7710 smartphone williamr@2: * @param aCallType The event type that is passed to the plug-in williamr@2: * @param aParam The parameter associated with the event williamr@2: * @return Not used williamr@2: */ williamr@2: virtual TInt NotifyL (TNotificationType aCallType, TAny *aParam)=0; williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * Contains the ability for plug-ins to handle the menu option commands. williamr@2: * These methods are implemented in the plugin. williamr@2: * williamr@2: * @lib williamr@2: * @since Series 60 3rd Edition williamr@2: */ williamr@2: class MOptionMenuHandler williamr@2: { williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * AddPluginOptionMenuItemsL williamr@2: * Add the Option Menu items to the menuPane, these will be handled by plugin. williamr@2: * williamr@2: * @since 3.1 williamr@2: * @param aMenuPane handle of the menu that will contain the options williamr@2: * @param aCommandBase base id that needs to be added to the command ID williamr@2: * @param aAfter Plugin options should be added after this index williamr@2: * @return void williamr@2: */ williamr@2: virtual void AddPluginOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aCommandBase, TInt aAfter)=0; williamr@2: williamr@2: /** williamr@2: * HandlePluginCommandL williamr@2: * Handle the user command from the option menu to the plugin. williamr@2: * williamr@2: * @since 3.1 williamr@2: * @param aCommandId the command ID of the option williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandlePluginCommandL(TInt aCommandId)=0; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // MPLUGINADAPTER_H williamr@2: williamr@2: williamr@2: // End of File