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