2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qdesktopservices.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QDesktopServices struct {
|
|
|
|
h *C.QDesktopServices
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDesktopServices) cPointer() *C.QDesktopServices {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQDesktopServices(h *C.QDesktopServices) *QDesktopServices {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QDesktopServices{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQDesktopServices_U(h unsafe.Pointer) *QDesktopServices {
|
|
|
|
return newQDesktopServices((*C.QDesktopServices)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDesktopServices_OpenUrl(url *QUrl) bool {
|
|
|
|
ret := C.QDesktopServices_OpenUrl(url.cPointer())
|
|
|
|
return (bool)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDesktopServices_SetUrlHandler(scheme string, receiver *QObject, method string) {
|
|
|
|
scheme_Cstring := C.CString(scheme)
|
|
|
|
defer C.free(unsafe.Pointer(scheme_Cstring))
|
|
|
|
method_Cstring := C.CString(method)
|
|
|
|
defer C.free(unsafe.Pointer(method_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
C.QDesktopServices_SetUrlHandler(scheme_Cstring, C.size_t(len(scheme)), receiver.cPointer(), method_Cstring)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDesktopServices_UnsetUrlHandler(scheme string) {
|
|
|
|
scheme_Cstring := C.CString(scheme)
|
|
|
|
defer C.free(unsafe.Pointer(scheme_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
C.QDesktopServices_UnsetUrlHandler(scheme_Cstring, C.size_t(len(scheme)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDesktopServices) Delete() {
|
|
|
|
C.QDesktopServices_Delete(this.h)
|
|
|
|
}
|