xlang v4.0 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(int browserId, bool isLoading, bool canGoBack, bool canGoForward){}
85 public void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type){}
86 public void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode){}
87 public void loadError(int browserId,
88 long frameId,
89 bool isMainFrame,
90 int errorCode,
91 String errorMsg,
92 String failedUrl){}
93 public void addressChanged(long frameId, String url){}
94 public void titleChanged(String title){}
95 public void fullscreenModeChanged(bool fullscreen){}
96 public void statusMessage(String message){}
97 public void consoleMessage(String message, int level){}
98 public void loadingProgressChanged(double progress){}
99 public void cefQueryRequest(int browserId, long frameId, QCefQuery query){}
100 public void invokeMethod(int browserId, long frameId, String method, String [] arguments){}
101 public void reportJavascriptResult(int browserId, long frameId, long context, String result){}
102 public void onBrowserWindowCreated(QWindow win){}
103 public bool onBeforePopup(long frameId,
104 String targetUrl,
105 String targetFrameName,
106 int targetDisposition,
107 QCefSetting settings,
108 bool [] DisableJavascriptAccess)
109 {
110 return true;
111 }
112
113 public void onPopupCreated(QWindow wnd){}
114 };
115
116 private onCefListener _ceflistener = nilptr;
117
118 public void setOnCefListener(onCefListener _l){
119 _ceflistener = _l;
120 }
134
135 public QCefView(){
136
137 }
138
139 public QCefView(long handle){
140 super(handle);
141 }
142
143 public static void addLocalResourceDir(String url, String local){
144 Qt.QtXnl.long_string2(0, Constant.CEF_ADDLOCALRES, local, url);
145 }
146
147 public void addLocalFolderResource(String url, String local){
148 Qt.QtXnl.long_string2(nativehandle, Constant.CEF_DADDLOCALRES, local, url);
149 }
150
151 public void navigateToUrl(String url){
152 Qt.QtXnl.widget_slot_string(nativehandle, Constant.CEF_NAVIGATETOURL, url);
153 }
154
155 public void navigateToString(String content){
156 Qt.QtXnl.widget_slot_string(nativehandle, Constant.CEF_NAVIGATETOSTRING, content);
157 }
158
159 public bool create(@NotNilptr QWidget parent)override {
160 nativehandle = Qt.QtXnl.createQSObject(Qt.QType.qtCefView, this, parent.nativehandle, nilptr);
161 if (nativehandle == 0){
162 return false;
163 }
164 return true;
165 }
166
167 public bool create(@NotNilptr String url, @NotNilptr QWidget parent) {
168 nativehandle = Qt.QtXnl.createQSObject(Qt.QType.qtCefView, this, parent.nativehandle, url);
169 if (nativehandle == 0){
170 return false;
171 }
172 return true;
173 }
174
175 public bool create(QCefSetting setting, @NotNilptr QWidget parent) {
176 nativehandle = Qt.QtXnl.createQLLSObject(Qt.QType.qtCefView, this, parent.nativehandle, setting.nativehandle, nilptr);
177 if (nativehandle == 0){
178 return false;
179 }
180 return true;
181 }
182
183 public bool create(QCefSetting setting, @NotNilptr String url, @NotNilptr QWidget parent) {
184 nativehandle = Qt.QtXnl.createQLLSObject(Qt.QType.qtCefView, this, parent.nativehandle, setting.nativehandle, url);
185 if (nativehandle == 0){
186 return false;
187 }
188 return true;
189 }
190
191 public void loadingStateChanged(int browserId, bool isLoading, bool canGoBack, bool canGoForward){
192 if (_ceflistener != nilptr){
193 _ceflistener.loadingStateChanged(browserId, isLoading, canGoBack, canGoForward);
194 }
195 }
196 public void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type){
197 if (_ceflistener != nilptr){
198 _ceflistener.loadStart(browserId, frameId, isMainFrame, transition_type);
199 }
200 }
201 public void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode){
202 if (_ceflistener != nilptr){
203 _ceflistener.loadEnd(browserId, frameId, isMainFrame, httpStatusCode);
204 }
205 }
206 public void loadError(int browserId,
207 long frameId,
208 bool isMainFrame,
209 int errorCode,
210 String errorMsg,
211 String failedUrl)
212 {
213 if (_ceflistener != nilptr){
214 _ceflistener.loadError(browserId,frameId,isMainFrame,errorCode,errorMsg,failedUrl);
215 }
216 }
217
218
219 public void addressChanged(long frameId, String url){
220 if (_ceflistener != nilptr){
221 _ceflistener.addressChanged(frameId, url);
222 }
223 }
224 public void titleChanged(String title){
225 if (_ceflistener != nilptr){
226 _ceflistener.titleChanged(title);
227 }
228 }
229
230 public void fullscreenModeChanged(bool fullscreen){
231 if (_ceflistener != nilptr){
232 _ceflistener.fullscreenModeChanged(fullscreen);
233 }
234 }
235 public void statusMessage(String message){
236 if (_ceflistener != nilptr){
237 _ceflistener.statusMessage(message);
238 }
239 }
240 public void consoleMessage(String message, int level){
241 if (_ceflistener != nilptr){
242 _ceflistener.consoleMessage(message, level);
243 }
244 }
245 public void loadingProgressChanged(double progress){
246 if (_ceflistener != nilptr){
247 _ceflistener.loadingProgressChanged(progress);
248 }
249 }
250 public void cefQueryRequest(int browserId, long frameId, long query){
251 QCefQuery _query = new QCefQuery(query);
252 if (_ceflistener != nilptr){
253 _ceflistener.cefQueryRequest(browserId, frameId, _query);
254 }
255 }
256 public void invokeMethod(int browserId, long frameId, String method, String [] arguments){
257 if (_ceflistener != nilptr){
258 _ceflistener.invokeMethod(browserId, frameId, method, arguments);
259 }
260 }
261 public void reportJavascriptResult(int browserId, long frameId, long context, String result){
262 if (_ceflistener != nilptr){
263 _ceflistener.reportJavascriptResult(browserId, frameId, context, result);
264 }
265 }
266 public void onBrowserWindowCreated(QWindow win){
267 if (_ceflistener != nilptr){
268 _ceflistener.onBrowserWindowCreated(win);
269 }
270 }
271
272
273 public bool onBeforePopup(long frameId,
274 String targetUrl,
275 String targetFrameName,
276 int targetDisposition,
277 long settings,
278 bool [] DisableJavascriptAccess)
279 {
280 QCefSetting setting = new QCefSetting(settings);
281 if (_ceflistener != nilptr){
282 return _ceflistener.onBeforePopup(frameId, targetUrl, targetFrameName, targetDisposition, setting, DisableJavascriptAccess);
283 }
284 return false;
285 }
286
287 public void onPopupCreated(QWindow wnd){
288 if (_ceflistener != nilptr){
289 _ceflistener.onPopupCreated(wnd);
290 }
291 }
292 };
293};
json数组类
void put(int, int)
String toString(bool)
JsonObject put(String, int)
bool has(String)
bool remove(String)
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 statusMessage(String message)
Definition QCefView.x:96
void reportJavascriptResult(int browserId, long frameId, long context, String result)
Definition QCefView.x:101
void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type)
Definition QCefView.x:85
void loadingProgressChanged(double progress)
Definition QCefView.x:98
void loadError(int browserId, long frameId, bool isMainFrame, int errorCode, String errorMsg, String failedUrl)
Definition QCefView.x:87
void onBrowserWindowCreated(QWindow win)
Definition QCefView.x:102
void loadingStateChanged(int browserId, bool isLoading, bool canGoBack, bool canGoForward)
Definition QCefView.x:84
void cefQueryRequest(int browserId, long frameId, QCefQuery query)
Definition QCefView.x:99
void addressChanged(long frameId, String url)
Definition QCefView.x:93
bool onBeforePopup(long frameId, String targetUrl, String targetFrameName, int targetDisposition, QCefSetting settings, bool [] DisableJavascriptAccess)
Definition QCefView.x:103
void titleChanged(String title)
Definition QCefView.x:94
void consoleMessage(String message, int level)
Definition QCefView.x:97
void fullscreenModeChanged(bool fullscreen)
Definition QCefView.x:95
void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode)
Definition QCefView.x:86
void invokeMethod(int browserId, long frameId, String method, String [] arguments)
Definition QCefView.x:100
void onPopupCreated(QWindow wnd)
Definition QCefView.x:113
void statusMessage(String message)
Definition QCefView.x:235
bool onBeforePopup(long frameId, String targetUrl, String targetFrameName, int targetDisposition, long settings, bool [] DisableJavascriptAccess)
Definition QCefView.x:273
void navigateToString(String content)
Definition QCefView.x:155
void reportJavascriptResult(int browserId, long frameId, long context, String result)
Definition QCefView.x:261
void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type)
Definition QCefView.x:196
void navigateToUrl(String url)
Definition QCefView.x:151
void loadingProgressChanged(double progress)
Definition QCefView.x:245
void setOnCefListener(onCefListener _l)
Definition QCefView.x:118
void onBrowserWindowCreated(QWindow win)
Definition QCefView.x:266
void loadingStateChanged(int browserId, bool isLoading, bool canGoBack, bool canGoForward)
Definition QCefView.x:191
void addLocalFolderResource(String url, String local)
Definition QCefView.x:147
void addressChanged(long frameId, String url)
Definition QCefView.x:219
QCefView(long handle)
Definition QCefView.x:139
bool create(@NotNilptr QWidget parent) override
Definition QCefView.x:159
bool create(QCefSetting setting, @NotNilptr String url, @NotNilptr QWidget parent)
Definition QCefView.x:183
void titleChanged(String title)
Definition QCefView.x:224
void consoleMessage(String message, int level)
Definition QCefView.x:240
void fullscreenModeChanged(bool fullscreen)
Definition QCefView.x:230
void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode)
Definition QCefView.x:201
bool create(@NotNilptr String url, @NotNilptr QWidget parent)
Definition QCefView.x:167
bool create(QCefSetting setting, @NotNilptr QWidget parent)
Definition QCefView.x:175
void loadError(int browserId, long frameId, bool isMainFrame, int errorCode, String errorMsg, String failedUrl)
Definition QCefView.x:206
void invokeMethod(int browserId, long frameId, String method, String [] arguments)
Definition QCefView.x:256
static void addLocalResourceDir(String url, String local)
Definition QCefView.x:143
void onPopupCreated(QWindow wnd)
Definition QCefView.x:287
void cefQueryRequest(int browserId, long frameId, long query)
Definition QCefView.x:250
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 QCefQuery.x:3