### ----------------------------------------------------
### -- Qt::QtWidgets
### -- Licenses: GPL-3.0-or-later
### -- Authors: Yves Guillemot <yc.guillemot@wanadoo.fr>
### -- File: lib/Qt/QtWidgets/QMainWindow.rakumod
### ----------------------------------------------------

# 
# This file has been automatically generated by RaQt_maker V0.0.7.
# To modify and regenerate it, see the source code available here: 
#         https://github.com/yguillemot/RaQt_maker
# 

use NativeCall;
use Qt::QtWidgets:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QtHelpers:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QtWrappers:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QMenuBar:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QSize:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QStatusBar:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QToolBar:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QWidget:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::Qt:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QtBase:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQEvent:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQMainWindow:ver<0.0.7>:auth<zef:yguillemot>:api<2>;



class QMainWindow:ver<0.0.7>:auth<zef:yguillemot>:api<2>
    is QWidget
    is QtObject
    does RQMainWindow
    is export {

    multi sub ctor(QtBase $this, QWidget $parent = (QWidget), Int $flags = Qt::WindowFlags()) {
        my $a1 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = QWQMainWindowCtor($a1, $flags);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, QWidget $parent = (QWidget), Int $flags = Qt::WindowFlags()) {
        my $a1 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = SCWQMainWindowCtor($a1, $flags);
        $this.ownedByRaku = True;
    }

    method validateCB(Str $m) {
        QWvalidateCB_QMainWindow(self.address, self.id, $m);
    }

    multi sub ctor(QtBase $this, NativeCall::Types::Pointer $p, Bool :$obr = False) {
        # Get access to a preexisting Qt object
        $this.address = $p;
        $this.ownedByRaku = $obr;
    }

    multi sub ctor(|capture) {
        note "QtWidgets ", ::?CLASS.^name,
             " ctor called with unsupported args";
        die "Bad args";
    }

    submethod new(|capture) {
        my QMainWindow $rObj = self.bless;
        ctor($rObj, |capture);
        return $rObj;
    }

    multi sub subClassCtor(|capture) {
        note "QtWidgets subclass ", ::?CLASS.^name,
             " ctor called with unsupported args";
        die "Bad args";
    }

    submethod subClass(|capture) {
        subClassCtor(self, |capture);
        self.validateCallBacks();
    }

    submethod DESTROY {
        if self.ownedByRaku {
            QWQMainWindowDtor(self.address);
            self.ownedByRaku = False;
        }
    }

    method iconSize( --> QSize)
    {
        my $result = QWQMainWindowiconSize(self.address);
        my $result1 = QSize.new($result, obr => True);
        return $result1;
    }

    method setIconSize(QSize $iconSize)
    {
        my $a1 = $iconSize.address;
        QWQMainWindowsetIconSize(self.address, $a1);
    }

    method setDocumentMode(Bool $enabled)
    {
        my int8 $a1 = $enabled.Int;
        QWQMainWindowsetDocumentMode(self.address, $a1);
    }

    method menuBar( --> QMenuBar)
    {
        my $result = QWQMainWindowmenuBar(self.address);
        my $result1 = QMenuBar.new($result, obr => False);
        return $result1;
    }

    method setMenuBar(QMenuBar $menubar)
    {
        my $a1 = ?$menubar ?? $menubar.address !! QWInt2Pointer(0);
        QWQMainWindowsetMenuBar(self.address, $a1);
    }

    method menuWidget( --> QWidget)
    {
        my $result = QWQMainWindowmenuWidget(self.address);
        my $result1 = QWidget.new($result, obr => False);
        return $result1;
    }

    method setMenuWidget(QWidget $menubar)
    {
        my $a1 = ?$menubar ?? $menubar.address !! QWInt2Pointer(0);
        QWQMainWindowsetMenuWidget(self.address, $a1);
    }

    method statusBar( --> QStatusBar)
    {
        my $result = QWQMainWindowstatusBar(self.address);
        my $result1 = QStatusBar.new($result, obr => False);
        return $result1;
    }

    method setStatusBar(QStatusBar $statusbar)
    {
        my $a1 = ?$statusbar ?? $statusbar.address !! QWInt2Pointer(0);
        QWQMainWindowsetStatusBar(self.address, $a1);
    }

    method centralWidget( --> QWidget)
    {
        my $result = QWQMainWindowcentralWidget(self.address);
        my $result1 = QWidget.new($result, obr => False);
        return $result1;
    }

    method setCentralWidget(QWidget $widget)
    {
        my $a1 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        QWQMainWindowsetCentralWidget(self.address, $a1);
    }

    method takeCentralWidget( --> QWidget)
    {
        my $result = QWQMainWindowtakeCentralWidget(self.address);
        my $result1 = QWidget.new($result, obr => False);
        return $result1;
    }

    method insertToolBarBreak(QToolBar $before)
    {
        my $a1 = ?$before ?? $before.address !! QWInt2Pointer(0);
        QWQMainWindowinsertToolBarBreak(self.address, $a1);
    }

    multi method addToolBar(Qt::ToolBarArea $area, QToolBar $toolbar)
    {
        my $a2 = ?$toolbar ?? $toolbar.address !! QWInt2Pointer(0);
        QWQMainWindowaddToolBar_1(self.address, $area, $a2);
    }

    multi method addToolBar(QToolBar $toolbar)
    {
        my $a1 = ?$toolbar ?? $toolbar.address !! QWInt2Pointer(0);
        QWQMainWindowaddToolBar_2(self.address, $a1);
    }

    multi method addToolBar(Str $title --> QToolBar)
    {
        my $result = QWQMainWindowaddToolBar_3(self.address, $title);
        my $result1 = QToolBar.new($result, obr => False);
        return $result1;
    }

    method insertToolBar(QToolBar $before, QToolBar $toolbar)
    {
        my $a1 = ?$before ?? $before.address !! QWInt2Pointer(0);
        my $a2 = ?$toolbar ?? $toolbar.address !! QWInt2Pointer(0);
        QWQMainWindowinsertToolBar(self.address, $a1, $a2);
    }

    method removeToolBar(QToolBar $toolbar)
    {
        my $a1 = ?$toolbar ?? $toolbar.address !! QWInt2Pointer(0);
        QWQMainWindowremoveToolBar(self.address, $a1);
    }

    method removeToolBarBreak(QToolBar $before)
    {
        my $a1 = ?$before ?? $before.address !! QWInt2Pointer(0);
        QWQMainWindowremoveToolBarBreak(self.address, $a1);
    }

    method toolBarArea(QToolBar $toolbar --> Qt::ToolBarArea)
    {
        my $a1 = ?$toolbar ?? $toolbar.address !! QWInt2Pointer(0);
        my $result = QWQMainWindowtoolBarArea(self.address, $a1);
        my $result1 = Qt::ToolBarArea($result);
        return $result1;
    }

    method toolBarBreak(QToolBar $toolbar --> Bool)
    {
        my $a1 = ?$toolbar ?? $toolbar.address !! QWInt2Pointer(0);
        my $result = QWQMainWindowtoolBarBreak(self.address, $a1);
        my $result1 = ?$result;
        return $result1;
    }

    method event(RQEvent $event --> Bool)
    {
        my $a1 = ?$event ?? $event.address !! QWInt2Pointer(0);
        my $result = QWQMainWindowevent(self.address, $a1);
        my $result1 = ?$result;
        return $result1;
    }

    method iconSizeChanged(QSize $iconSize)
        is QtSignal { ... }

}


sub QWQMainWindowCtor(Pointer, int32)
    returns Pointer is native(&libwrapper) { * }

sub SCWQMainWindowCtor(Pointer, int32)
    returns Pointer is native(&libwrapper) { * }

sub QWvalidateCB_QMainWindow(Pointer, int32, Str)
    is native(&libwrapper) { * }

sub QWQMainWindowDtor(Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowiconSize(Pointer)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowsetIconSize(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowsetDocumentMode(Pointer, int8)
    is native(&libwrapper) { * }

sub QWQMainWindowmenuBar(Pointer)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowsetMenuBar(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowmenuWidget(Pointer)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowsetMenuWidget(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowstatusBar(Pointer)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowsetStatusBar(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowcentralWidget(Pointer)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowsetCentralWidget(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowtakeCentralWidget(Pointer)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowinsertToolBarBreak(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowaddToolBar_1(Pointer, int32, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowaddToolBar_2(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowaddToolBar_3(Pointer, Str)
    returns Pointer is native(&libwrapper) { * }

sub QWQMainWindowinsertToolBar(Pointer, Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowremoveToolBar(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowremoveToolBarBreak(Pointer, Pointer)
    is native(&libwrapper) { * }

sub QWQMainWindowtoolBarArea(Pointer, Pointer)
    returns int32 is native(&libwrapper) { * }

sub QWQMainWindowtoolBarBreak(Pointer, Pointer)
    returns int8 is native(&libwrapper) { * }

sub QWQMainWindowevent(Pointer, Pointer)
    returns int8 is native(&libwrapper) { * }



