4 @SuppressWarnings public class QCefConfig{
22 LOGSEVERITY_DISABLE = 99
31 while (args.
has(key)){
38 while (args.
has(key)){
45 setProperty(
"agent", agent);
49 setProperty(
"loglevel", lev.value());
53 setProperty(
"bridge", value);
57 setProperty(
"port", port);
61 setProperty(
"background", color);
74 args.
put(
"cmd", cmds);
75 args.
put(
"cmdsw", cmdv);
76 QtXnl.widget_slot_string(0, Constant.INITCEF, args.
toString(
false));
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){}
99 public void cefQueryRequest(QCefView view,
int browserId,
long frameId, QCefQuery query){}
108 int targetDisposition,
109 QCefSetting settings,
110 bool [] DisableJavascriptAccess)
118 private onCefListener _ceflistener = nilptr;
123 public enum CefWindowOpenDisposition
134 CefWindowOpenDispositionIgnoreAction
169 public bool create(@NotNilptr QWidget parent)
override {
171 if (nativehandle == 0){
179 if (nativehandle == 0){
186 public bool create(QCefSetting setting, @NotNilptr QWidget parent) {
188 if (nativehandle == 0){
194 public bool create(QCefSetting setting, @NotNilptr
String url, @NotNilptr QWidget parent) {
196 if (nativehandle == 0){
203 if (_ceflistener != nilptr){
204 _ceflistener.loadingStateChanged(
this, browserId, isLoading, canGoBack, canGoForward);
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);
212 public void loadEnd(
int browserId,
long frameId,
bool isMainFrame,
int httpStatusCode){
213 if (_ceflistener != nilptr){
214 _ceflistener.loadEnd(
this, browserId, frameId, isMainFrame, httpStatusCode);
224 if (_ceflistener != nilptr){
225 _ceflistener.loadError(
this, browserId,frameId,isMainFrame,errorCode,errorMsg,failedUrl);
231 if (_ceflistener != nilptr){
232 _ceflistener.addressChanged(
this, frameId, url);
236 if (_ceflistener != nilptr){
237 _ceflistener.titleChanged(
this, title);
242 if (_ceflistener != nilptr){
243 _ceflistener.fullscreenModeChanged(
this, fullscreen);
247 if (_ceflistener != nilptr){
248 _ceflistener.statusMessage(
this, message);
252 if (_ceflistener != nilptr){
253 _ceflistener.consoleMessage(
this, message, level);
257 if (_ceflistener != nilptr){
258 _ceflistener.loadingProgressChanged(
this, progress);
262 QCefQuery _query =
new QCefQuery(query);
263 if (_ceflistener != nilptr){
264 _ceflistener.cefQueryRequest(
this, browserId, frameId, _query);
268 if (_ceflistener != nilptr){
269 _ceflistener.invokeMethod(
this, browserId, frameId, method, arguments);
273 if (_ceflistener != nilptr){
274 _ceflistener.reportJavascriptResult(
this, browserId, frameId, context, result);
278 if (_ceflistener != nilptr){
279 _ceflistener.onBrowserCoreCreated(
this, win);
284 if (_ceflistener != nilptr){
285 return _ceflistener.onSchemeTrigged(
this, scheme, url, domain, param);
291 if (_ceflistener != nilptr){
292 _ceflistener.onBrowserWindowCreated(
this, win);
300 int targetDisposition,
302 bool [] DisableJavascriptAccess)
304 QCefSetting setting =
new QCefSetting(settings);
305 if (_ceflistener != nilptr){
306 return _ceflistener.onBeforePopup(
this, frameId, targetUrl, targetFrameName, targetDisposition, setting, DisableJavascriptAccess);
312 if (_ceflistener != nilptr){
313 _ceflistener.onPopupCreated(
this, wnd);
void setLogLevel(LogLevel lev)
void addCommandLineSwitchWithValue(String key, String val)
void addCommandLineSwitch(String value)
void setBackgroundColor(int color)
void setUserAgent(String agent)
void setRemoteDebuggingPort(int port)
void setBridgeObjectName(String value)
void setProperty(String key, String val)
void setProperty(String key, int val)
void cefQueryRequest(QCefView view, int browserId, long frameId, QCefQuery query)
void statusMessage(QCefView view, String message)
void loadStart(QCefView view, int browserId, long frameId, bool isMainFrame, int transition_type)
void loadingStateChanged(QCefView view, int browserId, bool isLoading, bool canGoBack, bool canGoForward)
void loadEnd(QCefView view, int browserId, long frameId, bool isMainFrame, int httpStatusCode)
void titleChanged(QCefView view, String title)
void reportJavascriptResult(QCefView view, int browserId, long frameId, long context, String result)
void onBrowserCoreCreated(QCefView view, QWindow win)
void fullscreenModeChanged(QCefView view, bool fullscreen)
void loadError(QCefView view, int browserId, long frameId, bool isMainFrame, int errorCode, String errorMsg, String failedUrl)
void loadingProgressChanged(QCefView view, double progress)
void onPopupCreated(QCefView view, QWindow wnd)
bool onBeforePopup(QCefView view, long frameId, String targetUrl, String targetFrameName, int targetDisposition, QCefSetting settings, bool [] DisableJavascriptAccess)
void invokeMethod(QCefView view, int browserId, long frameId, String method, String [] arguments)
void consoleMessage(QCefView view, String message, int level)
bool onSchemeTrigged(QCefView view, String scheme, String url, String domain, String param)
void addressChanged(QCefView view, long frameId, String url)
void onBrowserWindowCreated(QCefView view, QWindow win)
void statusMessage(String message)
bool onBeforePopup(long frameId, String targetUrl, String targetFrameName, int targetDisposition, long settings, bool [] DisableJavascriptAccess)
void navigateToString(String content)
void reportJavascriptResult(int browserId, long frameId, long context, String result)
void loadStart(int browserId, long frameId, bool isMainFrame, int transition_type)
void navigateToUrl(String url)
void sendEvent(String name, String value)
void loadingProgressChanged(double progress)
void setOnCefListener(onCefListener _l)
void onBrowserWindowCreated(QWindow win)
void loadingStateChanged(int browserId, bool isLoading, bool canGoBack, bool canGoForward)
void addLocalFolderResource(String url, String local)
void onBrowserCoreCreated(QWindow win)
void registryScheme(String scheme, String domain)
void addressChanged(long frameId, String url)
bool create(@NotNilptr QWidget parent) override
bool create(QCefSetting setting, @NotNilptr String url, @NotNilptr QWidget parent)
void titleChanged(String title)
void consoleMessage(String message, int level)
void fullscreenModeChanged(bool fullscreen)
void loadEnd(int browserId, long frameId, bool isMainFrame, int httpStatusCode)
bool create(@NotNilptr String url, @NotNilptr QWidget parent)
bool create(QCefSetting setting, @NotNilptr QWidget parent)
void loadError(int browserId, long frameId, bool isMainFrame, int errorCode, String errorMsg, String failedUrl)
void invokeMethod(int browserId, long frameId, String method, String [] arguments)
static void addLocalResourceDir(String url, String local)
bool onSchemeTrigged(String scheme, String url, String domain, String param)
void onPopupCreated(QWindow wnd)
void cefQueryRequest(int browserId, long frameId, long query)
static const int qtCefView
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)
CefWindowOpenDispositionUnknown
CefWindowOpenDispositionSingletonTab
CefWindowOpenDispositionNewBackgroundTab
CefWindowOpenDispositionCurrentTab
CefWindowOpenDispositionSaveToDisk
CefWindowOpenDispositionNewForeGroundTab
CefWindowOpenDispositionNewWindow
CefWindowOpenDispositionOffTheRecord
CefWindowOpenDispositionNewPopup