![]() |
CopperSpice API
2.0.0
|
CsWebKit is a web content rendering engine based on the open source WebKit project, featuring broad support for standard web technologies. CsWebKit is developed as a part of the WebKit community, which enables every new release of CsWebKit to include the latest developments from the WebKit project.
CsWebKit provides a Web browser engine that makes it easy to embed content from the World Wide Web into your CopperSpice application. At the same time Web content can be enhanced with native controls. It also has facilities for rendering of HyperText Markup Language (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and scripted with JavaScript.
A bridge between the JavaScript execution environment and the CopperSpice object model makes it possible for custom QObjects to be scripted. For detailed documentation refer to CsWebKit Bridge. Integration with the networking library enables Web pages to be transparently loaded from Web servers, the local file system, or the CopperSpice resource system. In addition to providing pure rendering features, HTML documents can be made fully editable to the user through the use of the contenteditable
attribute on HTML elements.
CsWebKit is based on the Open Source WebKit engine. More information about WebKit itself can be found on the "WebKit Open Source Project" web site.
The easiest way to render content is by using the QWebView class. Since this class inherits from QWidget, a QWebView can be embedded in your forms or a graphics view.
QWebView is used to view Web pages and contains one QWebPage. The QWebPage class provides access to the document structure in a page which describes features such as frames, navigation history, and the undo/redo stack for editable content.
HTML documents can be nested using frames in a frameset. An individual frame in HTML is represented using the QWebFrame class. This class includes the bridge to the JavaScript window object and can be painted using QPainter. Each QWebPage has one QWebFrame object as its main frame, and the main frame may contain many child frames. Individual elements of an HTML document can be accessed via DOM JavaScript interfaces from within a web page. The equivalent of this API in CsWebKit is represented by QWebElement. QWebElement objects are obtained using QWebFrame's findAllElements() and findFirstElement() functions with CSS selector queries.
Common web browser features, defaults and other settings can be configured through the QWebSettings class. It is possible to provide defaults for all QWebPage instances through the default settings. Individual attributes can be overridden by the page specific settings object.
Building the CsWebKit library with debugging symbols can be problematic on some platforms due to the size of the WebKit engine. It is recommended to build this library only in release mode and only on 64-bit computers. Our release binary of the CsWebKit library for Windows 32-bit systems was successfully built on a 64-bit computer.
Web site icons, also known as "FavIcons", are currently not supported on Windows.
The highlights of the WebKit 2.2.3 release for web developers are listed below. Some of the HTML5 and CSS3 features are based on draft specifications which are subject to change.