Ultralight
1.0.0
A fast, lightweight, HTML UI engine for native apps.
|
A View is similar to a tab in a browser– you load web content into it and display it however you want. More...
#include <View.h>
Public Member Functions | |
virtual String | url ()=0 |
Get the URL of the current page loaded into this View, if any. | |
virtual String | title ()=0 |
Get the title of the current page loaded into this View, if any. | |
virtual bool | is_loading ()=0 |
Check if the main frame of the page is currently loading. | |
virtual RenderTarget | render_target ()=0 |
Get the RenderTarget for the View. More... | |
virtual bool | is_bitmap_dirty ()=0 |
Check if bitmap is dirty (has changed since last call to View::bitmap) More... | |
virtual RefPtr< Bitmap > | bitmap ()=0 |
Get the bitmap for the View (calling this resets the dirty state). | |
virtual void | LoadHTML (const String &html)=0 |
Load a raw string of HTML, the View will navigate to it as a new page. | |
virtual void | LoadURL (const String &url)=0 |
Load a URL, the View will navigate to it as a new page. More... | |
virtual void | Resize (uint32_t width, uint32_t height)=0 |
Resize View to a certain size. More... | |
virtual JSContextRef | js_context ()=0 |
Get the page's JSContext for use with the JavaScriptCore API. More... | |
virtual JSValueRef | EvaluateScript (const String &script)=0 |
Evaluate a raw string of JavaScript and return results as a native JavaScriptCore JSValueRef (. More... | |
virtual bool | CanGoBack ()=0 |
Whether or not we can navigate backwards in history. | |
virtual bool | CanGoForward ()=0 |
Whether or not we can navigate forwards in history. | |
virtual void | GoBack ()=0 |
Navigate backwards in history. | |
virtual void | GoForward ()=0 |
Navigate forwards in history. | |
virtual void | GoToHistoryOffset (int offset)=0 |
Navigate to an arbitrary offset in history. | |
virtual void | Reload ()=0 |
Reload current page. | |
virtual void | Stop ()=0 |
Stop all page loads. | |
virtual void | FireKeyEvent (const KeyEvent &evt)=0 |
Fire a keyboard event. More... | |
virtual void | FireMouseEvent (const MouseEvent &evt)=0 |
Fire a mouse event. | |
virtual void | FireScrollEvent (const ScrollEvent &evt)=0 |
Fire a scroll event. | |
virtual void | set_view_listener (ViewListener *listener)=0 |
Set a ViewListener to receive callbacks for View-related events. More... | |
virtual ViewListener * | view_listener () const =0 |
Get the active ViewListener, if any. | |
virtual void | set_load_listener (LoadListener *listener)=0 |
Set a LoadListener to receive callbacks for Load-related events. More... | |
virtual LoadListener * | load_listener () const =0 |
Get the active LoadListener, if any. | |
virtual void | set_needs_paint (bool needs_paint)=0 |
Set whether or not this View should be repainted during the next call to Renderer::Render. More... | |
virtual bool | needs_paint () const =0 |
Whether or not this View should be repainted during the next call to Renderer::Render. | |
A View is similar to a tab in a browser– you load web content into it and display it however you want.
|
pure virtual |
Evaluate a raw string of JavaScript and return results as a native JavaScriptCore JSValueRef (.
|
pure virtual |
Fire a keyboard event.
|
pure virtual |
Check if bitmap is dirty (has changed since last call to View::bitmap)
|
pure virtual |
Get the page's JSContext for use with the JavaScriptCore API.
|
pure virtual |
Load a URL, the View will navigate to it as a new page.
|
pure virtual |
Get the RenderTarget for the View.
During each call to Renderer::Render, each View will be drawn to an offscreen texture/render-buffer. You should use RenderTarget to obtain the internal texture ID for the View and then display it in some quad (eg, call GPUDriver::BindTexture with the texture ID, then draw a textured quad in your 3D engine, making sure to use the UV coords specified in the RenderTarget). @see Overlay.cpp within the AppCore source for an example.
|
pure virtual |
Resize View to a certain size.
width | The initial width, in device coordinates. |
height | The initial height, in device coordinates. |
|
pure virtual |
Set a LoadListener to receive callbacks for Load-related events.
|
pure virtual |
Set whether or not this View should be repainted during the next call to Renderer::Render.
|
pure virtual |
Set a ViewListener to receive callbacks for View-related events.