webengine/osswebengine/WebKit/s60/webview/BrCtlLinkResolver.h
changeset 0 dd21522fd290
child 36 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     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:   Handle links and embedded content that are not fetched from the network
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BRCTLLINKRESOLVER_H
       
    21 #define BRCTLLINKRESOLVER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 /**
       
    29 * The browser guesses the expected content type from 
       
    30 * the HTML element in which the content was defined.
       
    31 */
       
    32 enum TBrCtlLoadContentType
       
    33     {
       
    34     ELoadContentTypeAny, ///< The content type is unknown
       
    35     /**
       
    36     * The content is one of the following:
       
    37     * HTML, XHTML, WML
       
    38     */
       
    39     ELoadContentTypeMarkup,
       
    40     ELoadContentTypeImage, ///< The content is an image
       
    41     ELoadContentTypeCss, ///< The content is a cascading style sheet
       
    42     ELoadContentTypeJavascript, ///< The content is Javascript
       
    43     ELoadContentTypePlugin, ///< The content is data for a Netscape plug-in
       
    44     /**
       
    45     * The content is data for SoundStart. SoundStart is an attribute 
       
    46     * that is added to an anchor <a> tag to play audio when an anchor 
       
    47     * is in focus or selected.
       
    48     */
       
    49     ELoadContentTypeSound
       
    50     };
       
    51 
       
    52 
       
    53 // FORWARD DECLARATIONS
       
    54 class MBrCtlLinkContent;
       
    55 
       
    56 /**
       
    57 * The MBrCtlLinkResolver class provides the content of an embedded link 
       
    58 * or the content of a load request that was initiated by the user. 
       
    59 * This class is used when the host application stores markup text or 
       
    60 * other information in a private store. For example, this class could be 
       
    61 * used for e-mail applications.
       
    62 *
       
    63 * Usage:
       
    64 *
       
    65 * @code
       
    66 *  #include <BrCtlLinkResolver.h>
       
    67 *
       
    68 *  
       
    69 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
       
    70 * @lib BrowserEngine.lib
       
    71 * @file BrCtlLinkResolver.h
       
    72 * @endcode     *
       
    73 */
       
    74 class MBrCtlLinkResolver
       
    75     {
       
    76     public: // New functions
       
    77         
       
    78       /**
       
    79       * Browser plug-in calls this method when embedded link is found. 
       
    80         * Used with ECapabilityClientResolveEmbeddedURL
       
    81         * @since 2.8
       
    82       * @param aEmbeddedUrl The url of the embedded content
       
    83       * @param aCurrentUrl The url of the current page
       
    84       * @param aLoadContentType Type of the embedded content
       
    85         * Values: One of the following:
       
    86         * ELoadContentTypeAny, ELoadContentTypeMarkup, ELoadContentTypeImage
       
    87         * ELoadContentTypeCss, ELoadContentTypeJavascript, ELoadContentTypePlug-in
       
    88       * @param aEmbeddedLinkContent a callback interface to return the embedded content
       
    89       * @return ETrue if the host application resolves the link.  
       
    90         * EFalse if the host application does not resolve the link. 
       
    91         * @attention The host application makes this request by setting 
       
    92         * the ECapabilityClientResolveEmbeddedURL function.
       
    93       */
       
    94         virtual TBool ResolveEmbeddedLinkL(const TDesC& aEmbeddedUrl,
       
    95                                        const TDesC& aCurrentUrl,
       
    96                                          TBrCtlLoadContentType aLoadContentType, 
       
    97                                          MBrCtlLinkContent& aEmbeddedLinkContent) = 0; 
       
    98     
       
    99       /**
       
   100       * Browser plug-in calls this method when the user requests to load content via selecting a link, or any other way. Used with ECapabilityClientNotifyURL 
       
   101         * @since 2.8
       
   102       * @param aUrl The requested url
       
   103       * @param aCurrentUrl The url of the current page
       
   104       * @param aBrCtlLinkContent a callback interface to return the embedded content
       
   105       * @return ETrue if the host application resolves the link.
       
   106         * EFalse if the host application does not resolve the link. 
       
   107         * @attention The host application requests that the browser plug-in call 
       
   108         * this function to load new content by setting the ECapabilityClientNotifyURL function.
       
   109       */
       
   110         virtual TBool ResolveLinkL(const TDesC& aUrl, const TDesC& aCurrentUrl,
       
   111                                    MBrCtlLinkContent& aBrCtlLinkContent) = 0;
       
   112 
       
   113     /**
       
   114     * Cancel all outstanding resolving operations
       
   115         * @since 2.8
       
   116       * @return void
       
   117       */
       
   118         virtual void CancelAll() = 0;
       
   119     };
       
   120 
       
   121 
       
   122 /**
       
   123 * The MBrCtlLinkContent class is an interface that loads the resolved content. 
       
   124 *
       
   125 * Usage:
       
   126 *
       
   127 * @code
       
   128 *  #include <BrCtlLinkResolver.h>
       
   129 *
       
   130 *  
       
   131 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
       
   132 * @lib BrowserEngine.lib
       
   133 * @file BrCtlLinkResolver.h
       
   134 * @endcode     *
       
   135 */
       
   136 class MBrCtlLinkContent
       
   137     {
       
   138     public: // New functions
       
   139         /**
       
   140       * Resolver calls this method when content is resolved.
       
   141       * @param aContentType The content type of the response
       
   142       * @param aCharset The charset of the response. May be empty in case of image
       
   143       * @param aContentBuf content data. Ownership is not transfered
       
   144       * @return void
       
   145       */
       
   146         virtual void HandleResolveComplete(const TDesC& aContentType,
       
   147                                            const TDesC& aCharset,
       
   148                                            const HBufC8* aContentBuf) = 0;
       
   149 
       
   150     /**
       
   151       * This method is called if there is some error while resolving the content
       
   152       * @param aError system wide error code.
       
   153       * @return void
       
   154       */
       
   155         virtual void HandleResolveError(TInt aError) = 0;
       
   156     };
       
   157 
       
   158 
       
   159 
       
   160 #endif      // BRCTLLINKRESOLVER_H
       
   161             
       
   162 // End of File