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: Handle links and embedded content that are not fetched from the network williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef BRCTLLINKRESOLVER_H williamr@2: #define BRCTLLINKRESOLVER_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: /** williamr@2: * The browser guesses the expected content type from williamr@2: * the HTML element in which the content was defined. williamr@2: */ williamr@2: enum TBrCtlLoadContentType williamr@2: { williamr@2: ELoadContentTypeAny, ///< The content type is unknown williamr@2: /** williamr@2: * The content is one of the following: williamr@2: * HTML, XHTML, WML williamr@2: */ williamr@2: ELoadContentTypeMarkup, williamr@2: ELoadContentTypeImage, ///< The content is an image williamr@2: ELoadContentTypeCss, ///< The content is a cascading style sheet williamr@2: ELoadContentTypeJavascript, ///< The content is Javascript williamr@2: ELoadContentTypePlugin, ///< The content is data for a Netscape plug-in williamr@2: /** williamr@2: * The content is data for SoundStart. SoundStart is an attribute williamr@2: * that is added to an anchor tag to play audio when an anchor williamr@2: * is in focus or selected. williamr@2: */ williamr@2: ELoadContentTypeSound williamr@2: }; williamr@2: williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MBrCtlLinkContent; williamr@2: williamr@2: /** williamr@2: * The MBrCtlLinkResolver class provides the content of an embedded link williamr@2: * or the content of a load request that was initiated by the user. williamr@2: * This class is used when the host application stores markup text or williamr@2: * other information in a private store. For example, this class could be williamr@2: * used for e-mail applications. williamr@2: * williamr@2: * Usage: williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * williamr@2: * williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @file BrCtlLinkResolver.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlLinkResolver williamr@2: { williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Browser plug-in calls this method when embedded link is found. williamr@2: * Used with ECapabilityClientResolveEmbeddedURL williamr@2: * @since 2.8 williamr@2: * @param aEmbeddedUrl The url of the embedded content williamr@2: * @param aCurrentUrl The url of the current page williamr@2: * @param aLoadContentType Type of the embedded content williamr@2: * Values: One of the following: williamr@2: * ELoadContentTypeAny, ELoadContentTypeMarkup, ELoadContentTypeImage williamr@2: * ELoadContentTypeCss, ELoadContentTypeJavascript, ELoadContentTypePlug-in williamr@2: * @param aEmbeddedLinkContent a callback interface to return the embedded content williamr@2: * @return ETrue if the host application resolves the link. williamr@2: * EFalse if the host application does not resolve the link. williamr@2: * @attention The host application makes this request by setting williamr@2: * the ECapabilityClientResolveEmbeddedURL function. williamr@2: */ williamr@2: virtual TBool ResolveEmbeddedLinkL(const TDesC& aEmbeddedUrl, williamr@2: const TDesC& aCurrentUrl, williamr@2: TBrCtlLoadContentType aLoadContentType, williamr@2: MBrCtlLinkContent& aEmbeddedLinkContent) = 0; williamr@2: williamr@2: /** williamr@2: * Browser plug-in calls this method when the user requests to load content via selecting a link, or any other way. Used with ECapabilityClientNotifyURL williamr@2: * @since 2.8 williamr@2: * @param aUrl The requested url williamr@2: * @param aCurrentUrl The url of the current page williamr@2: * @param aBrCtlLinkContent a callback interface to return the embedded content williamr@2: * @return ETrue if the host application resolves the link. williamr@2: * EFalse if the host application does not resolve the link. williamr@2: * @attention The host application requests that the browser plug-in call williamr@2: * this function to load new content by setting the ECapabilityClientNotifyURL function. williamr@2: */ williamr@2: virtual TBool ResolveLinkL(const TDesC& aUrl, const TDesC& aCurrentUrl, williamr@2: MBrCtlLinkContent& aBrCtlLinkContent) = 0; williamr@2: williamr@2: /** williamr@2: * Cancel all outstanding resolving operations williamr@2: * @since 2.8 williamr@2: * @return void williamr@2: */ williamr@2: virtual void CancelAll() = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * The MBrCtlLinkContent class is an interface that loads the resolved content. williamr@2: * williamr@2: * Usage: williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * williamr@2: * williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @file BrCtlLinkResolver.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlLinkContent williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Resolver calls this method when content is resolved. williamr@2: * @param aContentType The content type of the response williamr@2: * @param aCharset The charset of the response. May be empty in case of image williamr@2: * @param aContentBuf content data. Ownership is not transfered williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleResolveComplete(const TDesC& aContentType, williamr@2: const TDesC& aCharset, williamr@2: const HBufC8* aContentBuf) = 0; williamr@2: williamr@2: /** williamr@2: * This method is called if there is some error while resolving the content williamr@2: * @param aError system wide error code. williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleResolveError(TInt aError) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: #endif // BRCTLLINKRESOLVER_H williamr@2: williamr@2: // End of File