All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.gui.QDesktopServices Maven / Gradle / Ivy

There is a newer version: 6.8.0
Show newest version
package io.qt.gui;

import io.qt.*;


/**
 * 

Methods for accessing common desktop services

*

Java wrapper for Qt class QDesktopServices

*/ public class QDesktopServices extends QtObject { static { QtJambi_LibraryUtilities.initialize(); } /** *

See QDesktopServices::QDesktopServices()

*/ public QDesktopServices(){ super((QPrivateConstructor)null); initialize_native(this); } private native static void initialize_native(QDesktopServices instance); /** *

See QDesktopServices::openUrl(QUrl)

*/ public static boolean openUrl(io.qt.core.@NonNull QUrl url){ return openUrl_native_cref_QUrl(QtJambi_LibraryUtilities.internal.checkedNativeId(url)); } private native static boolean openUrl_native_cref_QUrl(long url); /** *

See QDesktopServices::setUrlHandler(QString,QObject*,const char*)

*/ private static void setUrlHandler(java.lang.@NonNull String scheme, io.qt.core.@Nullable QObject receiver){ setUrlHandler_native_cref_QString_QObject_ptr_const_char_ptr(scheme, QtJambi_LibraryUtilities.internal.checkedNativeId(receiver)); } private native static void setUrlHandler_native_cref_QString_QObject_ptr_const_char_ptr(java.lang.String scheme, long receiver); /** *

See QDesktopServices::unsetUrlHandler(QString)

*/ public static void unsetUrlHandler(java.lang.@NonNull String scheme){ unsetUrlHandler_native_cref_QString(scheme); __rcUrlHandlers.remove(scheme); } private native static void unsetUrlHandler_native_cref_QString(java.lang.String scheme); /** * Constructor for internal use only. * @param p expected to be null. * @hidden */ @NativeAccess protected QDesktopServices(QPrivateConstructor p) { super(p); } private static java.util.TreeMap __rcUrlHandlers = new java.util.TreeMap(); public static interface UrlHandler { public void handleUrl(io.qt.core.QUrl url); } private static class InternalUrlHandler extends io.qt.core.QObject { private UrlHandler urlHandler; private InternalUrlHandler(UrlHandler urlHandler) { this.urlHandler = urlHandler; } @NativeAccess public void handleUrl(io.qt.core.QUrl url) { urlHandler.handleUrl(url); } } public static void setUrlHandler(String scheme, UrlHandler urlHandler) { if(urlHandler instanceof io.qt.core.QObject) { __rcUrlHandlers.put(scheme, (io.qt.core.QObject)urlHandler); setUrlHandler(scheme, (io.qt.core.QObject)urlHandler); }else { InternalUrlHandler receiver = urlHandler != null ? new InternalUrlHandler(urlHandler) : null; if (receiver == null) __rcUrlHandlers.remove(scheme); else __rcUrlHandlers.put(scheme, receiver); setUrlHandler(scheme, receiver); } } /** *

Overloaded function for {@link #openUrl(io.qt.core.QUrl)}.

*/ public static boolean openUrl(java.lang.@NonNull String url) { return openUrl(new io.qt.core.QUrl(url)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy