### ----------------------------------------------------
### -- Qt::QtWidgets
### -- Licenses: GPL-3.0-or-later
### -- Authors: Yves Guillemot <yc.guillemot@wanadoo.fr>
### -- File: lib/Qt/QtWidgets/QToolButton.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::QAbstractButton:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QAction:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QMenu: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::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::RQMouseEvent:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQPoint:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQTimerEvent:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQToolButton:ver<0.0.7>:auth<zef:yguillemot>:api<2>;



class QToolButton:ver<0.0.7>:auth<zef:yguillemot>:api<2>
    is QAbstractButton
    is QtObject
    does RQToolButton
    is export {

    enum ToolButtonPopupMode (
        DelayedPopup => 0,
        MenuButtonPopup => 1,
        InstantPopup => 2,
    );

    multi sub ctor(QtBase $this, QWidget $parent = (QWidget)) {
        my $a1 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = QWQToolButtonCtor($a1);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, QWidget $parent = (QWidget)) {
        my $a1 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = SCWQToolButtonCtor($a1);
        $this.ownedByRaku = True;
    }

    method validateCB(Str $m) {
        QWvalidateCB_QToolButton(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 QToolButton $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 {
            QWQToolButtonDtor(self.address);
            self.ownedByRaku = False;
        }
    }

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

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

    method arrowType( --> Qt::ArrowType)
    {
        my $result = QWQToolButtonarrowType(self.address);
        my $result1 = Qt::ArrowType($result);
        return $result1;
    }

    method setMenu(QMenu $menu)
    {
        my $a1 = ?$menu ?? $menu.address !! QWInt2Pointer(0);
        QWQToolButtonsetMenu(self.address, $a1);
    }

    method menu( --> QMenu)
    {
        my $result = QWQToolButtonmenu(self.address);
        my $result1 = QMenu.new($result, obr => False);
        return $result1;
    }

    method popupMode( --> QToolButton::ToolButtonPopupMode)
    {
        my $result = QWQToolButtonpopupMode(self.address);
        my $result1 = QToolButton::ToolButtonPopupMode($result);
        return $result1;
    }

    method defaultAction( --> QAction)
    {
        my $result = QWQToolButtondefaultAction(self.address);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

    method setAutoRaise(Bool $enable)
    {
        my int8 $a1 = $enable.Int;
        QWQToolButtonsetAutoRaise(self.address, $a1);
    }

    method autoRaise( --> Bool)
    {
        my $result = QWQToolButtonautoRaise(self.address);
        my $result1 = ?$result;
        return $result1;
    }

    method showMenu() is QtSlot
    {
        QWQToolButtonshowMenu(self.address);
    }

    method setDefaultAction(QAction $arg1) is QtSlot
    {
        my $a1 = ?$arg1 ?? $arg1.address !! QWInt2Pointer(0);
        QWQToolButtonsetDefaultAction(self.address, $a1);
    }

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

    method timerEvent(RQTimerEvent $arg1)
    {
        my $a1 = ?$arg1 ?? $arg1.address !! QWInt2Pointer(0);
        QWQToolButtontimerEvent(self.address, $a1);
    }

    method hitButton(RQPoint $pos --> Bool)
    {
        my $a1 = $pos.address;
        my $result = QWQToolButtonhitButton(self.address, $a1);
        my $result1 = ?$result;
        return $result1;
    }

    method triggered(QAction $arg1)
        is QtSignal { ... }

}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



