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



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

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

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

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

    method addWidget(QWidget $widget, Int $stretch = 0)
    {
        my $a1 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        QWQStatusBaraddWidget(self.address, $a1, $stretch);
    }

    method insertWidget(Int $index, QWidget $widget, Int $stretch = 0 --> Int)
    {
        my $a2 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        my $result = QWQStatusBarinsertWidget(self.address, $index, $a2, $stretch);
        return $result;
    }

    method addPermanentWidget(QWidget $widget, Int $stretch = 0)
    {
        my $a1 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        QWQStatusBaraddPermanentWidget(self.address, $a1, $stretch);
    }

    method insertPermanentWidget(Int $index, QWidget $widget, Int $stretch = 0 --> Int)
    {
        my $a2 = ?$widget ?? $widget.address !! QWInt2Pointer(0);
        my $result = QWQStatusBarinsertPermanentWidget(self.address, $index, $a2, $stretch);
        return $result;
    }

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

    method setSizeGripEnabled(Bool $arg1)
    {
        my int8 $a1 = $arg1.Int;
        QWQStatusBarsetSizeGripEnabled(self.address, $a1);
    }

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

    method currentMessage( --> Str)
    {
        my Pointer $retBuffer = QWStrBufferAlloc;
        QWQStatusBarcurrentMessage($retBuffer, self.address);
        my Str $returnedString = QWStrBufferRead($retBuffer);
        QWStrBufferFree($retBuffer);
        return $returnedString;
    }

    method showMessage(Str $text, Int $timeout = 0) is QtSlot
    {
        QWQStatusBarshowMessage(self.address, $text, $timeout);
    }

    method clearMessage() is QtSlot
    {
        QWQStatusBarclearMessage(self.address);
    }

    method reformat()
    {
        QWQStatusBarreformat(self.address);
    }

    method hideOrShow()
    {
        QWQStatusBarhideOrShow(self.address);
    }

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

    method messageChanged(Str $text)
        is QtSignal { ... }

}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



