|
1 /* |
|
2 * ============================================================================== |
|
3 * Name : BrCtl.h |
|
4 * Part of : WebKit \ BrowserControl |
|
5 * Interface : Browser Control API |
|
6 * Description : Implementation of the Browser Control |
|
7 * Version : 3.1 |
|
8 * |
|
9 * Copyright (c) 2006, Nokia Corporation |
|
10 * All rights reserved. |
|
11 * |
|
12 * Redistribution and use in source and binary forms, with or without |
|
13 * modification, are permitted provided that the following conditions |
|
14 * are met: |
|
15 * |
|
16 * * Redistributions of source code must retain the above copyright |
|
17 * notice, this list of conditions and the following disclaimer. |
|
18 * * Redistributions in binary form must reproduce the above copyright |
|
19 * notice, this list of conditions and the following disclaimer in |
|
20 * the documentation and/or other materials provided with the |
|
21 * distribution. |
|
22 * * Neither the name of the Nokia Corporation nor the names of its |
|
23 * contributors may be used to endorse or promote products derived |
|
24 * from this software without specific prior written permission. |
|
25 * |
|
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
|
36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
|
37 * DAMAGE. |
|
38 * |
|
39 * Please see file patentlicense.txt for further grants. |
|
40 * ============================================================================== |
|
41 */ |
|
42 |
|
43 |
|
44 #ifndef BRCTL_H |
|
45 #define BRCTL_H |
|
46 |
|
47 // INCLUDES |
|
48 #include <BrCtlInterface.h> |
|
49 |
|
50 #include "BrCtlDefs.h" |
|
51 #include "HistoryInterface.h" |
|
52 |
|
53 #include "WmlInterface.h" |
|
54 // CONSTANTS |
|
55 |
|
56 // DATA TYPES |
|
57 enum TBrCtlLoadState |
|
58 { |
|
59 ELoadStateIdle, |
|
60 ELoadStateRequestSent, |
|
61 ELoadStateResponseInProgress, |
|
62 ELoadStateLoadingChildren |
|
63 }; |
|
64 |
|
65 const int KMainScrollbarWidth = 5; |
|
66 |
|
67 // FORWARD DECLARATIONS |
|
68 class CBrCtl; |
|
69 class WebView; |
|
70 class HistoryHandler; |
|
71 class MWmlEngineInterface; |
|
72 class MWmlInterface; |
|
73 class MWidgetExtension; |
|
74 class MWidgetCallback; |
|
75 class SettingsContainer; |
|
76 //class ScrollingProvider; |
|
77 class CPeriodic; |
|
78 class WebDataLoadConsumer; |
|
79 class HistoryHandler; |
|
80 class HttpDownload; |
|
81 class CPageScaler; |
|
82 class CWmlDispatcher; |
|
83 class CWmlContentInterface; |
|
84 |
|
85 namespace WebCore { |
|
86 class FormData; |
|
87 } |
|
88 |
|
89 |
|
90 class HistoryHandler : public HistoryCallback |
|
91 { |
|
92 public: |
|
93 static HistoryHandler* initWithHandle(CBrCtl* brctl); |
|
94 ~HistoryHandler(); |
|
95 void updateGlobalHistoryForStandardLoad(const TPtrC8& url, const TPtrC8& requestUrl, |
|
96 TPtrC& formContentType, WebCore::FormData* formData); |
|
97 void setCurrentEntryTitle(TPtrC title); |
|
98 void updateGlobalHistoryForReload (); |
|
99 HistoryHandler(CBrCtl* brctl) { m_brctl = brctl; m_historyController = NULL; } |
|
100 public: // from HistoryCallback |
|
101 virtual CCoeControl* parent(); |
|
102 virtual TPoint currentPosition(); |
|
103 virtual int currentZoomLevel(); |
|
104 virtual int minZoomLevel(); |
|
105 virtual bool wmlMode(); |
|
106 virtual void setWmlMode(bool aWml); |
|
107 virtual void doHistoryGet(TPtrC8 url, TBrCtlDefs::TBrCtlCacheMode cacheMode); |
|
108 virtual int doHistoryPost(TPtrC8 url, TBrCtlDefs::TBrCtlCacheMode cacheMode, TPtrC contentType, WebCore::FormData* formData); |
|
109 virtual void stateChanged(bool enter); |
|
110 virtual void navigationStateChanged(TBrCtlDefs::TBrCtlState state, bool value); |
|
111 virtual CFbsBitmap* scaledPage() ; |
|
112 virtual void makeVisible(bool visible); |
|
113 virtual WebSurface* surface(); |
|
114 virtual void handleWmlBackL(); |
|
115 virtual bool dialogSelectOption(SelectArray* historyList); |
|
116 virtual void setUse(bool use, WebCore::FormData* formData); |
|
117 HistoryControllerInterface* historyController() { return m_historyController; } |
|
118 virtual void deferTimers(bool option); |
|
119 |
|
120 private: |
|
121 CBrCtl* m_brctl; |
|
122 HistoryControllerInterface* m_historyController; |
|
123 }; |
|
124 |
|
125 |
|
126 /** |
|
127 * Implementation of the Browser Control |
|
128 * |
|
129 * @lib webkit.dll |
|
130 * @since 3.0 |
|
131 */ |
|
132 class CBrCtl : public CBrCtlInterface, public MBrCtlLoadEventObserver |
|
133 { |
|
134 public: // Constructors and destructor |
|
135 |
|
136 /** |
|
137 * Two-phased constructor. |
|
138 MBrCtlSoftkeysObserver // Default: browser does not update softkeys |
|
139 MBrCtlLinkResolver // Must be provided if ECapabilityClientResolveEmbeddedURL or ECapabilityClientNotifyURL is set |
|
140 MBrCtlSpecialLoadObserver // Default: DocumentHandler and SchemeDispatcher are not called by browser and connection created by Proxy Filter |
|
141 MBrCtlLayoutObserver // Default: Browser does not update scroll location |
|
142 MBrCtlDialogsProvider // Default: Use Browser's own dialogs |
|
143 MBrCtlWindowObserver // Default: |
|
144 MBrCtlDownloadObserver // Default: |
|
145 */ |
|
146 static CBrCtlInterface* NewL(CCoeControl* aParent, |
|
147 TRect aRect, |
|
148 TUint aBrCtlCapabilities, |
|
149 TUint aCommandIdBase, |
|
150 MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver, |
|
151 MBrCtlLinkResolver* aBrCtlLinkResolver, |
|
152 MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver, |
|
153 MBrCtlLayoutObserver* aBrCtlLayoutObserver, |
|
154 MBrCtlDialogsProvider* aBrCtlDialogsProvider, |
|
155 MBrCtlWindowObserver* aBrCtlWindowObserver, |
|
156 MBrCtlDownloadObserver* aBrCtlDownloadObserver ); |
|
157 |
|
158 /** |
|
159 * Destructor. |
|
160 */ |
|
161 IMPORT_C virtual ~CBrCtl(); |
|
162 |
|
163 public: // Class methods |
|
164 |
|
165 /** |
|
166 * Returns the parent CCoeControl |
|
167 * @since 3.0 |
|
168 */ |
|
169 CCoeControl* CCoeControlParent() { return m_coectrlparent; } |
|
170 WebView* webView() const { return m_webView; } |
|
171 void LoadDllWmlEngineL(); |
|
172 void UnloadDllWmlEngine(); |
|
173 MWmlEngineInterface* wmlEngineInterface() const { return m_wmlEngineInterface; } |
|
174 void setWmlMode (bool aWml); |
|
175 bool wmlMode() const {return m_wmlMode;} |
|
176 void resetWmlServiceOptions(); |
|
177 void wmlServiceOptionsAddItemL( const TText* aText, TUint32 aActualElemID, TInt aIsPrev ); |
|
178 void postUrlL(TDesC& aUrl, TDesC8& aPostData, TDesC& aContentType); |
|
179 void setWmlPageScaler( CPageScaler& aPageScaler ) { m_wmlPageScaler = &aPageScaler; } |
|
180 CPageScaler& wmlPageScaler() const { return *m_wmlPageScaler; } |
|
181 CWmlDispatcher* wmlDispatcher() const {return m_wmlDispatcher;} |
|
182 void setWmlDispatcher(CWmlDispatcher* dispatcher){m_wmlDispatcher = dispatcher;} |
|
183 void loadResource(TDesC8& url, CWmlContentInterface* content ); |
|
184 TBrCtlWmlServiceOption* firstPrevDoElement() const { return m_firstPrevDoElement; } |
|
185 HBufC* fileNameToUrlLC(const TDesC& aFileName); |
|
186 void SetScriptLogMode(TInt aMode); |
|
187 |
|
188 public: // Methods from CBrCtlInterface |
|
189 |
|
190 /** |
|
191 * From CBrCtlInterface |
|
192 * Pass a command to the Browser Control |
|
193 * @since 3.0 |
|
194 * @param aCommand The command that the Browser Control should process |
|
195 * @return void |
|
196 */ |
|
197 IMPORT_C void HandleCommandL(TInt aCommand); |
|
198 |
|
199 /** |
|
200 * From CBrCtlInterface Pass a command to the Browser Control |
|
201 * @since 2.8 |
|
202 * @param aCommand The command that the Browser Control should process |
|
203 * @param aTransId The transaction Id associated with this command |
|
204 * @return void |
|
205 */ |
|
206 IMPORT_C void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand); |
|
207 |
|
208 /** |
|
209 * From CBrCtlInterface |
|
210 * Return the display size that would be needed to see all the content |
|
211 * @since 3.0 |
|
212 * @return The display size that would be needed to see all the content |
|
213 */ |
|
214 IMPORT_C TSize ContentSize(); |
|
215 |
|
216 /** |
|
217 * From CBrCtlInterface |
|
218 * Update a Browser Control setting |
|
219 * @since 3.0 |
|
220 * @param aSetting The setting to update |
|
221 * @param aValue The new value of the setting |
|
222 * @return void |
|
223 */ |
|
224 IMPORT_C void SetBrowserSettingL(TUint aSetting, TUint aValue); |
|
225 |
|
226 /** |
|
227 * From CBrCtlInterface |
|
228 * Get a setting from the Browser Control |
|
229 * @since 3.0 |
|
230 * @param aSetting The setting to get |
|
231 * @return The value of the setting |
|
232 */ |
|
233 IMPORT_C TUint BrowserSettingL(TUint aSetting); |
|
234 |
|
235 /** |
|
236 * From CBrCtlInterface |
|
237 * Request the Browser Control to display the content of a buffer |
|
238 * @since 3.0 |
|
239 * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:" |
|
240 * @param aData The content to display. Browser Control does not take ownership |
|
241 * @param aDataType The data type of the data |
|
242 * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1 |
|
243 * @return void |
|
244 */ |
|
245 IMPORT_C void LoadDataL(const TDesC& aUrl, |
|
246 const TDesC8& aData, |
|
247 const TDataType& aDataType, |
|
248 TUid aCharsetUid); |
|
249 |
|
250 /** |
|
251 * From CBrCtlInterface |
|
252 * Request the Browser Control to display content incrementaly |
|
253 * @since 3.0 |
|
254 * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:" |
|
255 * @param aDataType The data type of the data |
|
256 * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1 |
|
257 * @param aContentLength The length of the content. |
|
258 * @param aBrCtlDataLoadSupplier A callback interface to stop passing data if an error occured in the Browser Control |
|
259 * @param aBrCtlDataLoadConsumer A callback interface returned by the browser. Data should be passed to that interface |
|
260 * @return void |
|
261 */ |
|
262 IMPORT_C void InitLoadDataL(const TDesC& aUrl, |
|
263 const TDataType& aDataType, |
|
264 TUid aCharsetUid, |
|
265 TUint aContentLength, |
|
266 MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier, |
|
267 MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer); |
|
268 |
|
269 /** |
|
270 * From CBrCtlInterface |
|
271 * Request the Browser Control to load a url |
|
272 * @since 3.0 |
|
273 * @param aUrl The url to load |
|
274 * @param aApId The Access Point Id to use |
|
275 * @param aBrCtlCacheMode The cache mode to use |
|
276 * @return void |
|
277 */ |
|
278 IMPORT_C void LoadUrlL(const TDesC& aUrl, |
|
279 TInt aApId = -1, |
|
280 TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal); |
|
281 |
|
282 /** |
|
283 * Requests the Browser Control to POST to a URL |
|
284 * @since 5.0 |
|
285 * @param aUrl URL to which the Browser Control sends the POST request |
|
286 * @param aContentType Content type of the data to be posted |
|
287 * @param aPostData Data to be posted |
|
288 * @param aBoundary Boundary for form-data or multi-part content. |
|
289 * @param aReserved For future use only |
|
290 * @return void |
|
291 */ |
|
292 IMPORT_C void PostUrlL (const TDesC& aUrl, |
|
293 const TDesC8& aContentType, |
|
294 const TDesC8& aPostData, |
|
295 const TDesC8* aBoundary, |
|
296 TAny* aReserved); |
|
297 /** |
|
298 * From CBrCtlInterface |
|
299 * Request the Browser Control to load and display a file from the file system |
|
300 * @since 3.0 |
|
301 * @param aFileName The name of the file |
|
302 * @return void |
|
303 */ |
|
304 IMPORT_C void LoadFileL(const TDesC& aFileName); |
|
305 |
|
306 /** |
|
307 * From CBrCtlInterface |
|
308 * Request the Browser Control to load and display a file from the file system |
|
309 * @since 3.0 |
|
310 * @param aFileHandle The handle of the file |
|
311 * @return void |
|
312 */ |
|
313 IMPORT_C void LoadFileL(RFile& aFileHandle); |
|
314 |
|
315 /** |
|
316 * From CBrCtlInterface |
|
317 * Return the WML Options for the current page |
|
318 * @since 3.0 |
|
319 * @param |
|
320 * @return The WML Options for the current page |
|
321 */ |
|
322 IMPORT_C RPointerArray<TBrCtlWmlServiceOption>* WMLOptionMenuItemsL(); |
|
323 |
|
324 /** |
|
325 * From CBrCtlInterface |
|
326 * Request the Browser Control to add its own options to the option menu |
|
327 * @since 3.0 |
|
328 * @param aMenuPane Handle of the menu that will contain the options |
|
329 * @param aResourceId The resource ID of the menu |
|
330 * @param aAfter WML options should be added after that index |
|
331 * @return void |
|
332 */ |
|
333 IMPORT_C void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1); |
|
334 |
|
335 /** |
|
336 * From CBrCtlInterface |
|
337 * Request the Browser Control to clear the cache |
|
338 * @since 3.0 |
|
339 * @return The number of bytes that were freed from cache |
|
340 */ |
|
341 IMPORT_C TUint ClearCache(); |
|
342 |
|
343 /** |
|
344 * From CBrCtlInterface |
|
345 * Ask the Browser Control if a URL is in cache |
|
346 * @since 3.0 |
|
347 * @param aUrl The Url |
|
348 * @return ETrue if a specific Url is in cache |
|
349 */ |
|
350 IMPORT_C TBool IsUrlInCache(TDesC& aUrl); |
|
351 |
|
352 /** |
|
353 * From CBrCtlInterface |
|
354 * Ask the Browser Control to clear a URL from the cache |
|
355 * @since 3.0 |
|
356 * @param aUrl The Url |
|
357 * @return KErrNone, or an error code |
|
358 */ |
|
359 IMPORT_C TInt ClearItemInCache(TDesC& aUrl); |
|
360 |
|
361 /** |
|
362 * From CBrCtlInterface |
|
363 * Request the Browser Control to return info about the page. The info is returned on the Cleanup Stack. |
|
364 * @since 3.0 |
|
365 * @param aBrCtlPageInfo The type of requested info |
|
366 * @return void |
|
367 */ |
|
368 IMPORT_C HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo); |
|
369 |
|
370 /** |
|
371 * From CBrCtlInterface |
|
372 * Query the Browser Control if there is a previous or next |
|
373 * (depending on aDirection) element in history stack |
|
374 * @since 3.0 |
|
375 * @return ETrue if can go aDirection, EFalse otherwise |
|
376 */ |
|
377 IMPORT_C TBool NavigationAvailable(TBrCtlDefs::TBrCtlNavigationDirection aDirection); |
|
378 |
|
379 /** |
|
380 * From CBrCtlInterface |
|
381 * Request the Browser Control to save the current content to a file |
|
382 * @since 3.0 |
|
383 * @param aFileName The name of the file to use for saving the content |
|
384 * @return The number of bytes in the saved file |
|
385 */ |
|
386 IMPORT_C TUint16 SaveToFileL(const TDesC& aFileName); |
|
387 |
|
388 /** |
|
389 * From CBrCtlInterface |
|
390 * Request the Browser Control to pass the server's certificate info for the current page |
|
391 * @since 3.0 |
|
392 * @return Certificate info of the server of the current page |
|
393 */ |
|
394 IMPORT_C const TCertInfo* CertInfo(); |
|
395 |
|
396 /** |
|
397 * From CBrCtlInterface |
|
398 * Request the Browser Control to register for load events |
|
399 * @since 3.0 |
|
400 * @param aBrCtlLoadEventObserver A load events observer to add |
|
401 * @return void |
|
402 */ |
|
403 IMPORT_C void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver); |
|
404 |
|
405 /** |
|
406 * From CBrCtlInterface |
|
407 * Request the Browser Control to unregister for load events |
|
408 * @since 3.0 |
|
409 * @param aBrCtlLoadEventObserver A load events observer to remove |
|
410 * @return void |
|
411 */ |
|
412 IMPORT_C void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver); |
|
413 |
|
414 /** |
|
415 * From CBrCtlInterface |
|
416 * Return the number of images in the current page |
|
417 * @since 3.0 |
|
418 * @param |
|
419 * @return The number of images in the current page |
|
420 */ |
|
421 IMPORT_C TInt ImageCountL(); |
|
422 |
|
423 /** |
|
424 * From CBrCtlInterface |
|
425 * Returns the focused element |
|
426 * @since 3.0 |
|
427 * @return The type of the focused element |
|
428 */ |
|
429 IMPORT_C TBrCtlDefs::TBrCtlElementType FocusedElementType(); |
|
430 |
|
431 /** |
|
432 * From CBrCtlInterface |
|
433 * Register an observer for state change changes |
|
434 * @since 3.0 |
|
435 * @param The observer to register |
|
436 * @return void |
|
437 */ |
|
438 IMPORT_C void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver); |
|
439 |
|
440 /** |
|
441 * From CBrCtlInterface |
|
442 * Unregister an observer for state changes |
|
443 * @since 3.0 |
|
444 * @param The observer to unregister |
|
445 * @return void |
|
446 */ |
|
447 IMPORT_C void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver); |
|
448 |
|
449 /** |
|
450 * From CBrCtlInterface |
|
451 * Returns the version info requested |
|
452 * @since 3.0 |
|
453 * @param The observer to unregister |
|
454 * @return The version control info |
|
455 */ |
|
456 IMPORT_C HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo); |
|
457 |
|
458 /** |
|
459 * Pass a list of content types to the Browser Control. |
|
460 * These content types will not be using the download manager |
|
461 * The list must be separated by ';' e.g. "text/html;text/wml" |
|
462 * @since 2.8 |
|
463 * @param aContentTypes The content types that should not use Download Manager |
|
464 * @return void |
|
465 */ |
|
466 IMPORT_C void SetSelfDownloadContentTypesL(TDesC& aContentTypes); |
|
467 |
|
468 /** |
|
469 * Update a Browser Control parameter. |
|
470 * @since 2.8 |
|
471 * @param aParam The parameter to update |
|
472 * @param aValue The new value of the parameter |
|
473 * @return void |
|
474 */ |
|
475 IMPORT_C void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue); |
|
476 |
|
477 /** |
|
478 * Request the Browser Control to load a saved page. |
|
479 * @since 3.0 |
|
480 * @param aUid a unique identifier for the saved page |
|
481 * @param aSavedPageBuffer buffer which contains the content of the saved page |
|
482 * @return void |
|
483 */ |
|
484 IMPORT_C void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer); |
|
485 |
|
486 /** |
|
487 * Return the zoom levels index |
|
488 * @since 3.0 |
|
489 * @return const RArray<TUint>& |
|
490 */ |
|
491 IMPORT_C RArray<TUint>* ZoomLevels() const; |
|
492 |
|
493 /** |
|
494 * Return information about the linked feeds in the current page - used to |
|
495 * build a "Subscribe to" submenu. |
|
496 * @since 3.0 |
|
497 * @param aItems Information about the linked feeds in the current page. |
|
498 * @return void |
|
499 */ |
|
500 IMPORT_C const RPointerArray<TBrCtlSubscribeTo>& SubscribeToMenuItemsL(); |
|
501 |
|
502 /** |
|
503 * Request icon for the given url |
|
504 * @since 3.1 |
|
505 * @param aUrl url to a favicon or a page |
|
506 * @param aBitmapInfo info on whether to retun a favicon or a page thumbnail |
|
507 * @return favion icon or page icon |
|
508 */ |
|
509 IMPORT_C CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo); |
|
510 |
|
511 /** |
|
512 * Register a client interface for the browser engine |
|
513 * @since 2.8 |
|
514 * @param The observer to register |
|
515 * @return void |
|
516 */ |
|
517 IMPORT_C void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver); |
|
518 |
|
519 /** |
|
520 * Unregister a client interface for the browser engine |
|
521 * @since 2.8 |
|
522 * @param The observer to unregister |
|
523 * @return void |
|
524 */ |
|
525 IMPORT_C void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver); |
|
526 |
|
527 |
|
528 public: // Methods from CCoeControl |
|
529 |
|
530 /** |
|
531 * From CCoeControl |
|
532 * Return the minimum size the Browser Control can use |
|
533 * @since 3.0 |
|
534 * @return The minimum size that the Browser Control can use |
|
535 */ |
|
536 IMPORT_C TSize MinimumSize(); |
|
537 |
|
538 /** |
|
539 * From CCoeControl |
|
540 * Pass key events to the Browser Control |
|
541 * @since 3.0 |
|
542 * @param aKeyEvent The key event |
|
543 * @param aType The key code |
|
544 * @return If the Browser Control consumed the key event or not |
|
545 */ |
|
546 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode); |
|
547 |
|
548 /** |
|
549 * From CCoeControl |
|
550 * Sets that the Browser Control has keyboard focus. |
|
551 * @since 3.0 |
|
552 * @param aFocus If the Browser Control gets or loses focus |
|
553 * @param ENoDrawNow If the Browser Control should redraw itself as result of focus change |
|
554 * @return void |
|
555 */ |
|
556 IMPORT_C void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow); |
|
557 |
|
558 /* |
|
559 * This method calls to download manager in order to display query "Cancel |
|
560 * outstanding downloads?" and cancel if it requested by user |
|
561 * @param none |
|
562 * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit |
|
563 */ |
|
564 IMPORT_C TBool OkToExit(); |
|
565 |
|
566 /** |
|
567 * Perform the incremental find operation |
|
568 * @since 3.0 |
|
569 * @return TBrCtlFindResponse |
|
570 */ |
|
571 IMPORT_C int FindKeyword( const TDesC& aKeyword ); |
|
572 |
|
573 /** |
|
574 * Continue the incremental find operation |
|
575 * @since 3.0 |
|
576 * @return TBrCtlFindResponse |
|
577 */ |
|
578 IMPORT_C TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection ); |
|
579 |
|
580 IMPORT_C MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback); |
|
581 |
|
582 /** |
|
583 * Get information about the focused image. The function leaves if the focus is not on an image |
|
584 * @since 3.2 |
|
585 * @param |
|
586 * @return The requested information |
|
587 */ |
|
588 IMPORT_C TBrCtlImageCarrier* FocusedImageLC(); |
|
589 |
|
590 /** |
|
591 * From CCoeControl |
|
592 * Sets that the Browser Control visible. |
|
593 * @since 3.0 |
|
594 * @param aVisible If the Browser Control is visible or invisible |
|
595 * @return void |
|
596 */ |
|
597 void MakeVisible(TBool aVisible); |
|
598 |
|
599 /** |
|
600 * From CCoeControl |
|
601 * Handle changes in size of the display. |
|
602 */ |
|
603 void Draw(const TRect& aRect) const; |
|
604 |
|
605 MBrCtlSpecialLoadObserver* brCtlSpecialLoadObserver() const { return m_brCtlSpecialLoadObserver; } |
|
606 MBrCtlDownloadObserver* brCtlDownloadObserver(); |
|
607 MBrCtlLinkResolver* brCtlLinkResolver() const { return m_brCtlLinkResolver; } |
|
608 MBrCtlDialogsProvider* brCtlDialogsProvider() const { return m_brCtlDialogsProvider; } |
|
609 MBrCtlWindowObserver* brCtlWindowObserver() const { return m_brCtlWindowObserver; } |
|
610 MBrCtlLayoutObserver* brCtlLayoutObserver() const { return m_brCtlLayoutObserver; } |
|
611 MBrCtlSoftkeysObserver* brCtlSoftkeysObserver() const { return m_brCtlSoftkeysObserver; } |
|
612 |
|
613 unsigned int commandIdBase() const { return m_commandIdBase; } |
|
614 unsigned int capabilities() const { return m_capabilities; } |
|
615 SettingsContainer* settings() const { return m_settingsContainer; } |
|
616 CBrCtl* getWindowL(TDesC& windowName, bool userGesture); |
|
617 |
|
618 void reportStateChanged(TBrCtlDefs::TBrCtlState state, bool enter); |
|
619 void showHorizontalScrollbar(bool show); |
|
620 void drawScrollbar(); |
|
621 void showWindow(); |
|
622 void closeWindowSoon(); |
|
623 void doCloseWindowSoon(); |
|
624 TBool sendCommandsToClient(TBrCtlDefs::TBrCtlClientCommands aCommand, |
|
625 const CArrayFix<TPtrC>& aAttributesNames, |
|
626 const CArrayFix<TPtrC>& aAttributeValues ); |
|
627 void endLoadData(); |
|
628 void updateDefaultSoftkeys(); |
|
629 void setCertInfo(TCertInfo* aCertInfo) { m_certInfo = aCertInfo; } |
|
630 |
|
631 void updateScrollbars(int documentHeight, int displayHeight, int displayPosY, |
|
632 int documentWidth, int displayWidth, int displayPosX); |
|
633 bool hasHorizontalScrollbar() { return m_hasHorizontalScrollbar; } |
|
634 |
|
635 public: // from MBrCtlLoadEventObserver |
|
636 |
|
637 void HandleBrowserLoadEventL( TBrCtlDefs::TBrCtlLoadEvent aBrCtlLoadEvent, |
|
638 TUint aSize, TUint16 aTransactionId ); |
|
639 |
|
640 HistoryHandler* historyHandler() { return m_historyHandler; } |
|
641 |
|
642 protected: // Functions from CCoeControl |
|
643 |
|
644 /** |
|
645 * From CCoeControl |
|
646 * Handle changes in size of the display. |
|
647 */ |
|
648 void SizeChanged(); |
|
649 |
|
650 /** |
|
651 * From CCoeControl |
|
652 * Get the number of controls in the Browser Control |
|
653 */ |
|
654 TInt CountComponentControls() const; |
|
655 |
|
656 /** |
|
657 * From CCoeControl |
|
658 * Get a specified control with a given index |
|
659 */ |
|
660 CCoeControl* ComponentControl(TInt aIndex) const; |
|
661 void doEnableFavicon(); |
|
662 static TInt doCloseCb(TAny* aPtr); |
|
663 static TInt doEnableFaviconCb(TAny* aPtr); |
|
664 |
|
665 private: // Constructors and destructor |
|
666 |
|
667 /** |
|
668 * C++ default constructor. |
|
669 */ |
|
670 CBrCtl( CCoeControl* aParent, |
|
671 TUint aBrCtlCapabilities, |
|
672 TUint aCommandIdBase, |
|
673 MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver, |
|
674 MBrCtlLinkResolver* aBrCtlLinkResolver, |
|
675 MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver, |
|
676 MBrCtlLayoutObserver* aBrCtlLayoutObserver, |
|
677 MBrCtlDialogsProvider* aBrCtlDialogsProvider, |
|
678 MBrCtlWindowObserver* aBrCtlWindowObserver, |
|
679 MBrCtlDownloadObserver* aBrCtlDownloadObserver ); |
|
680 |
|
681 /** |
|
682 * By default Symbian 2nd phase constructor is private. |
|
683 */ |
|
684 void ConstructL(CCoeControl* aParent, TRect& aRect); |
|
685 |
|
686 private: |
|
687 void LoadResourceFileL(); |
|
688 int getMainScrollbarWidth() const; |
|
689 |
|
690 private: // Class data |
|
691 CCoeControl* m_coectrlparent; |
|
692 TRect m_rect; |
|
693 WebView* m_webView; |
|
694 HistoryHandler* m_historyHandler; |
|
695 SettingsContainer* m_settingsContainer; |
|
696 WebDataLoadConsumer* m_dataLoadConsumer; |
|
697 |
|
698 RPointerArray<TBrCtlSubscribeTo> m_subscribeToItems; |
|
699 RPointerArray<HBufC> m_subscribeToUrls; |
|
700 RPointerArray<MBrCtlLoadEventObserver> iLoadEventObserversArray; |
|
701 RPointerArray<MBrCtlCommandObserver> m_commandObserverArray; |
|
702 |
|
703 // tot:fixme |
|
704 MBrCtlSpecialLoadObserver* m_brCtlSpecialLoadObserver; |
|
705 MBrCtlLinkResolver* m_brCtlLinkResolver; |
|
706 MBrCtlDialogsProvider* m_brCtlDialogsProvider; |
|
707 MBrCtlWindowObserver* m_brCtlWindowObserver; |
|
708 MBrCtlSoftkeysObserver* m_brCtlSoftkeysObserver; |
|
709 MBrCtlLayoutObserver* m_brCtlLayoutObserver; |
|
710 RPointerArray<MBrCtlStateChangeObserver> m_stateChangeObserverArray; |
|
711 unsigned int m_commandIdBase; |
|
712 unsigned int m_capabilities; |
|
713 TInt m_resourceFile; |
|
714 CPeriodic* m_timer; |
|
715 bool m_wmlMode; |
|
716 bool m_suspendTimers; |
|
717 MWmlEngineInterface* m_wmlEngineInterface; |
|
718 RLibrary m_Library; |
|
719 MWmlInterface* m_WmlInterface; |
|
720 TCertInfo* m_certInfo; |
|
721 int m_documentHeight; |
|
722 int m_displayHeight; |
|
723 int m_displayPosY; |
|
724 int m_documentWidth; |
|
725 int m_displayWidth; |
|
726 int m_displayPosX; |
|
727 bool m_hasHorizontalScrollbar; |
|
728 bool m_wmlUnloadPending; |
|
729 bool m_ownsLayoutObserver; |
|
730 bool m_ownsDialogsProvider; |
|
731 CPageScaler* m_wmlPageScaler; |
|
732 CWmlDispatcher* m_wmlDispatcher; |
|
733 RPointerArray<TBrCtlWmlServiceOption> m_wmlServiceOption; |
|
734 TBrCtlWmlServiceOption* m_firstPrevDoElement; |
|
735 MBrCtlDownloadObserver* m_brCtlDownloadObserver; |
|
736 |
|
737 }; |
|
738 |
|
739 #endif // BRCTL_H |
|
740 |
|
741 // End of File |