
# 
# This file has been automatically generated by RaQt_maker V0.0.5.
# 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.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::QtHelpers:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::QtWrappers:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::QDialog:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::QtBase:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::RQMessageBox:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;
use Qt::QtWidgets::RQWidget:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>;



class QMessageBox:ver<0.0.5>:auth<cpan:YGUILLEMO>:api<2>
    is QDialog
    does RQMessageBox
    is export {

    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,
        YesAll => 32768,
        NoAll => 131072,
        Default => 256,
        Escape => 512,
        FlagMask => 768,
        ButtonMask => -769,
    );
    our sub StandardButtons($e? = 0 --> Int ) is export { $e };

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

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

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

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

    method setText(Str $text)
    {
        QWQMessageBoxsetText(self.address, $text);
    }

    method setInformativeText(Str $text)
    {
        QWQMessageBoxsetInformativeText(self.address, $text);
    }

}


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

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

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

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

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

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

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

