### ----------------------------------------------------
### -- Qt::QtWidgets
### -- Licenses: GPL-3.0-or-later
### -- Authors: Yves Guillemot <yc.guillemot@wanadoo.fr>
### -- File: lib/Qt/QtWidgets/QToolBar.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::QAction: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::RQPaintEvent: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::RQToolBar:ver<0.0.7>:auth<zef:yguillemot>:api<2>;



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

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

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

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

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

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

    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 QToolBar $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 {
            QWQToolBarDtor(self.address);
            self.ownedByRaku = False;
        }
    }

    method setMovable(Bool $movable)
    {
        my int8 $a1 = $movable.Int;
        QWQToolBarsetMovable(self.address, $a1);
    }

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

    method setAllowedAreas(Int $areas)
    {
        QWQToolBarsetAllowedAreas(self.address, $areas);
    }

    method orientation( --> Qt::Orientation)
    {
        my $result = QWQToolBarorientation(self.address);
        my $result1 = Qt::Orientation($result);
        return $result1;
    }

    method clear()
    {
        QWQToolBarclear(self.address);
    }

    multi method addAction(Str $text --> QAction)
    {
        my $result = QWQToolBaraddAction_1(self.address, $text);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

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

    method insertSeparator(QAction $before --> QAction)
    {
        my $a1 = ?$before ?? $before.address !! QWInt2Pointer(0);
        my $result = QWQToolBarinsertSeparator(self.address, $a1);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

    method addWidget(QWidget $widget --> QAction)
    {
        my $a1 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        my $result = QWQToolBaraddWidget(self.address, $a1);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

    method insertWidget(QAction $before, QWidget $widget --> QAction)
    {
        my $a1 = ?$before ?? $before.address !! QWInt2Pointer(0);
        my $a2 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        my $result = QWQToolBarinsertWidget(self.address, $a1, $a2);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

    multi method actionAt(RQPoint $p --> QAction)
    {
        my $a1 = $p.address;
        my $result = QWQToolBaractionAt_1(self.address, $a1);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

    multi method actionAt(Int $x, Int $y --> QAction)
    {
        my $result = QWQToolBaractionAt_2(self.address, $x, $y);
        my $result1 = QAction.new($result, obr => False);
        return $result1;
    }

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

    method widgetForAction(QAction $action --> QWidget)
    {
        my $a1 = ?$action ?? $action.address !! QWInt2Pointer(0);
        my $result = QWQToolBarwidgetForAction(self.address, $a1);
        my $result1 = QWidget.new($result, obr => False);
        return $result1;
    }

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

    method setFloatable(Bool $floatable)
    {
        my int8 $a1 = $floatable.Int;
        QWQToolBarsetFloatable(self.address, $a1);
    }

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

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

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

    method actionTriggered(QAction $action)
        is QtSignal { ... }

    method movableChanged(Bool $movable)
        is QtSignal { ... }

    method orientationChanged(Qt::Orientation $orientation)
        is QtSignal { ... }

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

    method visibilityChanged(Bool $visible)
        is QtSignal { ... }

}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



