cutego/widgets/qlabel.go

308 lines
6.8 KiB
Go
Raw Normal View History

2015-10-24 18:18:24 +03:00
package widgets
//#include "qlabel.h"
import "C"
import (
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"unsafe"
)
type QLabel struct {
QFrame
}
2015-11-09 20:23:42 +03:00
type QLabel_ITF interface {
QFrame_ITF
QLabel_PTR() *QLabel
2015-10-24 18:18:24 +03:00
}
2015-11-09 20:23:42 +03:00
func PointerFromQLabel(ptr QLabel_ITF) unsafe.Pointer {
2015-10-24 18:18:24 +03:00
if ptr != nil {
2015-11-09 20:23:42 +03:00
return ptr.QLabel_PTR().Pointer()
2015-10-24 18:18:24 +03:00
}
return nil
}
2015-11-09 20:23:42 +03:00
func NewQLabelFromPointer(ptr unsafe.Pointer) *QLabel {
2015-10-24 18:18:24 +03:00
var n = new(QLabel)
n.SetPointer(ptr)
2015-11-09 20:23:42 +03:00
if len(n.ObjectName()) == 0 {
2015-10-24 18:18:24 +03:00
n.SetObjectName("QLabel_" + qt.RandomIdentifier())
}
return n
}
2015-11-09 20:23:42 +03:00
func (ptr *QLabel) QLabel_PTR() *QLabel {
2015-10-24 18:18:24 +03:00
return ptr
}
func (ptr *QLabel) Alignment() core.Qt__AlignmentFlag {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__AlignmentFlag(C.QLabel_Alignment(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QLabel) HasScaledContents() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QLabel_HasScaledContents(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QLabel) HasSelectedText() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QLabel_HasSelectedText(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QLabel) Indent() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QLabel_Indent(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QLabel) Margin() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QLabel_Margin(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QLabel) OpenExternalLinks() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QLabel_OpenExternalLinks(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QLabel) Pixmap() *gui.QPixmap {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return gui.NewQPixmapFromPointer(C.QLabel_Pixmap(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return nil
}
func (ptr *QLabel) SelectedText() string {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QLabel_SelectedText(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
func (ptr *QLabel) SetAlignment(v core.Qt__AlignmentFlag) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetAlignment(ptr.Pointer(), C.int(v))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetIndent(v int) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetIndent(ptr.Pointer(), C.int(v))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetMargin(v int) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetMargin(ptr.Pointer(), C.int(v))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetOpenExternalLinks(open bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetOpenExternalLinks(ptr.Pointer(), C.int(qt.GoBoolToInt(open)))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QLabel) SetPixmap(v gui.QPixmap_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetPixmap(ptr.Pointer(), gui.PointerFromQPixmap(v))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetScaledContents(v bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetScaledContents(ptr.Pointer(), C.int(qt.GoBoolToInt(v)))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetText(v string) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetText(ptr.Pointer(), C.CString(v))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetTextFormat(v core.Qt__TextFormat) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetTextFormat(ptr.Pointer(), C.int(v))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetTextInteractionFlags(flags core.Qt__TextInteractionFlag) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetTextInteractionFlags(ptr.Pointer(), C.int(flags))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetWordWrap(on bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetWordWrap(ptr.Pointer(), C.int(qt.GoBoolToInt(on)))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) Text() string {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QLabel_Text(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
func (ptr *QLabel) TextFormat() core.Qt__TextFormat {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__TextFormat(C.QLabel_TextFormat(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QLabel) TextInteractionFlags() core.Qt__TextInteractionFlag {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__TextInteractionFlag(C.QLabel_TextInteractionFlags(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QLabel) WordWrap() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QLabel_WordWrap(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
2015-11-09 20:23:42 +03:00
func NewQLabel(parent QWidget_ITF, f core.Qt__WindowType) *QLabel {
return NewQLabelFromPointer(C.QLabel_NewQLabel(PointerFromQWidget(parent), C.int(f)))
2015-10-24 18:18:24 +03:00
}
2015-11-09 20:23:42 +03:00
func NewQLabel2(text string, parent QWidget_ITF, f core.Qt__WindowType) *QLabel {
return NewQLabelFromPointer(C.QLabel_NewQLabel2(C.CString(text), PointerFromQWidget(parent), C.int(f)))
2015-10-24 18:18:24 +03:00
}
func (ptr *QLabel) Buddy() *QWidget {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return NewQWidgetFromPointer(C.QLabel_Buddy(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return nil
}
func (ptr *QLabel) Clear() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_Clear(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) HeightForWidth(w int) int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QLabel_HeightForWidth(ptr.Pointer(), C.int(w)))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QLabel) ConnectLinkActivated(f func(link string)) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_ConnectLinkActivated(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.ConnectSignal(ptr.ObjectName(), "linkActivated", f)
}
}
func (ptr *QLabel) DisconnectLinkActivated() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_DisconnectLinkActivated(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.DisconnectSignal(ptr.ObjectName(), "linkActivated")
}
}
//export callbackQLabelLinkActivated
func callbackQLabelLinkActivated(ptrName *C.char, link *C.char) {
qt.GetSignal(C.GoString(ptrName), "linkActivated").(func(string))(C.GoString(link))
}
func (ptr *QLabel) ConnectLinkHovered(f func(link string)) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_ConnectLinkHovered(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.ConnectSignal(ptr.ObjectName(), "linkHovered", f)
}
}
func (ptr *QLabel) DisconnectLinkHovered() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_DisconnectLinkHovered(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.DisconnectSignal(ptr.ObjectName(), "linkHovered")
}
}
//export callbackQLabelLinkHovered
func callbackQLabelLinkHovered(ptrName *C.char, link *C.char) {
qt.GetSignal(C.GoString(ptrName), "linkHovered").(func(string))(C.GoString(link))
}
func (ptr *QLabel) Movie() *gui.QMovie {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return gui.NewQMovieFromPointer(C.QLabel_Movie(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return nil
}
func (ptr *QLabel) Picture() *gui.QPicture {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return gui.NewQPictureFromPointer(C.QLabel_Picture(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return nil
}
func (ptr *QLabel) SelectionStart() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QLabel_SelectionStart(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
2015-11-09 20:23:42 +03:00
func (ptr *QLabel) SetBuddy(buddy QWidget_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetBuddy(ptr.Pointer(), PointerFromQWidget(buddy))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QLabel) SetMovie(movie gui.QMovie_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetMovie(ptr.Pointer(), gui.PointerFromQMovie(movie))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetNum(num int) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetNum(ptr.Pointer(), C.int(num))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QLabel) SetPicture(picture gui.QPicture_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetPicture(ptr.Pointer(), gui.PointerFromQPicture(picture))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) SetSelection(start int, length int) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_SetSelection(ptr.Pointer(), C.int(start), C.int(length))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QLabel) DestroyQLabel() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QLabel_DestroyQLabel(ptr.Pointer())
2015-10-24 18:18:24 +03:00
ptr.SetPointer(nil)
}
}