xlang v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QCefView.x
浏览该文件的文档.
1//xlang Source, Name:qt5/widgets/QCefView.x
2//Date: Mon Oct 07:39:43 2022
3package Qt{
4 @SuppressWarnings public class QCefConfig{
5 public enum LogLevel
6 {
8 LOGSEVERITY_DEFAULT,
10 LOGSEVERITY_VERBOSE,
12 LOGSEVERITY_DEBUG,
14 LOGSEVERITY_INFO,
16 LOGSEVERITY_WARNING,
18 LOGSEVERITY_ERROR,
20 LOGSEVERITY_FATAL,
22 LOGSEVERITY_DISABLE = 99
23 };
24
25 JsonObject args = new JsonObject();
26 JsonArray cmds = new JsonArray();
27 JsonArray resdir = new JsonArray();
28 JsonObject cmdv = new JsonObject();
29
30 void setProperty(String key, String val){
31 while (args.has(key)){
32 args.remove(key);
33 }
34 args.put(key, val);
35 }
36
37 void setProperty(String key, int val){
38 while (args.has(key)){
39 args.remove(key);
40 }
41 args.put(key, val);
42 }
43
44 public void setUserAgent(String agent){
45 setProperty("agent", agent);
46 }
47
48 public void setLogLevel(LogLevel lev){
49 setProperty("loglevel", lev.value());
50 }
51
52 public void setBridgeObjectName(String value){
53 setProperty("bridge", value);
54 }
55
56 public void setRemoteDebuggingPort(int port){
57 setProperty("port", port);
58 }
59
60 public void setBackgroundColor(int color){
61 setProperty("background", color);
62 }
63
64
65 public void addCommandLineSwitch(String value){
66 cmds.put(value);
67 }
68
70 cmdv.put(key, val);
71 }
72
73 public void initializ(){
74 args.put("cmd", cmds);
75 args.put("cmdsw", cmdv);
76 QtXnl.widget_slot_string(0, Constant.INITCEF, args.toString(false));
77 args.remove("cmd");
78 args.remove("cmdsw");
79 }
80 };
81
82 @SuppressWarnings public class QCefView : QWidget{
83 public static class onCefListener{
84 public void loadingStateChanged(QCefView view, int browserId, bool isLoading, bool canGoBack, bool canGoForward){}
85 public void loadStart(QCefView view, int browserId, long frameId, bool isMainFrame, int transition_type){}
86 public void loadEnd(QCefView view, int browserId, long frameId, bool isMainFrame, int httpStatusCode){}
87 public void loadError(QCefView view, int browserId,
88 long frameId,
89 bool isMainFrame,
90 int errorCode,
91 String errorMsg,
92 String failedUrl){}
93 public void addressChanged(QCefView view, long frameId, String url){}
94 public void titleChanged(QCefView view, String title){}
95 public void fullscreenModeChanged(QCefView view, bool fullscreen){}
96 public void statusMessage(QCefView view, String message){}
97 public void consoleMessage(QCefView view, String message, int level){}
98 public void loadingProgressChanged(QCefView view, double progress){}
99 public void cefQueryRequest(QCefView view, int browserId, long frameId, QCefQuery query){}
100 public void invokeMethod(QCefView view, int browserId, long frameId, String method, String [] arguments){}
101 public void reportJavascriptResult(QCefView view, int browserId, long frameId, long context, String result){}
102 public void onBrowserWindowCreated(QCefView view, QWindow win){}
103 public void onBrowserCoreCreated(QCefView view, QWindow win){}
104 public bool onSchemeTrigged(QCefView view, String scheme, String url, String domain, String param){ return false; }
105 public bool onBeforePopup(QCefView view, long frameId,
106 String targetUrl,
107 String targetFrameName,
108 int targetDisposition,
109 QCefSetting settings,
110 bool [] DisableJavascriptAccess)
111 {
112 return true;
113 }
114
115 public void onPopupCreated(QCefView view, QWindow wnd){}
116 };
117
118 private onCefListener _ceflistener = nilptr;
119
120 public void setOnCefListener(onCefListener _l){
121 _ceflistener = _l;
122 }
136
137 public QCefView(){
138
139 }
140
141 public QCefView(long handle){
142 super(handle);
143 }
144
145 public static void addLocalResourceDir(String url, String local){
146 Qt.QtXnl.long_string2(0, Constant.CEF_ADDLOCALRES, local, url);
147 }
148
149 public void addLocalFolderResource(String url, String local){
150 Qt.QtXnl.long_string2(nativehandle, Constant.CEF_DADDLOCALRES, local, url);
151 }
152
153 public void navigateToUrl(String url){
154 Qt.QtXnl.widget_slot_string(nativehandle, Constant.CEF_NAVIGATETOURL, url);
155 }
156
157 public void registryScheme(String scheme, String domain){
158 Qt.QtXnl.long_string2(nativehandle, Constant.CEF_REGISTRYSCHEME, scheme, domain);
159 }
160
161 public void sendEvent(String name, String value){
162 Qt.QtXnl.long_string2(nativehandle, Constant.CEF_BOARDCAST, name, value);
163 }
164
165 public void navigateToString(String content){
166 Qt.QtXnl.widget_slot_string(nativehandle, Constant.CEF_NAVIGATETOSTRING, content);
167 }
168
169 public bool create(@NotNilptr QWidget parent)override {
170 nativehandle = Qt.QtXnl.createQSObject(Qt.QType.qtCefView, this, parent.nativehandle, nilptr);
171 if (nativehandle == 0){
172 return false;
173 }
174 return true;
175 }
176
177 public bool create(@NotNilptr String url, @NotNilptr QWidget parent) {
178 nativehandle = Qt.QtXnl.createQSObject(Qt.QType.qtCefView, this, parent.nativehandle, url);
179 if (nativehandle == 0){
180 return false;
181 }
182 return true;
183 }
184
185
186 public bool create(QCefSetting setting, @NotNilptr QWidget parent) {
187 nativehandle = Qt.QtXnl.createQLLSObject(Qt.QType.qtCefView, this, parent.nativehandle, setting.nativehandle, nilptr);
188 if (nativehandle == 0){
189 return false;
190 }
191 return true;
192 }
193
194 public bool create(QCefSetting setting, @NotNilptr String url, @NotNilptr QWidget parent) {
195 nativehandle = Qt.QtXnl.createQLLSObject(Qt.QType.qtCefView, this, parent.nativehandle, setting.nativehandle, url);
196 if (nativehandle == 0){
197 return false;
198 }
199 return true;
200 }
201
202 public void loadingStateChanged(int browserId, bool isLoading, bool canGoBack, bool canGoForward){
203 if (_ceflistener != nilptr){
204 _ceflistener.loadingStateChanged(this, browserId, isLoading, canGoBack, canGoForward);
205 }
206 }
207 public void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type){
208 if (_ceflistener != nilptr){
209 _ceflistener.loadStart(this, browserId, frameId, isMainFrame, transition_type);
210 }
211 }
212 public void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode){
213 if (_ceflistener != nilptr){
214 _ceflistener.loadEnd(this, browserId, frameId, isMainFrame, httpStatusCode);
215 }
216 }
217 public void loadError(int browserId,
218 long frameId,
219 bool isMainFrame,
220 int errorCode,
221 String errorMsg,
222 String failedUrl)
223 {
224 if (_ceflistener != nilptr){
225 _ceflistener.loadError(this, browserId,frameId,isMainFrame,errorCode,errorMsg,failedUrl);
226 }
227 }
228
229
230 public void addressChanged(long frameId, String url){
231 if (_ceflistener != nilptr){
232 _ceflistener.addressChanged(this, frameId, url);
233 }
234 }
235 public void titleChanged(String title){
236 if (_ceflistener != nilptr){
237 _ceflistener.titleChanged(this, title);
238 }
239 }
240
241 public void fullscreenModeChanged(bool fullscreen){
242 if (_ceflistener != nilptr){
243 _ceflistener.fullscreenModeChanged(this, fullscreen);
244 }
245 }
246 public void statusMessage(String message){
247 if (_ceflistener != nilptr){
248 _ceflistener.statusMessage(this, message);
249 }
250 }
251 public void consoleMessage(String message, int level){
252 if (_ceflistener != nilptr){
253 _ceflistener.consoleMessage(this, message, level);
254 }
255 }
256 public void loadingProgressChanged(double progress){
257 if (_ceflistener != nilptr){
258 _ceflistener.loadingProgressChanged(this, progress);
259 }
260 }
261 public void cefQueryRequest(int browserId, long frameId, long query){
262 QCefQuery _query = new QCefQuery(query);
263 if (_ceflistener != nilptr){
264 _ceflistener.cefQueryRequest(this, browserId, frameId, _query);
265 }
266 }
267 public void invokeMethod(int browserId, long frameId, String method, String [] arguments){
268 if (_ceflistener != nilptr){
269 _ceflistener.invokeMethod(this, browserId, frameId, method, arguments);
270 }
271 }
272 public void reportJavascriptResult(int browserId, long frameId, long context, String result){
273 if (_ceflistener != nilptr){
274 _ceflistener.reportJavascriptResult(this, browserId, frameId, context, result);
275 }
276 }
277 public void onBrowserCoreCreated(QWindow win){
278 if (_ceflistener != nilptr){
279 _ceflistener.onBrowserCoreCreated(this, win);
280 }
281 }
282
283 public bool onSchemeTrigged(String scheme, String url, String domain, String param){
284 if (_ceflistener != nilptr){
285 return _ceflistener.onSchemeTrigged(this, scheme, url, domain, param);
286 }
287 return false;
288 }
289
290 public void onBrowserWindowCreated(QWindow win){
291 if (_ceflistener != nilptr){
292 _ceflistener.onBrowserWindowCreated(this, win);
293 }
294 }
295
296
297 public bool onBeforePopup(long frameId,
298 String targetUrl,
299 String targetFrameName,
300 int targetDisposition,
301 long settings,
302 bool [] DisableJavascriptAccess)
303 {
304 QCefSetting setting = new QCefSetting(settings);
305 if (_ceflistener != nilptr){
306 return _ceflistener.onBeforePopup(this, frameId, targetUrl, targetFrameName, targetDisposition, setting, DisableJavascriptAccess);
307 }
308 return false;
309 }
310
311 public void onPopupCreated(QWindow wnd){
312 if (_ceflistener != nilptr){
313 _ceflistener.onPopupCreated(this, wnd);
314 }
315 }
316
317 };
318};
void put(int, Object)
String toString(bool)
bool has(Object)
void put(Object, Object)
bool remove(Object)
void setLogLevel(LogLevel lev)
Definition QCefView.x:48
void addCommandLineSwitchWithValue(String key, String val)
Definition QCefView.x:69
void addCommandLineSwitch(String value)
Definition QCefView.x:65
void setBackgroundColor(int color)
Definition QCefView.x:60
void initializ()
Definition QCefView.x:73
void setUserAgent(String agent)
Definition QCefView.x:44
void setRemoteDebuggingPort(int port)
Definition QCefView.x:56
void setBridgeObjectName(String value)
Definition QCefView.x:52
void setProperty(String key, String val)
Definition QCefView.x:30
void setProperty(String key, int val)
Definition QCefView.x:37
void cefQueryRequest(QCefView view, int browserId, long frameId, QCefQuery query)
Definition QCefView.x:99
void statusMessage(QCefView view, String message)
Definition QCefView.x:96
void loadStart(QCefView view, int browserId, long frameId, bool isMainFrame, int transition_type)
Definition QCefView.x:85
void loadingStateChanged(QCefView view, int browserId, bool isLoading, bool canGoBack, bool canGoForward)
Definition QCefView.x:84
void loadEnd(QCefView view, int browserId, long frameId, bool isMainFrame, int httpStatusCode)
Definition QCefView.x:86
void titleChanged(QCefView view, String title)
Definition QCefView.x:94
void reportJavascriptResult(QCefView view, int browserId, long frameId, long context, String result)
Definition QCefView.x:101
void onBrowserCoreCreated(QCefView view, QWindow win)
Definition QCefView.x:103
void fullscreenModeChanged(QCefView view, bool fullscreen)
Definition QCefView.x:95
void loadError(QCefView view, int browserId, long frameId, bool isMainFrame, int errorCode, String errorMsg, String failedUrl)
Definition QCefView.x:87
void loadingProgressChanged(QCefView view, double progress)
Definition QCefView.x:98
void onPopupCreated(QCefView view, QWindow wnd)
Definition QCefView.x:115
bool onBeforePopup(QCefView view, long frameId, String targetUrl, String targetFrameName, int targetDisposition, QCefSetting settings, bool [] DisableJavascriptAccess)
Definition QCefView.x:105
void invokeMethod(QCefView view, int browserId, long frameId, String method, String [] arguments)
Definition QCefView.x:100
void consoleMessage(QCefView view, String message, int level)
Definition QCefView.x:97
bool onSchemeTrigged(QCefView view, String scheme, String url, String domain, String param)
Definition QCefView.x:104
void addressChanged(QCefView view, long frameId, String url)
Definition QCefView.x:93
void onBrowserWindowCreated(QCefView view, QWindow win)
Definition QCefView.x:102
void statusMessage(String message)
Definition QCefView.x:246
bool onBeforePopup(long frameId, String targetUrl, String targetFrameName, int targetDisposition, long settings, bool [] DisableJavascriptAccess)
Definition QCefView.x:297
void navigateToString(String content)
Definition QCefView.x:165
void reportJavascriptResult(int browserId, long frameId, long context, String result)
Definition QCefView.x:272
void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type)
Definition QCefView.x:207
void navigateToUrl(String url)
Definition QCefView.x:153
void sendEvent(String name, String value)
Definition QCefView.x:161
void loadingProgressChanged(double progress)
Definition QCefView.x:256
void setOnCefListener(onCefListener _l)
Definition QCefView.x:120
void onBrowserWindowCreated(QWindow win)
Definition QCefView.x:290
void loadingStateChanged(int browserId, bool isLoading, bool canGoBack, bool canGoForward)
Definition QCefView.x:202
void addLocalFolderResource(String url, String local)
Definition QCefView.x:149
void onBrowserCoreCreated(QWindow win)
Definition QCefView.x:277
void registryScheme(String scheme, String domain)
Definition QCefView.x:157
void addressChanged(long frameId, String url)
Definition QCefView.x:230
QCefView(long handle)
Definition QCefView.x:141
bool create(@NotNilptr QWidget parent) override
Definition QCefView.x:169
bool create(QCefSetting setting, @NotNilptr String url, @NotNilptr QWidget parent)
Definition QCefView.x:194
void titleChanged(String title)
Definition QCefView.x:235
void consoleMessage(String message, int level)
Definition QCefView.x:251
void fullscreenModeChanged(bool fullscreen)
Definition QCefView.x:241
void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode)
Definition QCefView.x:212
bool create(@NotNilptr String url, @NotNilptr QWidget parent)
Definition QCefView.x:177
bool create(QCefSetting setting, @NotNilptr QWidget parent)
Definition QCefView.x:186
void loadError(int browserId, long frameId, bool isMainFrame, int errorCode, String errorMsg, String failedUrl)
Definition QCefView.x:217
void invokeMethod(int browserId, long frameId, String method, String [] arguments)
Definition QCefView.x:267
static void addLocalResourceDir(String url, String local)
Definition QCefView.x:145
bool onSchemeTrigged(String scheme, String url, String domain, String param)
Definition QCefView.x:283
void onPopupCreated(QWindow wnd)
Definition QCefView.x:311
void cefQueryRequest(int browserId, long frameId, long query)
Definition QCefView.x:261
static const int qtCefView
Definition QTypes.xcsm:101
long cdecl createQLLSObject(int type, Object xobj, long parent, long lparam, String param)
void cdecl widget_slot_string(long h, int proid, String value)
long cdecl createQSObject(int type, Object xobj, long parent, String param)
long cdecl long_string2(long handle,int proid, String v1, String v2)
Definition String.x:5
Definition QCefQuery.x:3