wxruby3 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/INSTALL.md +27 -2
- data/README.md +15 -15
- data/ext/wxruby3/include/wxRubyApp.h +145 -46
- data/ext/wxruby3/include/wxruby-ComboPopup.h +25 -8
- data/ext/wxruby3/include/wxruby-GCTracking.h +262 -0
- data/ext/wxruby3/include/wxruby-MBConv.h +190 -0
- data/ext/wxruby3/include/wxruby-SharedEventHandler.h +183 -0
- data/ext/wxruby3/include/wxruby-SharedPtr.h +104 -0
- data/ext/wxruby3/include/wxruby-runtime.h +29 -0
- data/ext/wxruby3/swig/custom/rubytracking.swg +8 -22
- data/ext/wxruby3/swig/custom/wx_ruby_shared_ptr.i +434 -0
- data/ext/wxruby3/swig/custom/wx_shared_ptr.i +431 -0
- data/ext/wxruby3/swig/mark_free_impl.i +7 -132
- data/ext/wxruby3/swig/memory_management.i +8 -44
- data/ext/wxruby3/swig/wx.i +46 -73
- data/lib/wx/core/const.rb +0 -1
- data/lib/wx/core/context_help.rb +17 -0
- data/lib/wx/core/cursor.rb +1 -0
- data/lib/wx/core/helpcontrollerhelpprovider.rb +10 -2
- data/lib/wx/core/mbconv.rb +11 -0
- data/lib/wx/core/media_ctrl.rb +31 -0
- data/lib/wx/core/top_level_window.rb +7 -0
- data/lib/wx/core.rb +6 -0
- data/lib/wx/doc/art_provider.rb +17 -0
- data/lib/wx/doc/context_help.rb +42 -0
- data/lib/wx/doc/core.rb +0 -5
- data/lib/wx/doc/functions.rb +10 -0
- data/lib/wx/doc/gen/affine_matrix2d.rb +2 -0
- data/lib/wx/doc/gen/art_provider.rb +12 -0
- data/lib/wx/doc/gen/aui/aui_notebook_event.rb +15 -15
- data/lib/wx/doc/gen/aui/aui_pane_info.rb +8 -8
- data/lib/wx/doc/gen/aui/aui_tool_bar_event.rb +5 -5
- data/lib/wx/doc/gen/book_ctrl_base.rb +2 -1
- data/lib/wx/doc/gen/calendar_event.rb +5 -5
- data/lib/wx/doc/gen/choicebook.rb +2 -2
- data/lib/wx/doc/gen/collapsible_pane.rb +1 -1
- data/lib/wx/doc/gen/colour_dialog.rb +1 -1
- data/lib/wx/doc/gen/colour_picker_event.rb +3 -3
- data/lib/wx/doc/gen/context_help_button.rb +0 -53
- data/lib/wx/doc/gen/core.rb +4 -4
- data/lib/wx/doc/gen/credential_entry_dialog.rb +2 -2
- data/lib/wx/doc/gen/date_event.rb +2 -2
- data/lib/wx/doc/gen/dial_up_event.rb +2 -2
- data/lib/wx/doc/gen/dir_filter_list_ctrl.rb +2 -2
- data/lib/wx/doc/gen/event.rb +58 -58
- data/lib/wx/doc/gen/ext_help_controller.rb +62 -16
- data/lib/wx/doc/gen/file_ctrl.rb +4 -4
- data/lib/wx/doc/gen/file_dir_picker_event.rb +2 -2
- data/lib/wx/doc/gen/file_system.rb +1 -1
- data/lib/wx/doc/gen/find_dialog_event.rb +5 -5
- data/lib/wx/doc/gen/font_picker_event.rb +1 -1
- data/lib/wx/doc/gen/grid/grid_ctrl.rb +67 -32
- data/lib/wx/doc/gen/header_ctrl_event.rb +13 -13
- data/lib/wx/doc/gen/help_controller.rb +45 -2
- data/lib/wx/doc/gen/html/html_help_controller.rb +74 -32
- data/lib/wx/doc/gen/html/html_help_window.rb +3 -3
- data/lib/wx/doc/gen/html/html_window.rb +4 -4
- data/lib/wx/doc/gen/hyperlink_ctrl.rb +1 -1
- data/lib/wx/doc/gen/list_ctrl.rb +22 -22
- data/lib/wx/doc/gen/listbook.rb +2 -2
- data/lib/wx/doc/gen/mb_conv.rb +10 -0
- data/lib/wx/doc/gen/media_event.rb +6 -6
- data/lib/wx/doc/gen/notebook.rb +2 -2
- data/lib/wx/doc/gen/pg/pg_validation_info.rb +14 -14
- data/lib/wx/doc/gen/pg/property_grid_interface.rb +2 -2
- data/lib/wx/doc/gen/rbn/ribbon_art_provider.rb +19 -9
- data/lib/wx/doc/gen/rbn/ribbon_button_bar.rb +2 -2
- data/lib/wx/doc/gen/rbn/ribbon_gallery.rb +3 -3
- data/lib/wx/doc/gen/rbn/ribbon_panel.rb +2 -2
- data/lib/wx/doc/gen/rbn/ribbon_tool_bar.rb +2 -2
- data/lib/wx/doc/gen/rt/event_list.rb +17 -0
- data/lib/wx/doc/gen/rt/shared_evt_handler.rb +14 -0
- data/lib/wx/doc/gen/rt/thread_event.rb +71 -0
- data/lib/wx/doc/gen/rtc/rich_text_ctrl.rb +19 -19
- data/lib/wx/doc/gen/sash_event.rb +2 -2
- data/lib/wx/doc/gen/sash_layout_window.rb +2 -2
- data/lib/wx/doc/gen/search_ctrl.rb +2 -2
- data/lib/wx/doc/gen/spin_ctrl.rb +2 -2
- data/lib/wx/doc/gen/splitter_window.rb +6 -6
- data/lib/wx/doc/gen/stc/styled_text_event.rb +34 -34
- data/lib/wx/doc/gen/task_bar_icon_event.rb +10 -10
- data/lib/wx/doc/gen/text_ctrl.rb +4 -4
- data/lib/wx/doc/gen/toggle_button.rb +1 -1
- data/lib/wx/doc/gen/toolbook.rb +2 -2
- data/lib/wx/doc/gen/top_level_window.rb +19 -0
- data/lib/wx/doc/gen/tree_ctrl.rb +21 -21
- data/lib/wx/doc/gen/treebook.rb +4 -4
- data/lib/wx/doc/gen/utils.rb +2 -2
- data/lib/wx/doc/gen/web/event_list.rb +95 -0
- data/lib/wx/doc/gen/web/web_view.rb +1136 -0
- data/lib/wx/doc/gen/web/web_view_event.rb +210 -0
- data/lib/wx/doc/gen/web/web_view_handler.rb +318 -0
- data/lib/wx/doc/gen/window.rb +1 -1
- data/lib/wx/doc/gen/wizard_event.rb +7 -7
- data/lib/wx/doc/html/html_help_controller.rb +23 -1
- data/lib/wx/doc/mbconv.rb +108 -0
- data/lib/wx/doc/rt/shared_event_handler.rb +49 -0
- data/lib/wx/doc/rt/thread_event.rb +28 -0
- data/lib/wx/doc/webview.rb +40 -0
- data/lib/wx/helpers.rb +1 -1
- data/lib/wx/html/htmlhelpcontroller.rb +10 -0
- data/lib/wx/keyword_defs.rb +11 -0
- data/lib/wx/rt/events/evt_list.rb +8 -0
- data/lib/wx/rt/require.rb +8 -0
- data/lib/wx/rt/thread_event.rb +14 -0
- data/lib/wx/rt.rb +16 -0
- data/lib/wx/version.rb +1 -1
- data/lib/wx/web/events/evt_list.rb +74 -0
- data/lib/wx/web/require.rb +8 -0
- data/lib/wx/web/webview.rb +106 -0
- data/lib/wx/web.rb +17 -0
- data/lib/wx/wxruby/cmd/setup.rb +15 -0
- data/lib/wx.rb +2 -0
- data/rakelib/configure.rb +24 -0
- data/rakelib/gem.rb +3 -2
- data/rakelib/install.rb +54 -27
- data/rakelib/lib/config/macosx.rb +7 -5
- data/rakelib/lib/config/mingw.rb +66 -5
- data/rakelib/lib/config/pkgman/mingw.rb +1 -1
- data/rakelib/lib/config/unixish.rb +4 -2
- data/rakelib/lib/config.rb +37 -3
- data/rakelib/lib/core/include/client_data.inc +38 -17
- data/rakelib/lib/core/include/funcall.inc +1 -1
- data/rakelib/lib/core/include/swigdirector.inc +3 -3
- data/rakelib/lib/core/include/swigrubyrun.inc +14 -26
- data/rakelib/lib/core/package.rb +0 -2
- data/rakelib/lib/director/app.rb +1 -8
- data/rakelib/lib/director/art_provider.rb +7 -3
- data/rakelib/lib/director/comboctrl.rb +0 -7
- data/rakelib/lib/director/context_help_button.rb +35 -2
- data/rakelib/lib/director/event_handler.rb +32 -28
- data/rakelib/lib/director/fs_file.rb +15 -10
- data/rakelib/lib/director/functions.rb +8 -0
- data/rakelib/lib/director/grid_cell_attr.rb +1 -3
- data/rakelib/lib/director/grid_cell_editor.rb +14 -12
- data/rakelib/lib/director/grid_cell_renderer.rb +11 -8
- data/rakelib/lib/director/grid_ctrl.rb +140 -121
- data/rakelib/lib/director/help_controller.rb +70 -2
- data/rakelib/lib/director/mb_conv.rb +30 -0
- data/rakelib/lib/director/menu.rb +92 -42
- data/rakelib/lib/director/menu_bar.rb +84 -45
- data/rakelib/lib/director/menu_item.rb +2 -2
- data/rakelib/lib/director/persistence_manager.rb +3 -2
- data/rakelib/lib/director/preview_frame.rb +2 -2
- data/rakelib/lib/director/richtext_buffer.rb +5 -2
- data/rakelib/lib/director/shared_evt_handler.rb +30 -0
- data/rakelib/lib/director/sizer.rb +8 -17
- data/rakelib/lib/director/sizer_item.rb +3 -4
- data/rakelib/lib/director/task_bar_icon.rb +7 -7
- data/rakelib/lib/director/thread_event.rb +33 -0
- data/rakelib/lib/director/validator.rb +3 -1
- data/rakelib/lib/director/variant.rb +16 -12
- data/rakelib/lib/director/webview.rb +166 -0
- data/rakelib/lib/director/webview_event.rb +37 -0
- data/rakelib/lib/director/webview_handler.rb +63 -0
- data/rakelib/lib/generate/doc/thread_event.yaml +20 -0
- data/rakelib/lib/generate/doc/web_view.yaml +135 -0
- data/rakelib/lib/generate/doc/web_view_event.yaml +38 -0
- data/rakelib/lib/generate/doc/web_view_handler.yaml +58 -0
- data/rakelib/lib/specs/interfaces.rb +12 -0
- data/rakelib/lib/typemap/common.rb +34 -1
- data/rakelib/lib/typemap/mb_conv.rb +58 -0
- data/rakelib/prepost.rake +23 -31
- data/rakelib/prepost.rb +20 -0
- data/samples/event/threaded.rb +295 -42
- data/samples/event/tn_threaded.png +0 -0
- data/samples/help/doc/back.gif +0 -0
- data/samples/help/doc/contents.gif +0 -0
- data/samples/help/doc/cshelp.txt +9 -0
- data/samples/help/doc/doc.chm +0 -0
- data/samples/help/doc/doc.cnt +8 -0
- data/samples/help/doc/doc.h +7 -0
- data/samples/help/doc/doc.hhc +40 -0
- data/samples/help/doc/doc.hhk +31 -0
- data/samples/help/doc/doc.hhp +33 -0
- data/samples/help/doc/doc.hpj +21 -0
- data/samples/help/doc/doc.htm +27 -0
- data/samples/help/doc/doc1.htm +24 -0
- data/samples/help/doc/doc2.htm +12 -0
- data/samples/help/doc/doc3.htm +12 -0
- data/samples/help/doc/doc4.htm +12 -0
- data/samples/help/doc/doc5.htm +14 -0
- data/samples/help/doc/forward.gif +0 -0
- data/samples/help/doc/up.gif +0 -0
- data/samples/help/doc.chm +0 -0
- data/samples/help/doc.chw +0 -0
- data/samples/help/doc.zip +0 -0
- data/samples/help/help.rb +352 -0
- data/samples/help/tn_help.png +0 -0
- data/samples/webview/handler_advanced.html +55 -0
- data/samples/webview/tn_webview.png +0 -0
- data/samples/webview/webview.rb +1264 -0
- data/tests/assets/handler_advanced.html +55 -0
- data/tests/assets/test.css +1 -0
- data/tests/assets/test.html +9 -0
- data/tests/assets/test.zip +0 -0
- data/tests/lib/text_entry_tests.rb +2 -2
- data/tests/lib/wxapp_runner.rb +40 -0
- data/tests/lib/wxframe_runner.rb +17 -2
- data/tests/test_art.rb +8 -8
- data/tests/test_clipboard.rb +4 -4
- data/tests/test_config.rb +6 -6
- data/tests/test_exceptions.rb +8 -6
- data/tests/test_ext_controls.rb +3 -3
- data/tests/test_file_dialog.rb +5 -5
- data/tests/test_font.rb +7 -7
- data/tests/test_grid_ctrl.rb +133 -0
- data/tests/test_help.rb +88 -0
- data/tests/test_intl.rb +1 -1
- data/tests/test_media_ctrl.rb +14 -6
- data/tests/test_menu.rb +94 -86
- data/tests/test_persistence.rb +1 -1
- data/tests/test_proof_check.rb +5 -5
- data/tests/test_propgrid.rb +1 -1
- data/tests/test_shared_event_handler.rb +141 -0
- data/tests/test_std_controls.rb +5 -5
- data/tests/test_webview.rb +492 -0
- data/tests/test_window.rb +3 -3
- metadata +78 -2
|
@@ -0,0 +1,1136 @@
|
|
|
1
|
+
# :stopdoc:
|
|
2
|
+
# This file is automatically generated by the WXRuby3 documentation
|
|
3
|
+
# generator. Do not alter this file.
|
|
4
|
+
# :startdoc:
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Wx
|
|
8
|
+
|
|
9
|
+
module WEB
|
|
10
|
+
|
|
11
|
+
# Zoom levels available in {Wx::WEB::WebView}.
|
|
12
|
+
#
|
|
13
|
+
#
|
|
14
|
+
#
|
|
15
|
+
# @wxrb_require USE_WEBVIEW
|
|
16
|
+
class WebViewZoom < Wx::Enum
|
|
17
|
+
|
|
18
|
+
#
|
|
19
|
+
#
|
|
20
|
+
WEBVIEW_ZOOM_TINY = Wx::WEB::WebViewZoom.new(0)
|
|
21
|
+
|
|
22
|
+
#
|
|
23
|
+
#
|
|
24
|
+
WEBVIEW_ZOOM_SMALL = Wx::WEB::WebViewZoom.new(1)
|
|
25
|
+
|
|
26
|
+
# default size
|
|
27
|
+
#
|
|
28
|
+
WEBVIEW_ZOOM_MEDIUM = Wx::WEB::WebViewZoom.new(2)
|
|
29
|
+
|
|
30
|
+
#
|
|
31
|
+
#
|
|
32
|
+
WEBVIEW_ZOOM_LARGE = Wx::WEB::WebViewZoom.new(3)
|
|
33
|
+
|
|
34
|
+
#
|
|
35
|
+
#
|
|
36
|
+
WEBVIEW_ZOOM_LARGEST = Wx::WEB::WebViewZoom.new(4)
|
|
37
|
+
|
|
38
|
+
end # WebViewZoom
|
|
39
|
+
|
|
40
|
+
# The type of zooming that the web view control can perform.
|
|
41
|
+
#
|
|
42
|
+
#
|
|
43
|
+
#
|
|
44
|
+
# @wxrb_require USE_WEBVIEW
|
|
45
|
+
class WebViewZoomType < Wx::Enum
|
|
46
|
+
|
|
47
|
+
# The entire layout scales when zooming, including images.
|
|
48
|
+
#
|
|
49
|
+
WEBVIEW_ZOOM_TYPE_LAYOUT = Wx::WEB::WebViewZoomType.new(0)
|
|
50
|
+
|
|
51
|
+
# Only the text changes in size when zooming, images and other layout elements retain their initial size.
|
|
52
|
+
#
|
|
53
|
+
WEBVIEW_ZOOM_TYPE_TEXT = Wx::WEB::WebViewZoomType.new(1)
|
|
54
|
+
|
|
55
|
+
end # WebViewZoomType
|
|
56
|
+
|
|
57
|
+
# Types of errors that can cause navigation to fail.
|
|
58
|
+
#
|
|
59
|
+
#
|
|
60
|
+
#
|
|
61
|
+
# @wxrb_require USE_WEBVIEW
|
|
62
|
+
class WebViewNavigationError < Wx::Enum
|
|
63
|
+
|
|
64
|
+
# Connection error (timeout, etc.).
|
|
65
|
+
#
|
|
66
|
+
WEBVIEW_NAV_ERR_CONNECTION = Wx::WEB::WebViewNavigationError.new(0)
|
|
67
|
+
|
|
68
|
+
# Invalid certificate.
|
|
69
|
+
#
|
|
70
|
+
WEBVIEW_NAV_ERR_CERTIFICATE = Wx::WEB::WebViewNavigationError.new(1)
|
|
71
|
+
|
|
72
|
+
# Authentication required.
|
|
73
|
+
#
|
|
74
|
+
WEBVIEW_NAV_ERR_AUTH = Wx::WEB::WebViewNavigationError.new(2)
|
|
75
|
+
|
|
76
|
+
# Other security error.
|
|
77
|
+
#
|
|
78
|
+
WEBVIEW_NAV_ERR_SECURITY = Wx::WEB::WebViewNavigationError.new(3)
|
|
79
|
+
|
|
80
|
+
# Requested resource not found.
|
|
81
|
+
#
|
|
82
|
+
WEBVIEW_NAV_ERR_NOT_FOUND = Wx::WEB::WebViewNavigationError.new(4)
|
|
83
|
+
|
|
84
|
+
# Invalid request/parameters (e.g.
|
|
85
|
+
#
|
|
86
|
+
WEBVIEW_NAV_ERR_REQUEST = Wx::WEB::WebViewNavigationError.new(5)
|
|
87
|
+
|
|
88
|
+
# The user cancelled (e.g.
|
|
89
|
+
#
|
|
90
|
+
WEBVIEW_NAV_ERR_USER_CANCELLED = Wx::WEB::WebViewNavigationError.new(6)
|
|
91
|
+
|
|
92
|
+
# Another (exotic) type of error that didn't fit in other categories.
|
|
93
|
+
#
|
|
94
|
+
WEBVIEW_NAV_ERR_OTHER = Wx::WEB::WebViewNavigationError.new(7)
|
|
95
|
+
|
|
96
|
+
end # WebViewNavigationError
|
|
97
|
+
|
|
98
|
+
# Type of refresh.
|
|
99
|
+
#
|
|
100
|
+
#
|
|
101
|
+
#
|
|
102
|
+
# @wxrb_require USE_WEBVIEW
|
|
103
|
+
class WebViewReloadFlags < Wx::Enum
|
|
104
|
+
|
|
105
|
+
# Default reload, will access cache.
|
|
106
|
+
#
|
|
107
|
+
WEBVIEW_RELOAD_DEFAULT = Wx::WEB::WebViewReloadFlags.new(0)
|
|
108
|
+
|
|
109
|
+
# Reload the current view without accessing the cache.
|
|
110
|
+
#
|
|
111
|
+
WEBVIEW_RELOAD_NO_CACHE = Wx::WEB::WebViewReloadFlags.new(1)
|
|
112
|
+
|
|
113
|
+
end # WebViewReloadFlags
|
|
114
|
+
|
|
115
|
+
# Find flags used when searching for text on page.
|
|
116
|
+
#
|
|
117
|
+
#
|
|
118
|
+
#
|
|
119
|
+
# @wxrb_require USE_WEBVIEW
|
|
120
|
+
class WebViewFindFlags < Wx::Enum
|
|
121
|
+
|
|
122
|
+
# Causes the search to restart when end or beginning reached.
|
|
123
|
+
#
|
|
124
|
+
WEBVIEW_FIND_WRAP = Wx::WEB::WebViewFindFlags.new(1)
|
|
125
|
+
|
|
126
|
+
# Matches an entire word when searching.
|
|
127
|
+
#
|
|
128
|
+
WEBVIEW_FIND_ENTIRE_WORD = Wx::WEB::WebViewFindFlags.new(2)
|
|
129
|
+
|
|
130
|
+
# Match case, i.e.
|
|
131
|
+
#
|
|
132
|
+
WEBVIEW_FIND_MATCH_CASE = Wx::WEB::WebViewFindFlags.new(4)
|
|
133
|
+
|
|
134
|
+
# Highlights the search results.
|
|
135
|
+
#
|
|
136
|
+
WEBVIEW_FIND_HIGHLIGHT_RESULT = Wx::WEB::WebViewFindFlags.new(8)
|
|
137
|
+
|
|
138
|
+
# Searches for phrase in backward direction.
|
|
139
|
+
#
|
|
140
|
+
WEBVIEW_FIND_BACKWARDS = Wx::WEB::WebViewFindFlags.new(16)
|
|
141
|
+
|
|
142
|
+
# The default flag, which is simple searching.
|
|
143
|
+
#
|
|
144
|
+
WEBVIEW_FIND_DEFAULT = Wx::WEB::WebViewFindFlags.new(0)
|
|
145
|
+
|
|
146
|
+
end # WebViewFindFlags
|
|
147
|
+
|
|
148
|
+
# Navigation action types.
|
|
149
|
+
#
|
|
150
|
+
#
|
|
151
|
+
#
|
|
152
|
+
# @wxrb_require USE_WEBVIEW
|
|
153
|
+
class WebViewNavigationActionFlags < Wx::Enum
|
|
154
|
+
|
|
155
|
+
# No navigation action.
|
|
156
|
+
#
|
|
157
|
+
WEBVIEW_NAV_ACTION_NONE = Wx::WEB::WebViewNavigationActionFlags.new(0)
|
|
158
|
+
|
|
159
|
+
# The navigation was started by the user.
|
|
160
|
+
#
|
|
161
|
+
WEBVIEW_NAV_ACTION_USER = Wx::WEB::WebViewNavigationActionFlags.new(1)
|
|
162
|
+
|
|
163
|
+
# The navigation was started but not by the user.
|
|
164
|
+
#
|
|
165
|
+
WEBVIEW_NAV_ACTION_OTHER = Wx::WEB::WebViewNavigationActionFlags.new(2)
|
|
166
|
+
|
|
167
|
+
end # WebViewNavigationActionFlags
|
|
168
|
+
|
|
169
|
+
# Specifies at which place of documents an user script will be inserted.
|
|
170
|
+
#
|
|
171
|
+
#
|
|
172
|
+
#
|
|
173
|
+
# @wxrb_require USE_WEBVIEW
|
|
174
|
+
class WebViewUserScriptInjectionTime < Wx::Enum
|
|
175
|
+
|
|
176
|
+
# Insert the code of the user script at the beginning of loaded documents.
|
|
177
|
+
#
|
|
178
|
+
WEBVIEW_INJECT_AT_DOCUMENT_START = Wx::WEB::WebViewUserScriptInjectionTime.new(0)
|
|
179
|
+
|
|
180
|
+
# Insert the code of the user script at the end of the loaded documents.
|
|
181
|
+
#
|
|
182
|
+
WEBVIEW_INJECT_AT_DOCUMENT_END = Wx::WEB::WebViewUserScriptInjectionTime.new(1)
|
|
183
|
+
|
|
184
|
+
end # WebViewUserScriptInjectionTime
|
|
185
|
+
|
|
186
|
+
# Types of browsing data that can be cleared.
|
|
187
|
+
#
|
|
188
|
+
# Note that different constants can be combined using the bitwise OR operator and that {Wx::WEB::WebViewBrowsingDataTypes::WEBVIEW_BROWSING_DATA_ALL} is a shorthand for specifying all of them.
|
|
189
|
+
#
|
|
190
|
+
# @wxrb_require USE_WEBVIEW
|
|
191
|
+
class WebViewBrowsingDataTypes < Wx::Enum
|
|
192
|
+
|
|
193
|
+
# All stored and session cookies.
|
|
194
|
+
#
|
|
195
|
+
WEBVIEW_BROWSING_DATA_COOKIES = Wx::WEB::WebViewBrowsingDataTypes.new(1)
|
|
196
|
+
|
|
197
|
+
# Cached data from disk and memory.
|
|
198
|
+
#
|
|
199
|
+
WEBVIEW_BROWSING_DATA_CACHE = Wx::WEB::WebViewBrowsingDataTypes.new(2)
|
|
200
|
+
|
|
201
|
+
# All DOM Storage: File Systems, Indexed DB, Local Storage, Web SQL, Cache Storage.
|
|
202
|
+
#
|
|
203
|
+
WEBVIEW_BROWSING_DATA_DOM_STORAGE = Wx::WEB::WebViewBrowsingDataTypes.new(4)
|
|
204
|
+
|
|
205
|
+
# Other browsing data like history, settings, auto fill, passwords, etc.
|
|
206
|
+
#
|
|
207
|
+
WEBVIEW_BROWSING_DATA_OTHER = Wx::WEB::WebViewBrowsingDataTypes.new(8)
|
|
208
|
+
|
|
209
|
+
# All browsing data, including data corresponding to all the other constants.
|
|
210
|
+
#
|
|
211
|
+
WEBVIEW_BROWSING_DATA_ALL = Wx::WEB::WebViewBrowsingDataTypes.new(15)
|
|
212
|
+
|
|
213
|
+
end # WebViewBrowsingDataTypes
|
|
214
|
+
|
|
215
|
+
# Types of settings that can be applied to print operations.
|
|
216
|
+
#
|
|
217
|
+
#
|
|
218
|
+
#
|
|
219
|
+
# @wxrb_require USE_WEBVIEW
|
|
220
|
+
class WebViewPrintFlags < Wx::Enum
|
|
221
|
+
|
|
222
|
+
# Do not apply any custom settings.
|
|
223
|
+
#
|
|
224
|
+
WEBVIEW_PRINT_DEFAULT = Wx::WEB::WebViewPrintFlags.new(0)
|
|
225
|
+
|
|
226
|
+
# Explicitly prevents headers and footers from appearing in print operations.
|
|
227
|
+
#
|
|
228
|
+
WEBVIEW_PRINT_HIDE_HEADER_FOOTER = Wx::WEB::WebViewPrintFlags.new(1)
|
|
229
|
+
|
|
230
|
+
end # WebViewPrintFlags
|
|
231
|
+
|
|
232
|
+
#
|
|
233
|
+
#
|
|
234
|
+
EVT_WEBVIEW_CREATED = 10464
|
|
235
|
+
|
|
236
|
+
#
|
|
237
|
+
#
|
|
238
|
+
EVT_WEBVIEW_NAVIGATING = 10465
|
|
239
|
+
|
|
240
|
+
#
|
|
241
|
+
#
|
|
242
|
+
EVT_WEBVIEW_NAVIGATED = 10466
|
|
243
|
+
|
|
244
|
+
#
|
|
245
|
+
#
|
|
246
|
+
EVT_WEBVIEW_LOADED = 10467
|
|
247
|
+
|
|
248
|
+
#
|
|
249
|
+
#
|
|
250
|
+
EVT_WEBVIEW_ERROR = 10468
|
|
251
|
+
|
|
252
|
+
#
|
|
253
|
+
#
|
|
254
|
+
EVT_WEBVIEW_NEWWINDOW = 10469
|
|
255
|
+
|
|
256
|
+
#
|
|
257
|
+
#
|
|
258
|
+
EVT_WEBVIEW_NEWWINDOW_FEATURES = 10470
|
|
259
|
+
|
|
260
|
+
#
|
|
261
|
+
#
|
|
262
|
+
EVT_WEBVIEW_TITLE_CHANGED = 10472
|
|
263
|
+
|
|
264
|
+
#
|
|
265
|
+
#
|
|
266
|
+
EVT_WEBVIEW_FULLSCREEN_CHANGED = 10473
|
|
267
|
+
|
|
268
|
+
#
|
|
269
|
+
#
|
|
270
|
+
EVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED = 10474
|
|
271
|
+
|
|
272
|
+
#
|
|
273
|
+
#
|
|
274
|
+
EVT_WEBVIEW_SCRIPT_RESULT = 10475
|
|
275
|
+
|
|
276
|
+
#
|
|
277
|
+
#
|
|
278
|
+
EVT_WEBVIEW_WINDOW_CLOSE_REQUESTED = 10471
|
|
279
|
+
|
|
280
|
+
#
|
|
281
|
+
#
|
|
282
|
+
EVT_WEBVIEW_BROWSING_DATA_CLEARED = 10476
|
|
283
|
+
|
|
284
|
+
# This control may be used to render web (HTML / CSS / JavaScript) documents.
|
|
285
|
+
#
|
|
286
|
+
# It is designed to allow the creation of multiple backends for each port. It differs from {Wx::HTML::HtmlWindow} in that each backend is actually a full web engine, provided by a 3rd party (e.g., WebView2 on MSW or WebKit on macOS and GTK). This allows the correct viewing of complex pages with JavaScript and CSS.
|
|
287
|
+
#
|
|
288
|
+
# ## Backend Descriptions
|
|
289
|
+
#
|
|
290
|
+
# This class supports using multiple backends, corresponding to different implementations of the same functionality. {Wx::WebViewChrome} is available on all three major platforms and each platform also has its own default native backend. Backends are identified by their names, documented in the backend descriptions below.
|
|
291
|
+
#
|
|
292
|
+
# ## Wx::WEB::WEBVIEW_BACKEND_IE (MSW)
|
|
293
|
+
#
|
|
294
|
+
# The IE backend uses Microsoft's WebBrowser control, which depends the locally installed version of Internet Explorer. By default this backend emulates Internet Explorer 11. This can be changed with a registry setting by {Wx::WEB::WebView#msw_set_ie_emulation_level} see this article for more information.
|
|
295
|
+
# This backend has full support for custom schemes and virtual file systems.
|
|
296
|
+
# The predefined {Wx::WEB::WEBVIEW_BACKEND_IE} constant contains the name of this backend and can be used to explicitly select it when using {Wx::WEB::WebView.new}.
|
|
297
|
+
#
|
|
298
|
+
# <div class="wxrb-note">
|
|
299
|
+
# <b>Note:</b>
|
|
300
|
+
# <p>If you plan to display any modern web content you should consider using Wx::WEB::WEBVIEW_BACKEND_EDGE (MSW), as Internet Explorer is not supported anymore by Microsoft.
|
|
301
|
+
# </p>
|
|
302
|
+
# </div>
|
|
303
|
+
#
|
|
304
|
+
# ## Wx::WEB::WEBVIEW_BACKEND_EDGE (MSW)
|
|
305
|
+
#
|
|
306
|
+
# The Edge backend uses Microsoft's Edge WebView2. It is available for Windows 7 (newer versions require Windows 10+) and newer.
|
|
307
|
+
# This backend does not support custom schemes. When using handlers, see {Wx::WEB::WebViewHandler#set_virtual_host} for more details on how to access handler provided URLs.
|
|
308
|
+
# This backend is enabled by default for WXMSW.
|
|
309
|
+
#
|
|
310
|
+
# If enabled and available at runtime, Edge will be selected as the default backend. If you require the IE backend use {Wx::WEB::WEBVIEW_BACKEND_IE} when using {Wx::WEB::WebView.new}.
|
|
311
|
+
#
|
|
312
|
+
# The predefined {Wx::WEB::WEBVIEW_BACKEND_EDGE} constant contains the name of this backend.
|
|
313
|
+
#
|
|
314
|
+
# ## Wx::WEB::WEBVIEW_BACKEND_WEBKIT (GTK)
|
|
315
|
+
#
|
|
316
|
+
# Under GTK the WebKit backend uses WebKitGTK+. The current minimum version required is 1.3.1 which ships by default with Ubuntu Natty and Debian Wheezy and has the package name libwebkitgtk-dev.
|
|
317
|
+
# Custom schemes and virtual files systems are supported under this backend, however embedded resources such as images and stylesheets are currently loaded using the data:// scheme.
|
|
318
|
+
# The predefined {Wx::WEBVIEW_BACKEND_WEBKIT} constant contains the name of this backend.
|
|
319
|
+
#
|
|
320
|
+
# ## Wx::WEB::WEBVIEW_BACKEND_WEBKIT2 (GTK3)
|
|
321
|
+
#
|
|
322
|
+
# Under GTK3 the WebKit2 version of WebKitGTK+ is used. In Ubuntu the required package name is libwebkit2gtk-4.0-dev and under Fedora it is webkitgtk4-devel.
|
|
323
|
+
# All features are supported except for clearing and enabling / disabling the history.
|
|
324
|
+
# The predefined {Wx::WEBVIEW_BACKEND_WEBKIT} constant contains the name of this backend.
|
|
325
|
+
#
|
|
326
|
+
# <div class="wxrb-note">
|
|
327
|
+
# <b>Note:</b>
|
|
328
|
+
# <p>WebKitGTK 2.42+ may fail to render content due to DMA-BUF hardware acceleration issues. This can be resolved by calling
|
|
329
|
+
#
|
|
330
|
+
# ```ruby
|
|
331
|
+
# ENV['WEBKIT_DISABLE_DMABUF_RENDERER'] = '1'
|
|
332
|
+
# ```
|
|
333
|
+
# before creating a {Wx::WEB::WebView} instance.
|
|
334
|
+
# </p>
|
|
335
|
+
# </div>
|
|
336
|
+
#
|
|
337
|
+
# ## Wx::WEB::WEBVIEW_BACKEND_WEBKIT (macOS)
|
|
338
|
+
#
|
|
339
|
+
# The macOS WebKit backend uses Apple's WKWebView class.
|
|
340
|
+
# This backend has full support for custom schemes and virtual file systems on macOS 10.13+. In order to use handlers, two-step creation has to be used and {Wx::WEB::WebView#register_handler} has to be called before {Wx::WEB::WebView#create}.
|
|
341
|
+
# Starting with macOS 10.11 and iOS 9 an application cannot create unsecure connections (this includes HTTP and unverified HTTPS). You have to include additional fields in your Info.plist to enable such connections. For further details see the documentation on NSAppTransportSecurity here
|
|
342
|
+
# The predefined {Wx::WEBVIEW_BACKEND_WEBKIT} constant contains the name of this backend.
|
|
343
|
+
#
|
|
344
|
+
# ## Wx::WEB::WEBVIEW_BACKEND_CHROMIUM (MSW, macOS, GTK)
|
|
345
|
+
#
|
|
346
|
+
# The Chromium Embedded Framework backend has to be enabled when building wxWidgets, see the wxWidgets documentation for wxWebViewChromium for additional usage and build instructions.
|
|
347
|
+
# This backend can not be automatically build by the wxRuby3 build scripts but requires a custom wxWidgets installation.
|
|
348
|
+
# See the wxRuby3 INSTALL documentation for details on how to build with a custom wxWidgets setup.
|
|
349
|
+
#
|
|
350
|
+
# The predefined {Wx::WEB::WEBVIEW_BACKEND_CHROMIUM} constant contains the name of this backend.
|
|
351
|
+
#
|
|
352
|
+
# ## Asynchronous Notifications
|
|
353
|
+
#
|
|
354
|
+
# Many of the methods in {Wx::WEB::WebView} are asynchronous, i.e. they return immediately and perform their work in the background. This includes functions such as {Wx::WEB::WebView#load_url} and {Wx::WEB::WebView#reload}. To receive notification of the progress and completion of these functions you need to handle the events that are provided. Specifically {Wx::WEB::EVT_WEBVIEW_LOADED} notifies when the page or a sub-frame has finished loading and {Wx::WEB::EVT_WEBVIEW_ERROR} notifies that an error has occurred.
|
|
355
|
+
#
|
|
356
|
+
# ## Virtual File Systems and Custom Schemes
|
|
357
|
+
#
|
|
358
|
+
# {Wx::WEB::WebView} supports the registering of custom scheme handlers, for example file or http. To do this create a new class which inherits from {Wx::WEB::WebViewHandler}, where {Wx::WEB::WebViewHandler#get_file} returns a pointer to a {Wx::FSFile} which represents the given url or {Wx::WEB::WebViewHandler#start_request} for more complex requests. You can then register your handler with {Wx::WEB::WebView#register_handler} it will be called for all pages and resources.
|
|
359
|
+
# {Wx::WEB::WebViewFSHandler} is provided to access the virtual file system encapsulated by {Wx::FileSystem}. The {Wx::MemoryFSHandler} documentation gives an example of how this may be used.
|
|
360
|
+
# {Wx::WEB::WebViewArchiveHandler} is provided to allow the navigation of pages inside a zip archive. It supports paths of the form: <code>scheme:///C:/example/docs.zip;protocol=zip/main.htm</code>
|
|
361
|
+
# ### Events emitted by this class
|
|
362
|
+
#
|
|
363
|
+
# The following event-handler methods redirect the events to member method or handler blocks for {Wx::WEB::WebViewEvent} events.
|
|
364
|
+
# Event handler methods for events emitted by this class:
|
|
365
|
+
#
|
|
366
|
+
# - {Wx::EvtHandler#evt_webview_created}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_CREATED} event, generated when the object is fully initialized. For the backends using asynchronous initialization, such as {Wx::WebViewChromium}, most of this class member functions can be only used once this event is received. Available only in wxWidgets 3.3.0 or later.
|
|
367
|
+
#
|
|
368
|
+
# - {Wx::EvtHandler#evt_webview_navigating}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_NAVIGATING} event, generated before trying to get a resource. This event may be vetoed to prevent navigating to this resource. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
|
|
369
|
+
#
|
|
370
|
+
# - {Wx::EvtHandler#evt_webview_navigated}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_NAVIGATED} event generated after it was confirmed that a resource would be requested. This event may not be vetoed. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
|
|
371
|
+
#
|
|
372
|
+
# - {Wx::EvtHandler#evt_webview_loaded}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_LOADED} event generated when the document is fully loaded and displayed. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
|
|
373
|
+
#
|
|
374
|
+
# - {Wx::EvtHandler#evt_webview_error}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_ERROR} event generated when a navigation error occurs. The integer associated with this event will be a {Wx::WebNavigationError} item. The string associated with this event may contain a backend-specific more precise error message/code.
|
|
375
|
+
#
|
|
376
|
+
# - {Wx::EvtHandler#evt_webview_newwindow}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_NEWWINDOW} event, generated when a new window is created. You must handle this event if you want anything to happen, for example to load the page in a new window or tab. For usage details see {Wx::WEB::WebViewWindowFeatures}.
|
|
377
|
+
#
|
|
378
|
+
# - {Wx::EvtHandler#evt_webview_newwindow_features}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_NEWWINDOW_FEATURES} event, generated when window features are available for the new window. For usage details see {Wx::WEB::WebViewWindowFeatures}. Available only in wxWidgets 3.3.0 or later.
|
|
379
|
+
#
|
|
380
|
+
# - {Wx::EvtHandler#evt_webview_window_close_requested}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_WINDOW_CLOSE_REQUESTED} event, generated when a window is requested to be closed. Available only in wxWidgets 3.3.0 or later.
|
|
381
|
+
#
|
|
382
|
+
# - {Wx::EvtHandler#evt_webview_title_changed}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_TITLE_CHANGED} event, generated when the page title changes. Use GetString to get the title.
|
|
383
|
+
#
|
|
384
|
+
# - {Wx::EvtHandler#evt_webview_fullscreen_changed}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_FULLSCREEN_CHANGED} event, generated when the page wants to enter or leave fullscreen. Use GetInt to get the status. Not implemented for the IE backend. Available only in wxWidgets 3.1.5 or later.
|
|
385
|
+
#
|
|
386
|
+
# - {Wx::EvtHandler#evt_webview_script_message_received}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED} event. Available only in wxWidgets 3.1.5 or later. For usage details see {Wx::WEB::WebView#add_script_message_handler}.
|
|
387
|
+
#
|
|
388
|
+
# - {Wx::EvtHandler#evt_webview_script_result}(id, meth = nil, &block): Process a {Wx::WEB::EVT_WEBVIEW_SCRIPT_RESULT} event. Available only in wxWidgets 3.1.6 or later. For usage details see {Wx::WEB::WebView#run_script_async}.
|
|
389
|
+
#
|
|
390
|
+
# - wxEVT_WEBVIEW_BROWSING_DATA_CLEARED(id, func): Process a {Wx::WEB::EVT_WEBVIEW_BROWSING_DATA_CLEARED} event only available in wxWidgets 3.3.0 or later. For usage details see {Wx::WEB::WebView#clear_browsing_data}.
|
|
391
|
+
#
|
|
392
|
+
# Library: {Wx::WEB::WebView}
|
|
393
|
+
# Category: {Wx::Controls}, {Wx::WEB::WebView}
|
|
394
|
+
# @see Wx::WEB::WebViewEvent
|
|
395
|
+
# @see Wx::WEB::WebViewConfiguration
|
|
396
|
+
# @see Wx::WEB::WebViewHandler
|
|
397
|
+
#
|
|
398
|
+
#
|
|
399
|
+
# @wxrb_require USE_WEBVIEW
|
|
400
|
+
class WebView < Control
|
|
401
|
+
|
|
402
|
+
# Runs the given JavaScript code.
|
|
403
|
+
#
|
|
404
|
+
# <div class="wxrb-note">
|
|
405
|
+
# <b>Note:</b>
|
|
406
|
+
# <p>Because of various potential issues it's recommended to use {Wx::WEB::WebView#run_script_async} instead of this method. This is especially true if you plan to run code from a webview event and will also prevent unintended side effects on the UI outside of the webview.
|
|
407
|
+
# </p>
|
|
408
|
+
# </div>
|
|
409
|
+
#
|
|
410
|
+
# JavaScript code is executed inside the browser control and has full access to DOM and other browser-provided functionality. For example, this code
|
|
411
|
+
#
|
|
412
|
+
# ```ruby
|
|
413
|
+
# webview.run_script('document.write('Hello from wxWidgets!')')
|
|
414
|
+
# ```
|
|
415
|
+
# will replace the current page contents with the provided string.
|
|
416
|
+
# This method returns the result of executing this code on success (or nil if no result or on failure), e.g. a JavaScript value such as a string, a number (integer or floating point), a boolean or JSON representation for non-primitive types such as arrays and objects. For example:
|
|
417
|
+
#
|
|
418
|
+
# ```ruby
|
|
419
|
+
# if (result = webview.run_script('document.getElementById('some_id').innerHTML'))
|
|
420
|
+
# #... result contains the contents of the given element ...
|
|
421
|
+
# # else: the element with this ID probably doesn't exist.
|
|
422
|
+
# end
|
|
423
|
+
# ```
|
|
424
|
+
#
|
|
425
|
+
# This function has a few platform-specific limitations:
|
|
426
|
+
#
|
|
427
|
+
# - When using WebKit v1 in WXGTK2, retrieving the result of JavaScript execution is unsupported and this function will always return nil if output is non-null to indicate this. This functionality is fully supported when using WebKit v2 or later in WXGTK3.
|
|
428
|
+
# - When using WebKit under macOS, code execution is limited to at most 10MiB of memory and 10 seconds of execution time.
|
|
429
|
+
# - When using Chromium backend, retrieving the result of JavaScript execution is unsupported and this function will always return nil if output is non-null to indicate this.
|
|
430
|
+
# - When using IE backend under MSW, scripts can only be executed when the current page is fully loaded (i.e. {Wx::WEB::EVT_WEBVIEW_LOADED} event was received). A script tag inside the page HTML is required in order to run JavaScript.
|
|
431
|
+
#
|
|
432
|
+
# Also notice that with the IE backend converting JavaScript objects to JSON is not supported in the default emulation mode, it implements its own object-to-JSON conversion as a fallback for this case, however it is not as full-featured, well-tested or performing as the implementation of this functionality in the browser control itself, so it is recommended to use Wx::WEB::WebView::msw_set_ie_emulation_level to change emulation level to a more modern one in which JSON conversion is done by the control itself.
|
|
433
|
+
# @see Wx::WEB::WebView#run_script_async
|
|
434
|
+
# @param javascript [String] JavaScript code to execute.
|
|
435
|
+
# @return [String,nil]
|
|
436
|
+
def run_script(javascript) end
|
|
437
|
+
|
|
438
|
+
# Runs the given JavaScript code asynchronously and returns the result via a {Wx::WEB::EVT_WEBVIEW_SCRIPT_RESULT}.
|
|
439
|
+
#
|
|
440
|
+
# The script result value can be retrieved via {Wx::WEB::WebViewEvent#get_string}. If the execution fails {Wx::WEB::WebViewEvent#is_error} will return true. In this case additional script execution error information maybe available via {Wx::WEB::WebViewEvent#get_string}.
|
|
441
|
+
#
|
|
442
|
+
# <div class="wxrb-note">
|
|
443
|
+
# <b>Note:</b>
|
|
444
|
+
# <p>The IE backend does not support async script execution.
|
|
445
|
+
# </p>
|
|
446
|
+
# </div>
|
|
447
|
+
# @see Wx::WEB::WebView#run_script
|
|
448
|
+
# @param javascript [String] JavaScript code to execute.
|
|
449
|
+
# @return [void]
|
|
450
|
+
def run_script_async(javascript) end
|
|
451
|
+
|
|
452
|
+
# Add a script message handler with the given name.
|
|
453
|
+
#
|
|
454
|
+
# To use the script message handler from javascript use <code>window.<name>.postMessage(<messageBody>)</code> where <code><name></code> corresponds the value of the name parameter. The <code><messageBody></code> will be available to the application via a {Wx::WEB::EVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED} event.
|
|
455
|
+
# Sample code receiving a script message:
|
|
456
|
+
#
|
|
457
|
+
# ```ruby
|
|
458
|
+
# # Install message handler with the name wx_msg
|
|
459
|
+
# @webView.add_script_message_handler("wx_msg")
|
|
460
|
+
# # Bind handler
|
|
461
|
+
# @webView.evt_webview_script_message_received(Wx::ID_ANY) { |evt|
|
|
462
|
+
# Wx.log_message("Script message received; value = %s, handler = %s", evt.get_string, evt.get_message_handler)
|
|
463
|
+
# }
|
|
464
|
+
# ```
|
|
465
|
+
#
|
|
466
|
+
# Sample JavaScript sending a script message:
|
|
467
|
+
# ```
|
|
468
|
+
# // Send sample message body
|
|
469
|
+
# window.wx_msg.postMessage('This is a message body');
|
|
470
|
+
# ```
|
|
471
|
+
#
|
|
472
|
+
# true if the handler could be added, false if it could not be added.
|
|
473
|
+
#
|
|
474
|
+
# <div class="wxrb-note">
|
|
475
|
+
# <b>Note:</b>
|
|
476
|
+
# <p>The Edge backend only supports a single message handler and the Chromium and IE backends do not support script message handlers.
|
|
477
|
+
# </p>
|
|
478
|
+
# </div>
|
|
479
|
+
# @see Wx::WEB::WebView#remove_script_message_handler
|
|
480
|
+
# @param name [String] Name of the message handler that can be used from JavaScript
|
|
481
|
+
# @return [Boolean]
|
|
482
|
+
def add_script_message_handler(name) end
|
|
483
|
+
|
|
484
|
+
# Remove a script message handler with the given name that was previously added via {Wx::WEB::WebView#add_script_message_handler}.
|
|
485
|
+
#
|
|
486
|
+
# true if the handler could be removed, false if it could not be removed.
|
|
487
|
+
# @see Wx::WEB::WebView#add_script_message_handler
|
|
488
|
+
# @param name [String]
|
|
489
|
+
# @return [Boolean]
|
|
490
|
+
def remove_script_message_handler(name) end
|
|
491
|
+
|
|
492
|
+
# Injects the specified script into the webpage's content.
|
|
493
|
+
#
|
|
494
|
+
# true if the script was added successfully.
|
|
495
|
+
#
|
|
496
|
+
# <div class="wxrb-note">
|
|
497
|
+
# <b>Note:</b>
|
|
498
|
+
# <p>Please note that this is unsupported by the IE backend and the Edge backend does only support {Wx::WEB::WebViewUserScriptInjectionTime::WEBVIEW_INJECT_AT_DOCUMENT_START}.
|
|
499
|
+
# </p>
|
|
500
|
+
# </div>
|
|
501
|
+
# @see Wx::WEB::WebView#remove_all_user_scripts
|
|
502
|
+
# @param javascript [String] The JavaScript code to add.
|
|
503
|
+
# @param injectionTime [Wx::WebViewUserScriptInjectionTime] Specifies when the script will be executed.
|
|
504
|
+
# @return [Boolean]
|
|
505
|
+
def add_user_script(javascript, injectionTime=Wx::WEB::WebViewUserScriptInjectionTime::WEBVIEW_INJECT_AT_DOCUMENT_START) end
|
|
506
|
+
|
|
507
|
+
# Removes all user scripts from the web view.
|
|
508
|
+
#
|
|
509
|
+
#
|
|
510
|
+
# @see Wx::WEB::WebView#add_user_script
|
|
511
|
+
# @return [void]
|
|
512
|
+
def remove_all_user_scripts; end
|
|
513
|
+
|
|
514
|
+
# Returns true if the current selection can be copied.
|
|
515
|
+
# @return [Boolean]
|
|
516
|
+
def can_copy; end
|
|
517
|
+
alias_method :can_copy?, :can_copy
|
|
518
|
+
|
|
519
|
+
# Returns true if the current selection can be cut.
|
|
520
|
+
# @return [Boolean]
|
|
521
|
+
def can_cut; end
|
|
522
|
+
alias_method :can_cut?, :can_cut
|
|
523
|
+
|
|
524
|
+
# Returns true if data can be pasted.
|
|
525
|
+
# @return [Boolean]
|
|
526
|
+
def can_paste; end
|
|
527
|
+
alias_method :can_paste?, :can_paste
|
|
528
|
+
|
|
529
|
+
# Copies the current selection.
|
|
530
|
+
# @return [void]
|
|
531
|
+
def copy; end
|
|
532
|
+
|
|
533
|
+
# Cuts the current selection.
|
|
534
|
+
# @return [void]
|
|
535
|
+
def cut; end
|
|
536
|
+
|
|
537
|
+
# Pastes the current data.
|
|
538
|
+
# @return [void]
|
|
539
|
+
def paste; end
|
|
540
|
+
|
|
541
|
+
# Enable or disable the right click context menu.
|
|
542
|
+
#
|
|
543
|
+
# By default the standard context menu is enabled, this method can be used to disable it or re-enable it later.
|
|
544
|
+
# @param enable [Boolean]
|
|
545
|
+
# @return [void]
|
|
546
|
+
def enable_context_menu(enable=true) end
|
|
547
|
+
|
|
548
|
+
# Returns true if a context menu will be shown on right click.
|
|
549
|
+
# @return [Boolean]
|
|
550
|
+
def is_context_menu_enabled; end
|
|
551
|
+
alias_method :context_menu_enabled?, :is_context_menu_enabled
|
|
552
|
+
|
|
553
|
+
# Enable or disable access to dev tools for the user.
|
|
554
|
+
#
|
|
555
|
+
# Dev tools are disabled by default.
|
|
556
|
+
#
|
|
557
|
+
# <div class="wxrb-note">
|
|
558
|
+
# <b>Note:</b>
|
|
559
|
+
# <p>This is not implemented for the IE backend.
|
|
560
|
+
# </p>
|
|
561
|
+
# </div>
|
|
562
|
+
# @see Wx::WEB::WebView#show_dev_tools
|
|
563
|
+
# @param enable [Boolean]
|
|
564
|
+
# @return [void]
|
|
565
|
+
def enable_access_to_dev_tools(enable=true) end
|
|
566
|
+
|
|
567
|
+
# Returns true if dev tools are available to the user.
|
|
568
|
+
# @return [Boolean]
|
|
569
|
+
def is_access_to_dev_tools_enabled; end
|
|
570
|
+
alias_method :access_to_dev_tools_enabled?, :is_access_to_dev_tools_enabled
|
|
571
|
+
|
|
572
|
+
# Show the dev tools window.
|
|
573
|
+
#
|
|
574
|
+
# Immediately open the dev tools window. Does nothing if this window was already open.
|
|
575
|
+
# Unlike {Wx::WEB::WebView#enable_access_to_dev_tools}, which allows the user to open the dev tools window from the context menu, this function opens the same window programmatically.
|
|
576
|
+
# Please note that while {Wx::WEB::WebView#show_dev_tools} can be used whether access to the dev tools from the context menu was enabled or not, in WebKit2GTK+ backend calling it also enables interactive access to the dev tools from the context menu as a side effect.
|
|
577
|
+
# true if the dev tools window is shown (even if it had been already shown before this function was called), false if it could not be shown for some reason, most likely because the backend does not provide this functionality.
|
|
578
|
+
#
|
|
579
|
+
# <div class="wxrb-note">
|
|
580
|
+
# <b>Note:</b>
|
|
581
|
+
# <p>This function is not implemented in the IE and WebKit (GTK/macOS) backends (but is implemented for WebKit2 GTK backend).
|
|
582
|
+
# </p>
|
|
583
|
+
# </div>
|
|
584
|
+
# @return [Boolean]
|
|
585
|
+
def show_dev_tools; end
|
|
586
|
+
|
|
587
|
+
# Enable or disable if browser accelerator keys are enabled.
|
|
588
|
+
#
|
|
589
|
+
# Browser accelerator keys are enabled by default.
|
|
590
|
+
# The webview might implement various accelerator keys. This includes allowing accelerator key access to features such as printing and navigation. In many cases this might not be desired and the default keys can be disabled with this setting.
|
|
591
|
+
#
|
|
592
|
+
# <div class="wxrb-note">
|
|
593
|
+
# <b>Note:</b>
|
|
594
|
+
# <p>This is only implemented for the Edge backend.
|
|
595
|
+
# </p>
|
|
596
|
+
# </div>
|
|
597
|
+
# @param enable [Boolean]
|
|
598
|
+
# @return [void]
|
|
599
|
+
def enable_browser_accelerator_keys(enable=true) end
|
|
600
|
+
|
|
601
|
+
# Returns true if browser accelerator keys are enabled.
|
|
602
|
+
# @return [Boolean]
|
|
603
|
+
def are_browser_accelerator_keys_enabled; end
|
|
604
|
+
|
|
605
|
+
# Returns true if it is possible to navigate backward in the history of visited pages.
|
|
606
|
+
# @return [Boolean]
|
|
607
|
+
def can_go_back; end
|
|
608
|
+
alias_method :can_go_back?, :can_go_back
|
|
609
|
+
|
|
610
|
+
# Returns true if it is possible to navigate forward in the history of visited pages.
|
|
611
|
+
# @return [Boolean]
|
|
612
|
+
def can_go_forward; end
|
|
613
|
+
alias_method :can_go_forward?, :can_go_forward
|
|
614
|
+
|
|
615
|
+
# Clear the history, this will also remove the visible page.
|
|
616
|
+
#
|
|
617
|
+
# <div class="wxrb-note">
|
|
618
|
+
# <b>Note:</b>
|
|
619
|
+
# <p>This is not implemented on the WebKit2GTK+ backend and macOS.
|
|
620
|
+
# </p>
|
|
621
|
+
# </div>
|
|
622
|
+
# @return [void]
|
|
623
|
+
def clear_history; end
|
|
624
|
+
|
|
625
|
+
# Enable or disable the history.
|
|
626
|
+
#
|
|
627
|
+
# This will also clear the history.
|
|
628
|
+
#
|
|
629
|
+
# <div class="wxrb-note">
|
|
630
|
+
# <b>Note:</b>
|
|
631
|
+
# <p>This is not implemented on the WebKit2GTK+ backend and macOS.
|
|
632
|
+
# </p>
|
|
633
|
+
# </div>
|
|
634
|
+
# @param enable [Boolean]
|
|
635
|
+
# @return [void]
|
|
636
|
+
def enable_history(enable=true) end
|
|
637
|
+
|
|
638
|
+
# Returns a list of items in the back history.
|
|
639
|
+
#
|
|
640
|
+
# The first item in the vector is the first page that was loaded by the control.
|
|
641
|
+
# @return [Array<Wx::WEB::WebViewHistoryItem>]
|
|
642
|
+
def get_backward_history; end
|
|
643
|
+
alias_method :backward_history, :get_backward_history
|
|
644
|
+
|
|
645
|
+
# Returns a list of items in the forward history.
|
|
646
|
+
#
|
|
647
|
+
# The first item in the vector is the next item in the history with respect to the currently loaded page.
|
|
648
|
+
# @return [Array<Wx::WEB::WebViewHistoryItem>]
|
|
649
|
+
def get_forward_history; end
|
|
650
|
+
alias_method :forward_history, :get_forward_history
|
|
651
|
+
|
|
652
|
+
# Navigate back in the history of visited pages.
|
|
653
|
+
#
|
|
654
|
+
# Only valid if {Wx::WEB::WebView#can_go_back} returns true.
|
|
655
|
+
# @return [void]
|
|
656
|
+
def go_back; end
|
|
657
|
+
|
|
658
|
+
# Navigate forward in the history of visited pages.
|
|
659
|
+
#
|
|
660
|
+
# Only valid if {Wx::WEB::WebView#can_go_forward} returns true.
|
|
661
|
+
# @return [void]
|
|
662
|
+
def go_forward; end
|
|
663
|
+
|
|
664
|
+
# Loads a history item.
|
|
665
|
+
# @param item [Wx::WEB::WebViewHistoryItem]
|
|
666
|
+
# @return [void]
|
|
667
|
+
def load_history_item(item) end
|
|
668
|
+
|
|
669
|
+
# Clears the current selection.
|
|
670
|
+
# @return [void]
|
|
671
|
+
def clear_selection; end
|
|
672
|
+
|
|
673
|
+
# Deletes the current selection.
|
|
674
|
+
#
|
|
675
|
+
# Note that for {Wx::WEBVIEW_BACKEND_WEBKIT} the selection must be editable, either through SetEditable or the correct HTML attribute.
|
|
676
|
+
# @return [void]
|
|
677
|
+
def delete_selection; end
|
|
678
|
+
|
|
679
|
+
# Returns the currently selected source, if any.
|
|
680
|
+
# @return [String]
|
|
681
|
+
def get_selected_source; end
|
|
682
|
+
alias_method :selected_source, :get_selected_source
|
|
683
|
+
|
|
684
|
+
# Returns the currently selected text, if any.
|
|
685
|
+
# @return [String]
|
|
686
|
+
def get_selected_text; end
|
|
687
|
+
alias_method :selected_text, :get_selected_text
|
|
688
|
+
|
|
689
|
+
# Returns true if there is a current selection.
|
|
690
|
+
# @return [Boolean]
|
|
691
|
+
def has_selection; end
|
|
692
|
+
alias_method :has_selection?, :has_selection
|
|
693
|
+
|
|
694
|
+
# Selects the entire page.
|
|
695
|
+
# @return [void]
|
|
696
|
+
def select_all; end
|
|
697
|
+
|
|
698
|
+
# Returns true if there is an action to redo.
|
|
699
|
+
# @return [Boolean]
|
|
700
|
+
def can_redo; end
|
|
701
|
+
alias_method :can_redo?, :can_redo
|
|
702
|
+
|
|
703
|
+
# Returns true if there is an action to undo.
|
|
704
|
+
# @return [Boolean]
|
|
705
|
+
def can_undo; end
|
|
706
|
+
alias_method :can_undo?, :can_undo
|
|
707
|
+
|
|
708
|
+
# Redos the last action.
|
|
709
|
+
# @return [void]
|
|
710
|
+
def redo_; end
|
|
711
|
+
|
|
712
|
+
# Undos the last action.
|
|
713
|
+
# @return [void]
|
|
714
|
+
def undo; end
|
|
715
|
+
|
|
716
|
+
# Finds a phrase on the current page and if found, the control will scroll the phrase into view and select it.
|
|
717
|
+
#
|
|
718
|
+
# If search phrase was not found in combination with the flags then {Wx::NOT_FOUND} is returned. If called for the first time with search phrase then the total number of results will be returned. Then for every time its called with the same search phrase it will return the number of the current match.
|
|
719
|
+
#
|
|
720
|
+
# <div class="wxrb-note">
|
|
721
|
+
# <b>Note:</b>
|
|
722
|
+
# <p>This function will restart the search if the flags {Wx::WEB::WebViewFindFlags::WEBVIEW_FIND_ENTIRE_WORD} or {Wx::WEB::WebViewFindFlags::WEBVIEW_FIND_MATCH_CASE} are changed, since this will require a new search. To reset the search, for example resetting the highlights call the function with an empty search phrase.
|
|
723
|
+
# </p>
|
|
724
|
+
# </div>
|
|
725
|
+
# @param text [String] The phrase to search for.
|
|
726
|
+
# @param flags [Wx::WebViewFindFlags] The flags for the search.
|
|
727
|
+
# @return [Integer]
|
|
728
|
+
def find(text, flags=Wx::WEB::WebViewFindFlags::WEBVIEW_FIND_DEFAULT) end
|
|
729
|
+
|
|
730
|
+
# Retrieve whether a zoom type is supported.
|
|
731
|
+
#
|
|
732
|
+
# true if this type of zoom is supported by this backend (and thus can be set through {Wx::WEB::WebView#set_zoom_type}).
|
|
733
|
+
# @param type [Wx::WebViewZoomType] The zoom type to test.
|
|
734
|
+
# @return [Boolean]
|
|
735
|
+
def can_set_zoom_type(type) end
|
|
736
|
+
alias_method :can_set_zoom_type?, :can_set_zoom_type
|
|
737
|
+
|
|
738
|
+
# Get the zoom level of the page.
|
|
739
|
+
#
|
|
740
|
+
# See {Wx::WEB::WebView#get_zoom_factor} to get more precise zoom scale value other than as provided by {Wx::WEB::WebViewZoom}. The current level of zoom.
|
|
741
|
+
# @return [Wx::WebViewZoom]
|
|
742
|
+
def get_zoom; end
|
|
743
|
+
alias_method :zoom, :get_zoom
|
|
744
|
+
|
|
745
|
+
# Get the zoom factor of the page.
|
|
746
|
+
#
|
|
747
|
+
# The current factor of zoom.
|
|
748
|
+
# @return [Float]
|
|
749
|
+
def get_zoom_factor; end
|
|
750
|
+
alias_method :zoom_factor, :get_zoom_factor
|
|
751
|
+
|
|
752
|
+
# Get how the zoom factor is currently interpreted.
|
|
753
|
+
#
|
|
754
|
+
# How the zoom factor is currently interpreted by the backend.
|
|
755
|
+
# @return [Wx::WebViewZoomType]
|
|
756
|
+
def get_zoom_type; end
|
|
757
|
+
alias_method :zoom_type, :get_zoom_type
|
|
758
|
+
|
|
759
|
+
# Set the zoom level of the page.
|
|
760
|
+
#
|
|
761
|
+
# See {Wx::WEB::WebView#set_zoom_factor} for more precise scaling other than the measured steps provided by {Wx::WEB::WebViewZoom}.
|
|
762
|
+
# @param zoom [Wx::WebViewZoom] How much to zoom (scale) the HTML document.
|
|
763
|
+
# @return [void]
|
|
764
|
+
def set_zoom(zoom) end
|
|
765
|
+
alias_method :zoom=, :set_zoom
|
|
766
|
+
|
|
767
|
+
# Set the zoom factor of the page.
|
|
768
|
+
#
|
|
769
|
+
# <div class="wxrb-note">
|
|
770
|
+
# <b>Note:</b>
|
|
771
|
+
# <p>zoom scale in IE will be converted into {Wx::WEB::WebViewZoom} levels for {Wx::WEB::WebViewZoomType} of {Wx::WEB::WebViewZoomType::WEBVIEW_ZOOM_TYPE_TEXT}.
|
|
772
|
+
# </p>
|
|
773
|
+
# </div>
|
|
774
|
+
# @param zoom [Float] How much to zoom (scale) the HTML document in arbitrary number.
|
|
775
|
+
# @return [void]
|
|
776
|
+
def set_zoom_factor(zoom) end
|
|
777
|
+
alias_method :zoom_factor=, :set_zoom_factor
|
|
778
|
+
|
|
779
|
+
# Set how to interpret the zoom factor.
|
|
780
|
+
#
|
|
781
|
+
# <div class="wxrb-note">
|
|
782
|
+
# <b>Note:</b>
|
|
783
|
+
# <p>invoke {Wx::WEB::WebView#can_set_zoom_type} first, some backends may not support all zoom types.
|
|
784
|
+
# </p>
|
|
785
|
+
# </div>
|
|
786
|
+
# @param zoomType [Wx::WebViewZoomType] How the zoom factor should be interpreted by the backend.
|
|
787
|
+
# @return [void]
|
|
788
|
+
def set_zoom_type(zoomType) end
|
|
789
|
+
alias_method :zoom_type=, :set_zoom_type
|
|
790
|
+
|
|
791
|
+
# Creation function for two-step creation.
|
|
792
|
+
#
|
|
793
|
+
# Please note that the object creation may be asynchronous when using some backends (e.g., {Wx::WebViewEdge} or {Wx::WebViewChromium}) and the object is not really created until {Wx::WEB::EVT_WEBVIEW_CREATED} event is received, so any non-trivial calls to its member functions should be delayed until then.
|
|
794
|
+
# @param parent [Wx::Window]
|
|
795
|
+
# @param id [Integer]
|
|
796
|
+
# @param url [String]
|
|
797
|
+
# @param pos [Array(Integer, Integer), Wx::Point]
|
|
798
|
+
# @param size [Array(Integer, Integer), Wx::Size]
|
|
799
|
+
# @param style [Integer]
|
|
800
|
+
# @param name [String]
|
|
801
|
+
# @return [Boolean]
|
|
802
|
+
def create(parent, id, url=Wx::WEB_VIEW_DEFAULT_URL_STR, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::WEB_VIEW_NAME_STR) end
|
|
803
|
+
|
|
804
|
+
# Get the title of the current web page, or its URL/path if title is not available.
|
|
805
|
+
# @return [String]
|
|
806
|
+
def get_current_title; end
|
|
807
|
+
alias_method :current_title, :get_current_title
|
|
808
|
+
|
|
809
|
+
# Get the URL of the currently displayed document.
|
|
810
|
+
# @return [String]
|
|
811
|
+
def get_current_url; end
|
|
812
|
+
alias_method :current_url, :get_current_url
|
|
813
|
+
|
|
814
|
+
# Get the HTML source code of the currently displayed document.
|
|
815
|
+
#
|
|
816
|
+
# The HTML source code, or an empty string if no page is currently shown.
|
|
817
|
+
# @return [String]
|
|
818
|
+
def get_page_source; end
|
|
819
|
+
alias_method :page_source, :get_page_source
|
|
820
|
+
|
|
821
|
+
# Get the text of the current page.
|
|
822
|
+
# @return [String]
|
|
823
|
+
def get_page_text; end
|
|
824
|
+
alias_method :page_text, :get_page_text
|
|
825
|
+
|
|
826
|
+
# Returns whether the web control is currently busy (e.g. loading a page).
|
|
827
|
+
# @return [Boolean]
|
|
828
|
+
def is_busy; end
|
|
829
|
+
alias_method :busy?, :is_busy
|
|
830
|
+
|
|
831
|
+
# Returns whether the web control is currently editable.
|
|
832
|
+
# @return [Boolean]
|
|
833
|
+
def is_editable; end
|
|
834
|
+
alias_method :editable?, :is_editable
|
|
835
|
+
|
|
836
|
+
# Load a web page from a URL.
|
|
837
|
+
#
|
|
838
|
+
# <div class="wxrb-note">
|
|
839
|
+
# <b>Note:</b>
|
|
840
|
+
# <p>Web engines generally report errors asynchronously, so if you wish to know whether loading the URL was successful, register to receive navigation error events.
|
|
841
|
+
# </p>
|
|
842
|
+
# </div>
|
|
843
|
+
# @param url [String] The URL of the page to be loaded.
|
|
844
|
+
# @return [void]
|
|
845
|
+
def load_url(url) end
|
|
846
|
+
|
|
847
|
+
# @overload print()
|
|
848
|
+
# Opens a print dialog (with the backend's default settings) so that the user may print the currently displayed page.
|
|
849
|
+
# @return [void]
|
|
850
|
+
# @overload print(printData, flags=Wx::WEB::WebViewPrintFlags::WEBVIEW_PRINT_HIDE_HEADER_FOOTER)
|
|
851
|
+
# Prints the currently displayed page using the given print settings.
|
|
852
|
+
#
|
|
853
|
+
# The printData parameter allows specifying paper size, orientation, number of copies, duplex mode and colour/greyscale output.
|
|
854
|
+
# The flags parameter is a combination of {Wx::WEB::WebViewPrintFlags} values. By default, headers and footers are shown (where supported by the backend). Pass {Wx::WEB::WebViewPrintFlags::WEBVIEW_PRINT_HIDE_HEADER_FOOTER} to suppress them.
|
|
855
|
+
# This overload is only available when {Wx::Setup::USE_PRINTING_ARCHITECTURE} is set to 1. Backends that do not support programmatic print settings will fall back to the parameterless {Wx::WEB::WebView#print}.
|
|
856
|
+
# Currently the Edge backend (MSW) has full support for all {Wx::PRT::PrintData} settings including header/footer control. The GTK and macOS backends support paper size, orientation, and copies but ignore flags. The IE and Chromium backends fall back to {Wx::WEB::WebView#print}.
|
|
857
|
+
# @param printData [Wx::PRT::PrintData] The print settings to use.
|
|
858
|
+
# @param flags [Integer] A combination of {Wx::WEB::WebViewPrintFlags} values.
|
|
859
|
+
# @return [void]
|
|
860
|
+
def print(*args) end
|
|
861
|
+
|
|
862
|
+
# Registers a custom scheme handler.
|
|
863
|
+
#
|
|
864
|
+
# <div class="wxrb-note">
|
|
865
|
+
# <b>Note:</b>
|
|
866
|
+
# <p>On macOS in order to use handlers two-step creation has to be used and {Wx::WEB::WebView#register_handler} has to be called before {Wx::WEB::WebView#create}. With the other backends it has to be called after {Wx::WEB::WebView#create}.
|
|
867
|
+
# </p>
|
|
868
|
+
# </div>
|
|
869
|
+
#
|
|
870
|
+
# <div class="wxrb-note">
|
|
871
|
+
# <b>Note:</b>
|
|
872
|
+
# <p>The Edge backend does not support custom schemes, but the handler is available as a virtual host under <code>https://scheme.wxsite</code>. To customize this virtual host call {Wx::WEB::WebViewHandler#set_virtual_host} before registering the handler.
|
|
873
|
+
# </p>
|
|
874
|
+
# </div>
|
|
875
|
+
# @param handler [Wx::WebViewHandler>] A shared pointer to a {Wx::WebHandler}.
|
|
876
|
+
# @return [void]
|
|
877
|
+
def register_handler(handler) end
|
|
878
|
+
|
|
879
|
+
# Reload the currently displayed URL.
|
|
880
|
+
#
|
|
881
|
+
# <div class="wxrb-note">
|
|
882
|
+
# <b>Note:</b>
|
|
883
|
+
# <p>The flags are ignored by the Edge backend.
|
|
884
|
+
# </p>
|
|
885
|
+
# </div>
|
|
886
|
+
# @param flags [Wx::WebViewReloadFlags] A bit array that may optionally contain reload options.
|
|
887
|
+
# @return [void]
|
|
888
|
+
def reload(flags=Wx::WEB::WebViewReloadFlags::WEBVIEW_RELOAD_DEFAULT) end
|
|
889
|
+
|
|
890
|
+
# Set the editable property of the web control.
|
|
891
|
+
#
|
|
892
|
+
# Enabling allows the user to edit the page even if the contenteditable attribute is not set. The exact capabilities vary with the backend being used.
|
|
893
|
+
#
|
|
894
|
+
# <div class="wxrb-note">
|
|
895
|
+
# <b>Note:</b>
|
|
896
|
+
# <p>This is not implemented for macOS and the Edge backend.
|
|
897
|
+
# </p>
|
|
898
|
+
# </div>
|
|
899
|
+
# @param enable [Boolean]
|
|
900
|
+
# @return [void]
|
|
901
|
+
def set_editable(enable=true) end
|
|
902
|
+
alias_method :editable=, :set_editable
|
|
903
|
+
|
|
904
|
+
# @overload set_page(html, baseUrl)
|
|
905
|
+
# Set the displayed page source to the contents of the given string.
|
|
906
|
+
#
|
|
907
|
+
# <div class="wxrb-note">
|
|
908
|
+
# <b>Note:</b>
|
|
909
|
+
# <p>When using {Wx::WEB::WEBVIEW_BACKEND_IE} you must wait for the current page to finish loading before calling {Wx::WEB::WebView#set_page}. The baseURL parameter is not used in this backend and the Edge backend.
|
|
910
|
+
# </p>
|
|
911
|
+
# </div>
|
|
912
|
+
# @param html [String] The string that contains the HTML data to display.
|
|
913
|
+
# @param baseUrl [String] URL assigned to the HTML data, to be used to resolve relative paths, for instance.
|
|
914
|
+
# @return [void]
|
|
915
|
+
# @overload set_page(html, baseUrl)
|
|
916
|
+
# Set the displayed page source to the contents of the given stream.
|
|
917
|
+
# @param html [IO,Wx::InputStream] The stream to read HTML data from.
|
|
918
|
+
# @param baseUrl [String] URL assigned to the HTML data, to be used to resolve relative paths, for instance.
|
|
919
|
+
# @return [void]
|
|
920
|
+
def set_page(*args) end
|
|
921
|
+
|
|
922
|
+
# Stop the current page loading process, if any.
|
|
923
|
+
#
|
|
924
|
+
# May trigger an error event of type {Wx::WEB::WebViewNavigationError::WEBVIEW_NAV_ERR_USER_CANCELLED}. TODO: make {Wx::WEB::WebViewNavigationError::WEBVIEW_NAV_ERR_USER_CANCELLED} errors uniform across ports.
|
|
925
|
+
# @return [void]
|
|
926
|
+
def stop; end
|
|
927
|
+
|
|
928
|
+
# Specify a custom user agent string for the web view.
|
|
929
|
+
#
|
|
930
|
+
# Returns true the user agent could be set.
|
|
931
|
+
# If your first request should already use the custom user agent please use two step creation and call {Wx::WEB::WebView#set_user_agent} before {Wx::WEB::WebView#create}.
|
|
932
|
+
#
|
|
933
|
+
# <div class="wxrb-note">
|
|
934
|
+
# <b>Note:</b>
|
|
935
|
+
# <p>This is not implemented for IE.
|
|
936
|
+
# </p>
|
|
937
|
+
# </div>
|
|
938
|
+
# @param userAgent [String]
|
|
939
|
+
# @return [Boolean]
|
|
940
|
+
def set_user_agent(userAgent) end
|
|
941
|
+
alias_method :user_agent=, :set_user_agent
|
|
942
|
+
|
|
943
|
+
# Returns the current user agent string for the web view.
|
|
944
|
+
# @return [String]
|
|
945
|
+
def get_user_agent; end
|
|
946
|
+
alias_method :user_agent, :get_user_agent
|
|
947
|
+
|
|
948
|
+
# Set the proxy to use for all requests.
|
|
949
|
+
#
|
|
950
|
+
# The proxy string must be a valid proxy specification, e.g. <code>http://my.local.proxy.corp:8080</code>
|
|
951
|
+
# Currently this function is only implemented in WebKit2, Edge and Chromium backends and only WebKit2 backend allows to set the proxy after creating the webview, so it is recommended to call it before {Wx::WEB::WebView#create}:
|
|
952
|
+
#
|
|
953
|
+
# ```ruby
|
|
954
|
+
# webview = Wx::WEB::WebView.new
|
|
955
|
+
# unless webview.set_proxy("http://127.0.0.1:8080")
|
|
956
|
+
# Wx.log_warning("Setting proxy failed!")
|
|
957
|
+
# end
|
|
958
|
+
# webview.create(parent, Wx::ID_ANY)
|
|
959
|
+
# ```
|
|
960
|
+
#
|
|
961
|
+
# true if proxy was set successfully or false if it failed, e.g. because this is not supported by the currently used backend.
|
|
962
|
+
# @param proxy [String]
|
|
963
|
+
# @return [Boolean]
|
|
964
|
+
def set_proxy(proxy) end
|
|
965
|
+
alias_method :proxy=, :set_proxy
|
|
966
|
+
|
|
967
|
+
# Clears the browsing data of the web view.
|
|
968
|
+
#
|
|
969
|
+
# This function clears the browsing data of the web view, such as cookies, cache, history, etc. The exact data that is cleared depends on the backend used.
|
|
970
|
+
# This operation is asynchronous and may take some time to complete. When finished {Wx::WEB::EVT_WEBVIEW_BROWSING_DATA_CLEARED} event is generated.
|
|
971
|
+
#
|
|
972
|
+
# false if backend doesn't support clearing browsing data or an error occurred. Otherwise, true is returned and the browsing data will be cleared asynchronously and the application will receive a {Wx::WEB::EVT_WEBVIEW_BROWSING_DATA_CLEARED} event when it is done (or if doing it fails later).
|
|
973
|
+
#
|
|
974
|
+
# <div class="wxrb-note">
|
|
975
|
+
# <b>Note:</b>
|
|
976
|
+
# <p>This is only implemented in the Edge, WebKit2GTK+ and macOS backends.
|
|
977
|
+
# </p>
|
|
978
|
+
# </div>
|
|
979
|
+
# @see Wx::WEB::WebViewBrowsingDataTypes
|
|
980
|
+
# @param types [Integer] The types of browsing data to clear. By default, it clears all types of browsing data.
|
|
981
|
+
# @param since [Time,Date,DateTime] The time since when the browsing data should be cleared. By default, it clears all browsing data.
|
|
982
|
+
# @return [Boolean]
|
|
983
|
+
def clear_browsing_data(types=Wx::WEB::WebViewBrowsingDataTypes::WEBVIEW_BROWSING_DATA_ALL, since=({})) end
|
|
984
|
+
|
|
985
|
+
# @overload self.new(backend=Wx::WEB_VIEW_BACKEND_DEFAULT)
|
|
986
|
+
# Factory function to create a new {Wx::WEB::WebView} with two-step creation, {Wx::WEB::WebView#create} should be called on the returned object.
|
|
987
|
+
#
|
|
988
|
+
# The created {Wx::WEB::WebView}.
|
|
989
|
+
# @param backend [String] The backend to use.
|
|
990
|
+
# @return [Wx::WEB::WebView]
|
|
991
|
+
# @overload self.new(config)
|
|
992
|
+
# Factory function to create a new {Wx::WEB::WebView} with two-step creation, {Wx::WEB::WebView#create} should be called on the returned object.
|
|
993
|
+
#
|
|
994
|
+
# The created {Wx::WEB::WebView}
|
|
995
|
+
# @param config [Wx::WEB::WebViewConfiguration] a configuration object create with {Wx::WEB::WebView.new_configuration}.
|
|
996
|
+
# @return [Wx::WEB::WebView]
|
|
997
|
+
# @overload self.new(parent, id, url=Wx::WEB_VIEW_DEFAULT_URL_STR, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, backend=Wx::WEB_VIEW_BACKEND_DEFAULT, style=0, name=Wx::WEB_VIEW_NAME_STR)
|
|
998
|
+
# Factory function to create a new {Wx::WEB::WebView} using a {Wx::WebViewFactory}.
|
|
999
|
+
#
|
|
1000
|
+
# Note that the returned object may not be immediately usable yet, see {Wx::WEB::WebView#create} and {Wx::WEB::EVT_WEBVIEW_CREATED}.
|
|
1001
|
+
#
|
|
1002
|
+
# The created {Wx::WEB::WebView}, or nil if the requested backend is not available
|
|
1003
|
+
# @param parent [Wx::Window] Parent window for the control
|
|
1004
|
+
# @param id [Integer] ID of this control
|
|
1005
|
+
# @param url [String] Initial URL to load
|
|
1006
|
+
# @param pos [Array(Integer, Integer), Wx::Point] Position of the control
|
|
1007
|
+
# @param size [Array(Integer, Integer), Wx::Size] Size of the control
|
|
1008
|
+
# @param backend [String] The backend web engine to use. {Wx::WebViewBackendDefault} and other backend names constants in format <code>wxWebViewBackend<Name></code> (e.g., {Wx::WebViewBackendWebKit}) are predefined where appropriate. See Backend descriptions.
|
|
1009
|
+
# @param style [Integer] Window style. For generic window styles, please see {Wx::Window}.
|
|
1010
|
+
# @param name [String] Window name.
|
|
1011
|
+
# @return [Wx::WEB::WebView]
|
|
1012
|
+
def self.new(*args) end
|
|
1013
|
+
|
|
1014
|
+
# Allows to check if a specific backend is currently available.
|
|
1015
|
+
#
|
|
1016
|
+
# For example, to check for Edge backend availability:
|
|
1017
|
+
#
|
|
1018
|
+
# ```ruby
|
|
1019
|
+
# if Wx::WEB::WebView::is_backend_available(Wx::WEB::WEBVIEW_BACKEND_EDGE)
|
|
1020
|
+
# #... enable some extra functionality not available with the IE backend ...
|
|
1021
|
+
# end
|
|
1022
|
+
# ```
|
|
1023
|
+
# @param backend [String]
|
|
1024
|
+
# @return [Boolean]
|
|
1025
|
+
def self.is_backend_available(backend) end
|
|
1026
|
+
|
|
1027
|
+
# Retrieve the version information about the backend implementation.
|
|
1028
|
+
# @param backend [String] The name of the backend to retrieve the version information for, can be left unspecified to use the default backend.
|
|
1029
|
+
# @param context [Wx::VersionContext] The context in which the version information is requested, by default it is the run-time version. Currently only GTK WebKit and CEF backends support returning compile-time version information, all the other backends return an empty {Wx::VersionInfo} object in this case.
|
|
1030
|
+
# @return [Wx::VersionInfo]
|
|
1031
|
+
def self.get_backend_version_info(backend=Wx::WEB_VIEW_BACKEND_DEFAULT, context=VersionContext::RunTime) end
|
|
1032
|
+
|
|
1033
|
+
# Create a new {Wx::WEB::WebViewConfiguration} object.
|
|
1034
|
+
# @param backend [String]
|
|
1035
|
+
# @return [Wx::WEB::WebViewConfiguration]
|
|
1036
|
+
def self.new_configuration(backend=Wx::WEB_VIEW_BACKEND_DEFAULT) end
|
|
1037
|
+
|
|
1038
|
+
end # WebView
|
|
1039
|
+
|
|
1040
|
+
# A simple class that contains the URL and title of an element of the history of a {Wx::WEB::WebView}.
|
|
1041
|
+
#
|
|
1042
|
+
# Category: {Wx::WEB::WebView}
|
|
1043
|
+
# @see Wx::WEB::WebView
|
|
1044
|
+
#
|
|
1045
|
+
#
|
|
1046
|
+
#
|
|
1047
|
+
# @note This class is <b>untracked</b> and should not be derived from nor instances extended!
|
|
1048
|
+
# @wxrb_require USE_WEBVIEW
|
|
1049
|
+
class WebViewHistoryItem < ::Object
|
|
1050
|
+
|
|
1051
|
+
# Constructor.
|
|
1052
|
+
# @param url [String]
|
|
1053
|
+
# @param title [String]
|
|
1054
|
+
# @return [Wx::WEB::WebViewHistoryItem]
|
|
1055
|
+
def initialize(url, title) end
|
|
1056
|
+
|
|
1057
|
+
#
|
|
1058
|
+
#
|
|
1059
|
+
# The url of the page.
|
|
1060
|
+
# @return [String]
|
|
1061
|
+
def get_url; end
|
|
1062
|
+
alias_method :url, :get_url
|
|
1063
|
+
|
|
1064
|
+
#
|
|
1065
|
+
#
|
|
1066
|
+
# The title of the page.
|
|
1067
|
+
# @return [String]
|
|
1068
|
+
def get_title; end
|
|
1069
|
+
alias_method :title, :get_title
|
|
1070
|
+
|
|
1071
|
+
end # WebViewHistoryItem
|
|
1072
|
+
|
|
1073
|
+
# This class allows access to web view configuration options and settings, that have to be specified before placing a webview in a window with {Wx::WEB::WebView#create}.
|
|
1074
|
+
#
|
|
1075
|
+
# Category: {Wx::WEB::WebView}
|
|
1076
|
+
# @see Wx::WEB::WebView.new_configuration
|
|
1077
|
+
#
|
|
1078
|
+
#
|
|
1079
|
+
# @wxrb_require USE_WEBVIEW
|
|
1080
|
+
class WebViewConfiguration < ::Object
|
|
1081
|
+
|
|
1082
|
+
# Returns the backend identifier for which this configuration was created.
|
|
1083
|
+
# @return [String]
|
|
1084
|
+
def get_backend; end
|
|
1085
|
+
alias_method :backend, :get_backend
|
|
1086
|
+
|
|
1087
|
+
# Set the data path for the webview.
|
|
1088
|
+
#
|
|
1089
|
+
# This is the path where the webview stores its data, such as cookies, local storage, etc.
|
|
1090
|
+
#
|
|
1091
|
+
# <div class="wxrb-note">
|
|
1092
|
+
# <b>Note:</b>
|
|
1093
|
+
# <p>This is used by Edge, WebKit2GTK+ and Chromium backends (the latter creates "UserData" subdirectory under the given path).
|
|
1094
|
+
# </p>
|
|
1095
|
+
# </div>
|
|
1096
|
+
# @param path [String] The path to the data directory.
|
|
1097
|
+
# @return [void]
|
|
1098
|
+
def set_data_path(path) end
|
|
1099
|
+
alias_method :data_path=, :set_data_path
|
|
1100
|
+
|
|
1101
|
+
# Returns the data path for the webview.
|
|
1102
|
+
#
|
|
1103
|
+
# This is the path where the webview stores its data, such as cookies, local storage, etc. The path to the data directory.
|
|
1104
|
+
#
|
|
1105
|
+
# <div class="wxrb-note">
|
|
1106
|
+
# <b>Note:</b>
|
|
1107
|
+
# <p>This is used by Edge, WebKit2GTK+ and Chromium backends and always returns empty string for the other ones.
|
|
1108
|
+
# </p>
|
|
1109
|
+
# </div>
|
|
1110
|
+
# @return [String]
|
|
1111
|
+
def get_data_path; end
|
|
1112
|
+
alias_method :data_path, :get_data_path
|
|
1113
|
+
|
|
1114
|
+
# Allows to disable persistent storage for the webview.
|
|
1115
|
+
#
|
|
1116
|
+
# The default is to enable it. When the webview is created without persistent storage the data is stored in memory and is lost when the webview is destroyed. In browsers this is equivalent to "private browsing" or "incognito mode".
|
|
1117
|
+
# true if the backend supports to modify this setting. false if the setting is not supported by the backend.
|
|
1118
|
+
#
|
|
1119
|
+
# <div class="wxrb-note">
|
|
1120
|
+
# <b>Note:</b>
|
|
1121
|
+
# <p>This is only implemented on the Edge, WebKit2GTK+ and macOS backends.
|
|
1122
|
+
# </p>
|
|
1123
|
+
# </div>
|
|
1124
|
+
# @param enable [Boolean]
|
|
1125
|
+
# @return [Boolean]
|
|
1126
|
+
def enable_persistent_storage(enable) end
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
protected
|
|
1130
|
+
|
|
1131
|
+
end # WebViewConfiguration
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
end
|
|
1135
|
+
|
|
1136
|
+
end
|