cutego/widgets/qcalendarwidget.go

317 lines
8.9 KiB
Go
Raw Normal View History

2015-10-24 18:18:24 +03:00
package widgets
//#include "qcalendarwidget.h"
import "C"
import (
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"unsafe"
)
type QCalendarWidget struct {
QWidget
}
2015-11-09 20:23:42 +03:00
type QCalendarWidget_ITF interface {
QWidget_ITF
QCalendarWidget_PTR() *QCalendarWidget
2015-10-24 18:18:24 +03:00
}
2015-11-09 20:23:42 +03:00
func PointerFromQCalendarWidget(ptr QCalendarWidget_ITF) unsafe.Pointer {
2015-10-24 18:18:24 +03:00
if ptr != nil {
2015-11-09 20:23:42 +03:00
return ptr.QCalendarWidget_PTR().Pointer()
2015-10-24 18:18:24 +03:00
}
return nil
}
2015-11-09 20:23:42 +03:00
func NewQCalendarWidgetFromPointer(ptr unsafe.Pointer) *QCalendarWidget {
2015-10-24 18:18:24 +03:00
var n = new(QCalendarWidget)
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("QCalendarWidget_" + qt.RandomIdentifier())
}
return n
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) QCalendarWidget_PTR() *QCalendarWidget {
2015-10-24 18:18:24 +03:00
return ptr
}
//QCalendarWidget::HorizontalHeaderFormat
2015-11-09 20:23:42 +03:00
type QCalendarWidget__HorizontalHeaderFormat 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
QCalendarWidget__NoHorizontalHeader = QCalendarWidget__HorizontalHeaderFormat(0)
QCalendarWidget__SingleLetterDayNames = QCalendarWidget__HorizontalHeaderFormat(1)
QCalendarWidget__ShortDayNames = QCalendarWidget__HorizontalHeaderFormat(2)
QCalendarWidget__LongDayNames = QCalendarWidget__HorizontalHeaderFormat(3)
)
//QCalendarWidget::SelectionMode
2015-11-09 20:23:42 +03:00
type QCalendarWidget__SelectionMode 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
QCalendarWidget__NoSelection = QCalendarWidget__SelectionMode(0)
QCalendarWidget__SingleSelection = QCalendarWidget__SelectionMode(1)
)
//QCalendarWidget::VerticalHeaderFormat
2015-11-09 20:23:42 +03:00
type QCalendarWidget__VerticalHeaderFormat 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
QCalendarWidget__NoVerticalHeader = QCalendarWidget__VerticalHeaderFormat(0)
QCalendarWidget__ISOWeekNumbers = QCalendarWidget__VerticalHeaderFormat(1)
)
func (ptr *QCalendarWidget) DateEditAcceptDelay() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QCalendarWidget_DateEditAcceptDelay(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QCalendarWidget) FirstDayOfWeek() core.Qt__DayOfWeek {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__DayOfWeek(C.QCalendarWidget_FirstDayOfWeek(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QCalendarWidget) HorizontalHeaderFormat() QCalendarWidget__HorizontalHeaderFormat {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return QCalendarWidget__HorizontalHeaderFormat(C.QCalendarWidget_HorizontalHeaderFormat(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QCalendarWidget) IsDateEditEnabled() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QCalendarWidget_IsDateEditEnabled(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QCalendarWidget) IsGridVisible() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QCalendarWidget_IsGridVisible(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QCalendarWidget) IsNavigationBarVisible() bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QCalendarWidget_IsNavigationBarVisible(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QCalendarWidget) SelectionMode() QCalendarWidget__SelectionMode {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return QCalendarWidget__SelectionMode(C.QCalendarWidget_SelectionMode(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QCalendarWidget) SetDateEditAcceptDelay(delay int) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetDateEditAcceptDelay(ptr.Pointer(), C.int(delay))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetDateEditEnabled(enable bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetDateEditEnabled(ptr.Pointer(), C.int(qt.GoBoolToInt(enable)))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetFirstDayOfWeek(dayOfWeek core.Qt__DayOfWeek) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetFirstDayOfWeek(ptr.Pointer(), C.int(dayOfWeek))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetGridVisible(show bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetGridVisible(ptr.Pointer(), C.int(qt.GoBoolToInt(show)))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetHorizontalHeaderFormat(format QCalendarWidget__HorizontalHeaderFormat) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetHorizontalHeaderFormat(ptr.Pointer(), C.int(format))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetMaximumDate(date core.QDate_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetMaximumDate(ptr.Pointer(), core.PointerFromQDate(date))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetMinimumDate(date core.QDate_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetMinimumDate(ptr.Pointer(), core.PointerFromQDate(date))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetNavigationBarVisible(visible bool) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetNavigationBarVisible(ptr.Pointer(), C.int(qt.GoBoolToInt(visible)))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetSelectedDate(date core.QDate_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetSelectedDate(ptr.Pointer(), core.PointerFromQDate(date))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetSelectionMode(mode QCalendarWidget__SelectionMode) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetSelectionMode(ptr.Pointer(), C.int(mode))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) SetVerticalHeaderFormat(format QCalendarWidget__VerticalHeaderFormat) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetVerticalHeaderFormat(ptr.Pointer(), C.int(format))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) VerticalHeaderFormat() QCalendarWidget__VerticalHeaderFormat {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return QCalendarWidget__VerticalHeaderFormat(C.QCalendarWidget_VerticalHeaderFormat(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
2015-11-09 20:23:42 +03:00
func NewQCalendarWidget(parent QWidget_ITF) *QCalendarWidget {
return NewQCalendarWidgetFromPointer(C.QCalendarWidget_NewQCalendarWidget(PointerFromQWidget(parent)))
2015-10-24 18:18:24 +03:00
}
func (ptr *QCalendarWidget) ConnectCurrentPageChanged(f func(year int, month int)) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ConnectCurrentPageChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.ConnectSignal(ptr.ObjectName(), "currentPageChanged", f)
}
}
func (ptr *QCalendarWidget) DisconnectCurrentPageChanged() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_DisconnectCurrentPageChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.DisconnectSignal(ptr.ObjectName(), "currentPageChanged")
}
}
//export callbackQCalendarWidgetCurrentPageChanged
func callbackQCalendarWidgetCurrentPageChanged(ptrName *C.char, year C.int, month C.int) {
qt.GetSignal(C.GoString(ptrName), "currentPageChanged").(func(int, int))(int(year), int(month))
}
func (ptr *QCalendarWidget) MonthShown() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QCalendarWidget_MonthShown(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QCalendarWidget) ConnectSelectionChanged(f func()) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ConnectSelectionChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.ConnectSignal(ptr.ObjectName(), "selectionChanged", f)
}
}
func (ptr *QCalendarWidget) DisconnectSelectionChanged() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_DisconnectSelectionChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.DisconnectSignal(ptr.ObjectName(), "selectionChanged")
}
}
//export callbackQCalendarWidgetSelectionChanged
func callbackQCalendarWidgetSelectionChanged(ptrName *C.char) {
qt.GetSignal(C.GoString(ptrName), "selectionChanged").(func())()
}
func (ptr *QCalendarWidget) SetCurrentPage(year int, month int) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetCurrentPage(ptr.Pointer(), C.int(year), C.int(month))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetDateRange(min core.QDate_ITF, max core.QDate_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetDateRange(ptr.Pointer(), core.PointerFromQDate(min), core.PointerFromQDate(max))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetDateTextFormat(date core.QDate_ITF, format gui.QTextCharFormat_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetDateTextFormat(ptr.Pointer(), core.PointerFromQDate(date), gui.PointerFromQTextCharFormat(format))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetHeaderTextFormat(format gui.QTextCharFormat_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetHeaderTextFormat(ptr.Pointer(), gui.PointerFromQTextCharFormat(format))
2015-10-24 18:18:24 +03:00
}
}
2015-11-09 20:23:42 +03:00
func (ptr *QCalendarWidget) SetWeekdayTextFormat(dayOfWeek core.Qt__DayOfWeek, format gui.QTextCharFormat_ITF) {
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_SetWeekdayTextFormat(ptr.Pointer(), C.int(dayOfWeek), gui.PointerFromQTextCharFormat(format))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) ShowNextMonth() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ShowNextMonth(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) ShowNextYear() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ShowNextYear(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) ShowPreviousMonth() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ShowPreviousMonth(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) ShowPreviousYear() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ShowPreviousYear(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) ShowSelectedDate() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ShowSelectedDate(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) ShowToday() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_ShowToday(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QCalendarWidget) YearShown() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QCalendarWidget_YearShown(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QCalendarWidget) DestroyQCalendarWidget() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QCalendarWidget_DestroyQCalendarWidget(ptr.Pointer())
2015-10-24 18:18:24 +03:00
ptr.SetPointer(nil)
}
}