cutego/network/qhostinfo.go

164 lines
3.6 KiB
Go
Raw Normal View History

2015-10-24 18:18:24 +03:00
package network
//#include "network.h"
2015-10-24 18:18:24 +03:00
import "C"
import (
"github.com/therecipe/qt"
2015-10-24 18:18:24 +03:00
"github.com/therecipe/qt/core"
"unsafe"
)
type QHostInfo struct {
ptr unsafe.Pointer
}
2015-11-09 20:23:42 +03:00
type QHostInfo_ITF interface {
QHostInfo_PTR() *QHostInfo
2015-10-24 18:18:24 +03:00
}
func (p *QHostInfo) Pointer() unsafe.Pointer {
return p.ptr
}
func (p *QHostInfo) SetPointer(ptr unsafe.Pointer) {
p.ptr = ptr
}
2015-11-09 20:23:42 +03:00
func PointerFromQHostInfo(ptr QHostInfo_ITF) unsafe.Pointer {
2015-10-24 18:18:24 +03:00
if ptr != nil {
2015-11-09 20:23:42 +03:00
return ptr.QHostInfo_PTR().Pointer()
2015-10-24 18:18:24 +03:00
}
return nil
}
2015-11-09 20:23:42 +03:00
func NewQHostInfoFromPointer(ptr unsafe.Pointer) *QHostInfo {
2015-10-24 18:18:24 +03:00
var n = new(QHostInfo)
n.SetPointer(ptr)
return n
}
2015-11-09 20:23:42 +03:00
func (ptr *QHostInfo) QHostInfo_PTR() *QHostInfo {
2015-10-24 18:18:24 +03:00
return ptr
}
//QHostInfo::HostInfoError
2015-11-09 20:23:42 +03:00
type QHostInfo__HostInfoError int64
2015-10-24 18:18:24 +03:00
2015-11-09 20:23:42 +03:00
const (
2015-10-24 18:18:24 +03:00
QHostInfo__NoError = QHostInfo__HostInfoError(0)
QHostInfo__HostNotFound = QHostInfo__HostInfoError(1)
QHostInfo__UnknownError = QHostInfo__HostInfoError(2)
)
2015-11-09 20:23:42 +03:00
func NewQHostInfo2(other QHostInfo_ITF) *QHostInfo {
defer qt.Recovering("QHostInfo::QHostInfo")
2015-11-09 20:23:42 +03:00
return NewQHostInfoFromPointer(C.QHostInfo_NewQHostInfo2(PointerFromQHostInfo(other)))
2015-10-24 18:18:24 +03:00
}
func NewQHostInfo(id int) *QHostInfo {
defer qt.Recovering("QHostInfo::QHostInfo")
2015-11-09 20:23:42 +03:00
return NewQHostInfoFromPointer(C.QHostInfo_NewQHostInfo(C.int(id)))
2015-10-24 18:18:24 +03:00
}
func QHostInfo_AbortHostLookup(id int) {
defer qt.Recovering("QHostInfo::abortHostLookup")
2015-10-24 18:18:24 +03:00
C.QHostInfo_QHostInfo_AbortHostLookup(C.int(id))
}
func (ptr *QHostInfo) Error() QHostInfo__HostInfoError {
defer qt.Recovering("QHostInfo::error")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return QHostInfo__HostInfoError(C.QHostInfo_Error(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QHostInfo) ErrorString() string {
defer qt.Recovering("QHostInfo::errorString")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QHostInfo_ErrorString(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
func (ptr *QHostInfo) HostName() string {
defer qt.Recovering("QHostInfo::hostName")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QHostInfo_HostName(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
2015-11-09 20:23:42 +03:00
func QHostInfo_LookupHost(name string, receiver core.QObject_ITF, member string) int {
defer qt.Recovering("QHostInfo::lookupHost")
2015-11-09 20:23:42 +03:00
return int(C.QHostInfo_QHostInfo_LookupHost(C.CString(name), core.PointerFromQObject(receiver), C.CString(member)))
2015-10-24 18:18:24 +03:00
}
func (ptr *QHostInfo) LookupId() int {
defer qt.Recovering("QHostInfo::lookupId")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QHostInfo_LookupId(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QHostInfo) SetError(error QHostInfo__HostInfoError) {
defer qt.Recovering("QHostInfo::setError")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QHostInfo_SetError(ptr.Pointer(), C.int(error))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QHostInfo) SetErrorString(str string) {
defer qt.Recovering("QHostInfo::setErrorString")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QHostInfo_SetErrorString(ptr.Pointer(), C.CString(str))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QHostInfo) SetHostName(hostName string) {
defer qt.Recovering("QHostInfo::setHostName")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QHostInfo_SetHostName(ptr.Pointer(), C.CString(hostName))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QHostInfo) SetLookupId(id int) {
defer qt.Recovering("QHostInfo::setLookupId")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QHostInfo_SetLookupId(ptr.Pointer(), C.int(id))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QHostInfo) DestroyQHostInfo() {
defer qt.Recovering("QHostInfo::~QHostInfo")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QHostInfo_DestroyQHostInfo(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func QHostInfo_LocalHostName() string {
defer qt.Recovering("QHostInfo::localHostName")
2015-10-24 18:18:24 +03:00
return C.GoString(C.QHostInfo_QHostInfo_LocalHostName())
}
func QHostInfo_LocalDomainName() string {
defer qt.Recovering("QHostInfo::localDomainName")
2015-10-24 18:18:24 +03:00
return C.GoString(C.QHostInfo_QHostInfo_LocalDomainName())
}