This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
webview.h
73 lines (52 loc) · 1.6 KB
/
webview.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*************************************************************************/
/* webview.h */
/*************************************************************************/
#ifndef WEB_VIEW_H
#define WEB_VIEW_H
#include "scene/gui/control.h"
/*************************************************************************/
class WebViewOverlayImplementation;
class WebViewOverlay : public Control {
GDCLASS(WebViewOverlay, Control);
WebViewOverlayImplementation *data;
String home_url;
String user_agent;
double zoom = 1.0f;
bool no_background = false;
int ctrl_err_status = -1;
static int err_status;
Ref<ImageTexture> icon_main;
Ref<ImageTexture> icon_error;
protected:
void _notification(int p_what);
static void _bind_methods();
void _draw_placeholder();
void _draw_error(const String &p_error);
public:
WebViewOverlay();
~WebViewOverlay();
void set_no_background(bool p_bg);
bool get_no_background() const;
void set_url(const String& p_url);
String get_url() const;
void set_user_agent(const String& p_user_agent);
String get_user_agent() const;
double get_zoom_level() const;
void set_zoom_level(double p_zoom);
String get_title() const;
void load_string(const String &p_source);
void execute_java_script(const String &p_script);
void get_snapshot(int p_width);
bool can_go_back() const;
bool can_go_forward() const;
bool is_ready() const;
bool is_loading() const;
bool is_secure_content() const;
void go_back();
void go_forward();
void reload();
void stop();
static void init();
static void finish();
};
#endif // WEB_VIEW_H