2024-10-20 05:21:03 +00:00
|
|
|
package qt6
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qmimetype.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QMimeType struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QMimeType
|
|
|
|
isSubclass bool
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) cPointer() *C.QMimeType {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQMimeType constructs the type using only CGO pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func newQMimeType(h *C.QMimeType) *QMimeType {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
return &QMimeType{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQMimeType constructs the type using only unsafe pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func UnsafeNewQMimeType(h unsafe.Pointer) *QMimeType {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQMimeType((*C.QMimeType)(h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMimeType constructs a new QMimeType object.
|
|
|
|
func NewQMimeType() *QMimeType {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQMimeType(C.QMimeType_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMimeType2 constructs a new QMimeType object.
|
|
|
|
func NewQMimeType2(other *QMimeType) *QMimeType {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQMimeType(C.QMimeType_new2(other.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) OperatorAssign(other *QMimeType) {
|
|
|
|
C.QMimeType_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) Swap(other *QMimeType) {
|
|
|
|
C.QMimeType_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) OperatorEqual(other *QMimeType) bool {
|
|
|
|
return (bool)(C.QMimeType_OperatorEqual(this.h, other.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) OperatorNotEqual(other *QMimeType) bool {
|
|
|
|
return (bool)(C.QMimeType_OperatorNotEqual(this.h, other.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) IsValid() bool {
|
|
|
|
return (bool)(C.QMimeType_IsValid(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) IsDefault() bool {
|
|
|
|
return (bool)(C.QMimeType_IsDefault(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) Name() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QMimeType_Name(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) Comment() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QMimeType_Comment(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) GenericIconName() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QMimeType_GenericIconName(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) IconName() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QMimeType_IconName(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) GlobPatterns() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QMimeType_GlobPatterns(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) ParentMimeTypes() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QMimeType_ParentMimeTypes(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) AllAncestors() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QMimeType_AllAncestors(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) Aliases() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QMimeType_Aliases(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) Suffixes() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QMimeType_Suffixes(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) PreferredSuffix() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QMimeType_PreferredSuffix(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) Inherits(mimeTypeName string) bool {
|
|
|
|
mimeTypeName_ms := C.struct_miqt_string{}
|
|
|
|
mimeTypeName_ms.data = C.CString(mimeTypeName)
|
|
|
|
mimeTypeName_ms.len = C.size_t(len(mimeTypeName))
|
|
|
|
defer C.free(unsafe.Pointer(mimeTypeName_ms.data))
|
|
|
|
return (bool)(C.QMimeType_Inherits(this.h, mimeTypeName_ms))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMimeType) FilterString() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QMimeType_FilterString(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QMimeType) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QMimeType_Delete(this.h, C.bool(this.isSubclass))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QMimeType) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QMimeType) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|