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



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

    enum ButtonRole (
        InvalidRole => -1,
        AcceptRole => 0,
        RejectRole => 1,
        DestructiveRole => 2,
        ActionRole => 3,
        HelpRole => 4,
        YesRole => 5,
        NoRole => 6,
        ResetRole => 7,
        ApplyRole => 8,
        NRoles => 9,
    );

    enum StandardButton (
        NoButton => 0,
        Ok => 1024,
        Save => 2048,
        SaveAll => 4096,
        Open => 8192,
        Yes => 16384,
        YesToAll => 32768,
        No => 65536,
        NoToAll => 131072,
        Abort => 262144,
        Retry => 524288,
        Ignore => 1048576,
        Close => 2097152,
        Cancel => 4194304,
        Discard => 8388608,
        Help => 16777216,
        Apply => 33554432,
        Reset => 67108864,
        RestoreDefaults => 134217728,
        FirstButton => 1024,
        LastButton => 134217728,
    );
    our sub StandardButtons($e? = 0 --> Int ) is export { $e };

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

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

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

    multi sub ctor(QtBase $this, Qt::Orientation $orientation, QWidget $parent = (QWidget)) {
        my $a2 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = QWQDialogButtonBoxCtor_2($orientation, $a2);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, Qt::Orientation $orientation, QWidget $parent = (QWidget)) {
        my $a2 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = SCWQDialogButtonBoxCtor_2($orientation, $a2);
        $this.ownedByRaku = True;
    }

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

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

    multi sub ctor(QtBase $this, Int $buttons, Qt::Orientation $orientation, QWidget $parent = (QWidget)) {
        my $a3 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = QWQDialogButtonBoxCtor_4($buttons, $orientation, $a3);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, Int $buttons, Qt::Orientation $orientation, QWidget $parent = (QWidget)) {
        my $a3 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = SCWQDialogButtonBoxCtor_4($buttons, $orientation, $a3);
        $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 QDialogButtonBox $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 {
            QWQDialogButtonBoxDtor(self.address);
            self.ownedByRaku = False;
        }
    }

    method setOrientation(Qt::Orientation $orientation)
    {
        QWQDialogButtonBoxsetOrientation(self.address, $orientation);
    }

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

    multi method addButton(RQAbstractButton $button, QDialogButtonBox::ButtonRole $role)
    {
        my $a1 = ?$button ?? $button.address !! QWInt2Pointer(0);
        QWQDialogButtonBoxaddButton_1(self.address, $a1, $role);
    }

    multi method addButton(Str $text, QDialogButtonBox::ButtonRole $role --> QPushButton)
    {
        my $result = QWQDialogButtonBoxaddButton_2(self.address, $text, $role);
        my $result1 = QPushButton.new($result, obr => False);
        return $result1;
    }

    multi method addButton(QDialogButtonBox::StandardButton $button --> QPushButton)
    {
        my $result = QWQDialogButtonBoxaddButton_3(self.address, $button);
        my $result1 = QPushButton.new($result, obr => False);
        return $result1;
    }

    method removeButton(RQAbstractButton $button)
    {
        my $a1 = ?$button ?? $button.address !! QWInt2Pointer(0);
        QWQDialogButtonBoxremoveButton(self.address, $a1);
    }

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

    method buttonRole(RQAbstractButton $button --> QDialogButtonBox::ButtonRole)
    {
        my $a1 = ?$button ?? $button.address !! QWInt2Pointer(0);
        my $result = QWQDialogButtonBoxbuttonRole(self.address, $a1);
        my $result1 = QDialogButtonBox::ButtonRole($result);
        return $result1;
    }

    method setStandardButtons(Int $buttons)
    {
        QWQDialogButtonBoxsetStandardButtons(self.address, $buttons);
    }

    method standardButton(RQAbstractButton $button --> QDialogButtonBox::StandardButton)
    {
        my $a1 = ?$button ?? $button.address !! QWInt2Pointer(0);
        my $result = QWQDialogButtonBoxstandardButton(self.address, $a1);
        my $result1 = QDialogButtonBox::StandardButton($result);
        return $result1;
    }

    method button(QDialogButtonBox::StandardButton $which --> QPushButton)
    {
        my $result = QWQDialogButtonBoxbutton(self.address, $which);
        my $result1 = QPushButton.new($result, obr => False);
        return $result1;
    }

    method setCenterButtons(Bool $center)
    {
        my int8 $a1 = $center.Int;
        QWQDialogButtonBoxsetCenterButtons(self.address, $a1);
    }

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

    method clicked(RQAbstractButton $button)
        is QtSignal { ... }

    method accepted()
        is QtSignal { ... }

    method rejected()
        is QtSignal { ... }

}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



