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: Handle links and embedded content that are not fetched from the network
19 #ifndef BRCTLLINKRESOLVER_H
20 #define BRCTLLINKRESOLVER_H
28 * The browser guesses the expected content type from
29 * the HTML element in which the content was defined.
31 enum TBrCtlLoadContentType
33 ELoadContentTypeAny, ///< The content type is unknown
35 * The content is one of the following:
38 ELoadContentTypeMarkup,
39 ELoadContentTypeImage, ///< The content is an image
40 ELoadContentTypeCss, ///< The content is a cascading style sheet
41 ELoadContentTypeJavascript, ///< The content is Javascript
42 ELoadContentTypePlugin, ///< The content is data for a Netscape plug-in
44 * The content is data for SoundStart. SoundStart is an attribute
45 * that is added to an anchor <a> tag to play audio when an anchor
46 * is in focus or selected.
52 // FORWARD DECLARATIONS
53 class MBrCtlLinkContent;
56 * The MBrCtlLinkResolver class provides the content of an embedded link
57 * or the content of a load request that was initiated by the user.
58 * This class is used when the host application stores markup text or
59 * other information in a private store. For example, this class could be
60 * used for e-mail applications.
65 * #include <BrCtlLinkResolver.h>
68 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
69 * @lib BrowserEngine.lib
70 * @file BrCtlLinkResolver.h
73 class MBrCtlLinkResolver
75 public: // New functions
78 * Browser plug-in calls this method when embedded link is found.
79 * Used with ECapabilityClientResolveEmbeddedURL
81 * @param aEmbeddedUrl The url of the embedded content
82 * @param aCurrentUrl The url of the current page
83 * @param aLoadContentType Type of the embedded content
84 * Values: One of the following:
85 * ELoadContentTypeAny, ELoadContentTypeMarkup, ELoadContentTypeImage
86 * ELoadContentTypeCss, ELoadContentTypeJavascript, ELoadContentTypePlug-in
87 * @param aEmbeddedLinkContent a callback interface to return the embedded content
88 * @return ETrue if the host application resolves the link.
89 * EFalse if the host application does not resolve the link.
90 * @attention The host application makes this request by setting
91 * the ECapabilityClientResolveEmbeddedURL function.
93 virtual TBool ResolveEmbeddedLinkL(const TDesC& aEmbeddedUrl,
94 const TDesC& aCurrentUrl,
95 TBrCtlLoadContentType aLoadContentType,
96 MBrCtlLinkContent& aEmbeddedLinkContent) = 0;
99 * 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 * @param aUrl The requested url
102 * @param aCurrentUrl The url of the current page
103 * @param aBrCtlLinkContent a callback interface to return the embedded content
104 * @return ETrue if the host application resolves the link.
105 * EFalse if the host application does not resolve the link.
106 * @attention The host application requests that the browser plug-in call
107 * this function to load new content by setting the ECapabilityClientNotifyURL function.
109 virtual TBool ResolveLinkL(const TDesC& aUrl, const TDesC& aCurrentUrl,
110 MBrCtlLinkContent& aBrCtlLinkContent) = 0;
113 * Cancel all outstanding resolving operations
117 virtual void CancelAll() = 0;
122 * The MBrCtlLinkContent class is an interface that loads the resolved content.
127 * #include <BrCtlLinkResolver.h>
130 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
131 * @lib BrowserEngine.lib
132 * @file BrCtlLinkResolver.h
135 class MBrCtlLinkContent
137 public: // New functions
139 * Resolver calls this method when content is resolved.
140 * @param aContentType The content type of the response
141 * @param aCharset The charset of the response. May be empty in case of image
142 * @param aContentBuf content data. Ownership is not transfered
145 virtual void HandleResolveComplete(const TDesC& aContentType,
146 const TDesC& aCharset,
147 const HBufC8* aContentBuf) = 0;
150 * This method is called if there is some error while resolving the content
151 * @param aError system wide error code.
154 virtual void HandleResolveError(TInt aError) = 0;
159 #endif // BRCTLLINKRESOLVER_H