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



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

    multi sub ctor(QtBase $this, QWidget $parent = (QWidget), Int $f = Qt::WindowFlags()) {
        my $a1 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = QWQDialogCtor($a1, $f);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, QWidget $parent = (QWidget), Int $f = Qt::WindowFlags()) {
        my $a1 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = SCWQDialogCtor($a1, $f);
        $this.ownedByRaku = True;
    }

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

    method result( --> Int)
    {
        my $result = QWQDialogresult(self.address);
        return $result;
    }

    method setVisible(Bool $visible)
    {
        my int8 $a1 = $visible.Int;
        QWQDialogsetVisible(self.address, $a1);
    }

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

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

    method setExtension(QWidget $extension)
    {
        my $a1 = ?$extension ?? $extension.address !! QWInt2Pointer(0);
        QWQDialogsetExtension(self.address, $a1);
    }

    method extension( --> QWidget)
    {
        my $result = QWQDialogextension(self.address);
        my $result1 = QWidget.new($result, obr => False);
        return $result1;
    }

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

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

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

    method setModal(Bool $modal)
    {
        my int8 $a1 = $modal.Int;
        QWQDialogsetModal(self.address, $a1);
    }

    method setResult(Int $r)
    {
        QWQDialogsetResult(self.address, $r);
    }

    method open() is QtSlot
    {
        QWQDialogopen(self.address);
    }

    method exec( --> Int) is QtSlot
    {
        my $result = QWQDialogexec(self.address);
        return $result;
    }

    method done(Int $arg1) is QtSlot
    {
        QWQDialogdone(self.address, $arg1);
    }

    method accept() is QtSlot
    {
        QWQDialogaccept(self.address);
    }

    method reject() is QtSlot
    {
        QWQDialogreject(self.address);
    }

    method keyPressEvent(RQKeyEvent $arg1)
    {
        my $a1 = ?$arg1 ?? $arg1.address !! QWInt2Pointer(0);
        QWQDialogkeyPressEvent(self.address, $a1);
    }

    method adjustPosition(QWidget $arg1)
    {
        my $a1 = ?$arg1 ?? $arg1.address !! QWInt2Pointer(0);
        QWQDialogadjustPosition(self.address, $a1);
    }

    method finished(Int $result)
        is QtSignal { ... }

    method accepted()
        is QtSignal { ... }

    method rejected()
        is QtSignal { ... }

}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



