⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.html

📁 S60上实现嵌入式浏览器,可以在应用程序中嵌入浏览器,实现IE功能
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Browser Control Sample Application</title><link href="style.css" rel="stylesheet" type="text/css"></head><table border="0" width="100%" height="8" bgcolor="#eeeeee"> <tr> <td width="100%" height="1"><b><font size="2" color="#000000" face="Arial, Helvetica, sans-serif"><strong><a name=Top></a> S60 3rd Edition SDK for Symbian OS </strong></font></b><br><i>Example Applications Guide</i></td></tr> </table><!-- Generated by Doxygen 1.4.5 --><h1>Browser Control Sample Application</h1><p><a class="el" href="index.html#intro_sec">1. About the Browser Control Sample Application Example</a> <br><a class="el" href="index.html#Pre_sec">2. Prerequisites</a> <br><a class="el" href="index.html#Design_sec">3. Design and Implementation</a> <br><a class="el" href="index.html#Hierarchy_sec">4. Class Hierarchy</a><p><hr><h2><a class="anchor" name="intro_sec">1. About the Browser Control Sample Application Example</a></h2>This example shows how easy it is to create a browser control that will enable you to display web related content. In addition, this sample application demonstrates how to customize the browser control to fit the unique needs of your host application, by showing you how to customize soft keys, dialogs, scroll bars, etc.<p><hr><h2><a class="anchor" name="Pre_sec">2. Prerequisites</a></h2>Symbian OS key concepts<p><hr><h2><a class="anchor" name="Design_sec">3. Design and Implementation</a></h2>The Browser Control Sample Application was designed to accompany the Browser Control API Developers Guide. Each of the menu options in the Sample App Menu 1 and 2 demonstrate various functional use cases that could be useful when developing your own application. For a more detailed explaination of these use cases please refer to the API Guide.<h3><a class="anchor" name="Sub31">3.1 Application Menu Choices</a></h3>When you start the Browser Control Sample Application you will notice the Options softkey.<p>Opening the Options menu displays 3 menu choices:<p>1. Tools<p>2. Sample App Menu 1<p>3. Sample App Menu 2<p>4. Exit<p>Tools menu options:<p>1. Restore settings<p><ul><li>Restores the settings for small screen, security warnings, loading images, and enabling ecma script</li></ul><p>2. Reload<p><ul><li>Reloads the page</li></ul><p>3. Back<p><ul><li>Loads the previous page in the history stack</li></ul><p>4. Forward<p><ul><li>Loads the next page in the history stack</li></ul><p>Sample App Menu 1 options:<p>1. Basic BrCtl<p>2. BrCtl Observers<p>3. Load Content using File Handle<p>4. Load Content using Buffer<p>5. Incremental Loading<p>6. Special Load Requests<p>7. Customized Dialogs<p>8. Customized Softkeys<p>9. Embedded Links<p>10. Customized Scrollbars<p>Sample App Menu 2 options:<p>1. Handle State Changed<p>2. Change Size Extents<p>3. Page Info<p>4. Content Size and Image Count<h4><a class="anchor" name="Sub331">3.3.1 Basic BrCtl</a></h4>Basic Browser Control functionality includes:<ul><li>Downloading and displaying Web content</li></ul><p><ul><li>Resolving links</li></ul><p><ul><li>Retrieving the following information about the downloaded content:</li></ul><p><ul><li>Display size needed to see all of the content (ContentSize function)</li></ul><p><ul><li>WML options associated with the current page (WMLOptionMenuItemsL function)</li></ul><p><ul><li>Value of a specified browser setting (BrowserSettingL function)</li></ul><p><ul><li>Indication of whether or not a particular URL is in the cache (IsUrlInCache function)</li></ul><p><ul><li>Information about the page, such as its title, URL, and content (PageInfoLC function)</li></ul><p><ul><li>Indication of whether there is a previous or next element in the history stack (NavigationAvailable function)</li></ul><p><ul><li>Build version of the Browser Control (VersionInfoLC function)</li></ul><p><ul><li>Number of images in the current page (ImageCountL function)</li></ul><p><ul><li>Type of focused element (FocusedElementType function)</li></ul><p><ul><li>Minimum size of the Browser Control (MinimumSize function)</li></ul><p>To create a basic Browser Control within your application to display Web-related content, call the following function of the CBrCtlInterface class:<p><ul><li>CreateBrowserControlL() which creates an instance of a basic Browser Control.</li></ul><p>To call this function, supply the following data:<p><ul><li>Parent window of the Browser Control which is a pointer to the parent of the Browser Control window.</li></ul><p><ul><li>Bounding rectangle of the Browser Control which is the size and location of the Browser Control window.</li></ul><p><ul><li>Capabilities desired for the Browser Control, for example, displaying scroll bars, allowing network access for HTTP requests.</li></ul><p>The Basic BrCtl menu option in the sample application creates an instance of a basic Browser Control. In this sample, the capabilities are set so that the Browser Control can:<p><ul><li>Make external HTTP requests (ECapabilityLoadHttpFw)</li></ul><p><ul><li>Handle scroll bars (ECapabilityDisplayBar)</li></ul><p>This relieves the host application of these responsibilities.<h4><a class="anchor" name="Sub332">3.3.2 BrCtl Observers</a></h4>An observer is an interface, implemented by the host application, which listens for Browser Control events and performs customized actions based on those events. Table 6 lists and describes the observer interfaces.<p><ul><li>Dialogs Provider Provides the dialogs used by the Browser Control.</li></ul><p>Implement this interface if you wish to customize the dialogs.<p><ul><li>Download Observer Handles download events received from the Download Manager. It provides a callback mechanism that enables the Download Manager to inform the host application about new downloads and downloads to resume.</li></ul><p>Implement this interface if you wish to display the content progressively as it is downloading.<p><ul><li>Layout Observer Receives scrolling events and updates the scroll bar.</li></ul><p>Implement this interface if you wish to customize the scroll bars.<p><ul><li>Link Resolver Provides a callback mechanism for receiving the content of an embedded link or the content of a user-initiated load request.</li></ul><p>Implement this interface if the host application must control page navigation or if the host application stores its content in a private store.<p><ul><li>Load Event Observer Receives load progress events and updates the progress bar every time the Browser Control receives a data chunk.</li></ul><p>Implement this interface if the host application implements a progress bar.<p><ul><li>Softkey Observer Listens for events and changes the softkeys based on those events.Handles requests from the Browser Control for the host application to change one or both softkeys.</li></ul><p>Implement this interface if changes in the state of the Browser Control require the host application to change the softkeys.<p><ul><li>Special Load Observer Handles special load requests.</li></ul><p>Implement this interface if the host application requires:<p><ul><li>Control over network connections</li></ul><p><ul><li>Non-markup content</li></ul><p><ul><li>Non-HTTP(S) requests</li></ul><p><ul><li>State Change Observer Receives state-changed events.</li></ul><p>Implement this interface if the Browser Control switches to and from the Image Map view.<p><ul><li>Window Observer is reserved for future use.</li></ul><p>To create a Browser Control with observer interfaces, follow these steps:<p>1. Select the observer class you wish to add.<p>2. Implement the functions defined for the observer class you selected in step1.<p>3. Call the CreateBrowserControlL() function of the CBrCtlInterface class with the pointers to the newly created interface class(es).<p><b>Note:</b> The LoadEventObserver class can be added and removed dynamically. The other observers must be created and passed in to the CreateBrowserControlL function.<p>The BrCtl Observers menu option in the sample application creates an instance of a Browser Control with observer interfaces.<h4><a class="anchor" name="Sub333">3.3.3 Load Content using File Handle</a></h4>A host application can load content by calling a number of different load methods on the Browser Control. In the Load Content using File Handle menu option, we call LoadFileL() and pass it a RFile handle to an already open file. An RFile is a Symbian object that contains a handle to a resource that is maintained by the file server.<h4><a class="anchor" name="Sub334">3.3.4 Load Content using Buffer</a></h4>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -