Ultralight  1.0.0
A fast, lightweight, HTML UI engine for native apps.
App.h
Go to the documentation of this file.
1 #pragma once
15 #include "Defines.h"
16 #include <Ultralight/RefPtr.h>
17 #include <Ultralight/Renderer.h>
18 
19 namespace ultralight {
20 
21 class Monitor;
22 class Window;
23 
27 class AExport AppListener {
28 public:
29  virtual ~AppListener() {}
30 
37  virtual void OnUpdate() {}
38 };
39 
43 class AExport App : public RefCounted {
44 public:
53  static Ref<App> Create();
54 
58  static App* instance();
59 
68  virtual void set_window(Ref<Window> window) = 0;
69 
73  virtual RefPtr<Window> window() = 0;
74 
80  virtual void set_listener(AppListener* listener) = 0;
81 
85  virtual AppListener* listener() = 0;
86 
90  virtual bool is_running() const = 0;
91 
97  virtual Monitor* main_monitor() = 0;
98 
102  virtual Ref<Renderer> renderer() = 0;
103 
109  virtual void Run() = 0;
110 
114  virtual void Quit() = 0;
115 
116 protected:
117  virtual ~App();
118 };
119 
120 } // namespace ultralight
Main application class.
Definition: App.h:43
virtual void OnUpdate()
Called whenever the App updates.
Definition: App.h:37
The header for the Renderer class.
A non-nullable smart pointer.
Definition: RefPtr.h:64
A nullable smart pointer.
Definition: RefPtr.h:281
This is a set of common JavaScriptCore Helper functions to simplify sample code.
Definition: App.h:19
The header for all ref-counting utilities.
Interface for all ref-counted objects that will be managed using the Ref<> and RefPtr<> smart pointer...
Definition: RefPtr.h:53
Window class, represents a platform window.
Definition: Window.h:59
Interface for all App-related events.
Definition: App.h:27
Monitor class, represents a platform monitor.
Definition: Monitor.h:22