epoc32/include/mw/brctllinkresolver.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/brctllinkresolver.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/brctllinkresolver.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,161 @@
     1.4 -brctllinkresolver.h
     1.5 +/*
     1.6 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Eclipse Public License v1.0"
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Handle links and embedded content that are not fetched from the network
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef BRCTLLINKRESOLVER_H
    1.24 +#define BRCTLLINKRESOLVER_H
    1.25 +
    1.26 +//  INCLUDES
    1.27 +#include <e32std.h>
    1.28 +#include <e32base.h>
    1.29 +
    1.30 +
    1.31 +/**
    1.32 +* The browser guesses the expected content type from 
    1.33 +* the HTML element in which the content was defined.
    1.34 +*/
    1.35 +enum TBrCtlLoadContentType
    1.36 +    {
    1.37 +    ELoadContentTypeAny, ///< The content type is unknown
    1.38 +    /**
    1.39 +    * The content is one of the following:
    1.40 +    * HTML, XHTML, WML
    1.41 +    */
    1.42 +    ELoadContentTypeMarkup,
    1.43 +    ELoadContentTypeImage, ///< The content is an image
    1.44 +    ELoadContentTypeCss, ///< The content is a cascading style sheet
    1.45 +    ELoadContentTypeJavascript, ///< The content is Javascript
    1.46 +    ELoadContentTypePlugin, ///< The content is data for a Netscape plug-in
    1.47 +    /**
    1.48 +    * The content is data for SoundStart. SoundStart is an attribute 
    1.49 +    * that is added to an anchor <a> tag to play audio when an anchor 
    1.50 +    * is in focus or selected.
    1.51 +    */
    1.52 +    ELoadContentTypeSound
    1.53 +    };
    1.54 +
    1.55 +
    1.56 +// FORWARD DECLARATIONS
    1.57 +class MBrCtlLinkContent;
    1.58 +
    1.59 +/**
    1.60 +* The MBrCtlLinkResolver class provides the content of an embedded link 
    1.61 +* or the content of a load request that was initiated by the user. 
    1.62 +* This class is used when the host application stores markup text or 
    1.63 +* other information in a private store. For example, this class could be 
    1.64 +* used for e-mail applications.
    1.65 +*
    1.66 +* Usage:
    1.67 +*
    1.68 +* @code
    1.69 +*  #include <BrCtlLinkResolver.h>
    1.70 +*
    1.71 +*  
    1.72 +* @see S60 Platform: Browser Control API Developer's Guide Version 2.0
    1.73 +* @lib BrowserEngine.lib
    1.74 +* @file BrCtlLinkResolver.h
    1.75 +* @endcode     *
    1.76 +*/
    1.77 +class MBrCtlLinkResolver
    1.78 +    {
    1.79 +    public: // New functions
    1.80 +        
    1.81 +      /**
    1.82 +      * Browser plug-in calls this method when embedded link is found. 
    1.83 +        * Used with ECapabilityClientResolveEmbeddedURL
    1.84 +        * @since 2.8
    1.85 +      * @param aEmbeddedUrl The url of the embedded content
    1.86 +      * @param aCurrentUrl The url of the current page
    1.87 +      * @param aLoadContentType Type of the embedded content
    1.88 +        * Values: One of the following:
    1.89 +        * ELoadContentTypeAny, ELoadContentTypeMarkup, ELoadContentTypeImage
    1.90 +        * ELoadContentTypeCss, ELoadContentTypeJavascript, ELoadContentTypePlug-in
    1.91 +      * @param aEmbeddedLinkContent a callback interface to return the embedded content
    1.92 +      * @return ETrue if the host application resolves the link.  
    1.93 +        * EFalse if the host application does not resolve the link. 
    1.94 +        * @attention The host application makes this request by setting 
    1.95 +        * the ECapabilityClientResolveEmbeddedURL function.
    1.96 +      */
    1.97 +        virtual TBool ResolveEmbeddedLinkL(const TDesC& aEmbeddedUrl,
    1.98 +                                       const TDesC& aCurrentUrl,
    1.99 +                                         TBrCtlLoadContentType aLoadContentType, 
   1.100 +                                         MBrCtlLinkContent& aEmbeddedLinkContent) = 0; 
   1.101 +    
   1.102 +      /**
   1.103 +      * Browser plug-in calls this method when the user requests to load content via selecting a link, or any other way. Used with ECapabilityClientNotifyURL 
   1.104 +        * @since 2.8
   1.105 +      * @param aUrl The requested url
   1.106 +      * @param aCurrentUrl The url of the current page
   1.107 +      * @param aBrCtlLinkContent a callback interface to return the embedded content
   1.108 +      * @return ETrue if the host application resolves the link.
   1.109 +        * EFalse if the host application does not resolve the link. 
   1.110 +        * @attention The host application requests that the browser plug-in call 
   1.111 +        * this function to load new content by setting the ECapabilityClientNotifyURL function.
   1.112 +      */
   1.113 +        virtual TBool ResolveLinkL(const TDesC& aUrl, const TDesC& aCurrentUrl,
   1.114 +                                   MBrCtlLinkContent& aBrCtlLinkContent) = 0;
   1.115 +
   1.116 +    /**
   1.117 +    * Cancel all outstanding resolving operations
   1.118 +        * @since 2.8
   1.119 +      * @return void
   1.120 +      */
   1.121 +        virtual void CancelAll() = 0;
   1.122 +    };
   1.123 +
   1.124 +
   1.125 +/**
   1.126 +* The MBrCtlLinkContent class is an interface that loads the resolved content. 
   1.127 +*
   1.128 +* Usage:
   1.129 +*
   1.130 +* @code
   1.131 +*  #include <BrCtlLinkResolver.h>
   1.132 +*
   1.133 +*  
   1.134 +* @see S60 Platform: Browser Control API Developer's Guide Version 2.0
   1.135 +* @lib BrowserEngine.lib
   1.136 +* @file BrCtlLinkResolver.h
   1.137 +* @endcode     *
   1.138 +*/
   1.139 +class MBrCtlLinkContent
   1.140 +    {
   1.141 +    public: // New functions
   1.142 +        /**
   1.143 +      * Resolver calls this method when content is resolved.
   1.144 +      * @param aContentType The content type of the response
   1.145 +      * @param aCharset The charset of the response. May be empty in case of image
   1.146 +      * @param aContentBuf content data. Ownership is not transfered
   1.147 +      * @return void
   1.148 +      */
   1.149 +        virtual void HandleResolveComplete(const TDesC& aContentType,
   1.150 +                                           const TDesC& aCharset,
   1.151 +                                           const HBufC8* aContentBuf) = 0;
   1.152 +
   1.153 +    /**
   1.154 +      * This method is called if there is some error while resolving the content
   1.155 +      * @param aError system wide error code.
   1.156 +      * @return void
   1.157 +      */
   1.158 +        virtual void HandleResolveError(TInt aError) = 0;
   1.159 +    };
   1.160 +
   1.161 +
   1.162 +
   1.163 +#endif      // BRCTLLINKRESOLVER_H
   1.164 +            
   1.165 +// End of File