2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qfutureinterface.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QFutureInterfaceBase__State int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QFutureInterfaceBase__NoState QFutureInterfaceBase__State = 0
|
|
|
|
QFutureInterfaceBase__Running QFutureInterfaceBase__State = 1
|
|
|
|
QFutureInterfaceBase__Started QFutureInterfaceBase__State = 2
|
|
|
|
QFutureInterfaceBase__Finished QFutureInterfaceBase__State = 4
|
|
|
|
QFutureInterfaceBase__Canceled QFutureInterfaceBase__State = 8
|
|
|
|
QFutureInterfaceBase__Paused QFutureInterfaceBase__State = 16
|
|
|
|
QFutureInterfaceBase__Throttled QFutureInterfaceBase__State = 32
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QFutureInterfaceBase struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QFutureInterfaceBase
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) cPointer() *C.QFutureInterfaceBase {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QFutureInterfaceBase) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQFutureInterfaceBase constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQFutureInterfaceBase(h *C.QFutureInterfaceBase) *QFutureInterfaceBase {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QFutureInterfaceBase{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQFutureInterfaceBase constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQFutureInterfaceBase(h unsafe.Pointer) *QFutureInterfaceBase {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQFutureInterfaceBase((*C.QFutureInterfaceBase)(h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQFutureInterfaceBase constructs a new QFutureInterfaceBase object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQFutureInterfaceBase() *QFutureInterfaceBase {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQFutureInterfaceBase(C.QFutureInterfaceBase_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQFutureInterfaceBase2 constructs a new QFutureInterfaceBase object.
|
|
|
|
func NewQFutureInterfaceBase2(other *QFutureInterfaceBase) *QFutureInterfaceBase {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQFutureInterfaceBase(C.QFutureInterfaceBase_new2(other.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQFutureInterfaceBase3 constructs a new QFutureInterfaceBase object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQFutureInterfaceBase3(initialState QFutureInterfaceBase__State) *QFutureInterfaceBase {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQFutureInterfaceBase(C.QFutureInterfaceBase_new3((C.int)(initialState)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ReportStarted() {
|
|
|
|
C.QFutureInterfaceBase_ReportStarted(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ReportFinished() {
|
|
|
|
C.QFutureInterfaceBase_ReportFinished(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ReportCanceled() {
|
|
|
|
C.QFutureInterfaceBase_ReportCanceled(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ReportResultsReady(beginIndex int, endIndex int) {
|
|
|
|
C.QFutureInterfaceBase_ReportResultsReady(this.h, (C.int)(beginIndex), (C.int)(endIndex))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetRunnable(runnable *QRunnable) {
|
|
|
|
C.QFutureInterfaceBase_SetRunnable(this.h, runnable.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetThreadPool(pool *QThreadPool) {
|
|
|
|
C.QFutureInterfaceBase_SetThreadPool(this.h, pool.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetFilterMode(enable bool) {
|
|
|
|
C.QFutureInterfaceBase_SetFilterMode(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetProgressRange(minimum int, maximum int) {
|
|
|
|
C.QFutureInterfaceBase_SetProgressRange(this.h, (C.int)(minimum), (C.int)(maximum))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ProgressMinimum() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QFutureInterfaceBase_ProgressMinimum(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ProgressMaximum() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QFutureInterfaceBase_ProgressMaximum(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsProgressUpdateNeeded() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsProgressUpdateNeeded(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetProgressValue(progressValue int) {
|
|
|
|
C.QFutureInterfaceBase_SetProgressValue(this.h, (C.int)(progressValue))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ProgressValue() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QFutureInterfaceBase_ProgressValue(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetProgressValueAndText(progressValue int, progressText string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
progressText_ms := C.struct_miqt_string{}
|
|
|
|
progressText_ms.data = C.CString(progressText)
|
|
|
|
progressText_ms.len = C.size_t(len(progressText))
|
|
|
|
defer C.free(unsafe.Pointer(progressText_ms.data))
|
|
|
|
C.QFutureInterfaceBase_SetProgressValueAndText(this.h, (C.int)(progressValue), progressText_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ProgressText() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QFutureInterfaceBase_ProgressText(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetExpectedResultCount(resultCount int) {
|
|
|
|
C.QFutureInterfaceBase_SetExpectedResultCount(this.h, (C.int)(resultCount))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ExpectedResultCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QFutureInterfaceBase_ExpectedResultCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) ResultCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QFutureInterfaceBase_ResultCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QFutureInterfaceBase) QueryState(state QFutureInterfaceBase__State) bool {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_QueryState(this.h, (C.int)(state)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QFutureInterfaceBase) IsRunning() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsRunning(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsStarted() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsStarted(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsCanceled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsCanceled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsFinished() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsFinished(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsPaused() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsPaused(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsThrottled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsThrottled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) IsResultReadyAt(index int) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_IsResultReadyAt(this.h, (C.int)(index)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) Cancel() {
|
|
|
|
C.QFutureInterfaceBase_Cancel(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetPaused(paused bool) {
|
|
|
|
C.QFutureInterfaceBase_SetPaused(this.h, (C.bool)(paused))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) TogglePaused() {
|
|
|
|
C.QFutureInterfaceBase_TogglePaused(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) SetThrottled(enable bool) {
|
|
|
|
C.QFutureInterfaceBase_SetThrottled(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) WaitForFinished() {
|
|
|
|
C.QFutureInterfaceBase_WaitForFinished(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) WaitForNextResult() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_WaitForNextResult(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) WaitForResult(resultIndex int) {
|
|
|
|
C.QFutureInterfaceBase_WaitForResult(this.h, (C.int)(resultIndex))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) WaitForResume() {
|
|
|
|
C.QFutureInterfaceBase_WaitForResume(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) Mutex() *QMutex {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQMutex(C.QFutureInterfaceBase_Mutex(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) MutexWithInt(param1 int) *QMutex {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQMutex(C.QFutureInterfaceBase_MutexWithInt(this.h, (C.int)(param1)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) OperatorEqual(other *QFutureInterfaceBase) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_OperatorEqual(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) OperatorNotEqual(other *QFutureInterfaceBase) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QFutureInterfaceBase_OperatorNotEqual(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QFutureInterfaceBase) OperatorAssign(other *QFutureInterfaceBase) {
|
|
|
|
C.QFutureInterfaceBase_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QFutureInterfaceBase) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QFutureInterfaceBase_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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 *QFutureInterfaceBase) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QFutureInterfaceBase) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|