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



class QRect:ver<0.0.7>:auth<zef:yguillemot>:api<2>
    is QtObject
    does RQRect
    is export {

    multi sub ctor(QtBase $this) {
        $this.address = QWQRectCtor_1();
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this) {
        $this.address = SCWQRectCtor_1();
        $this.ownedByRaku = True;
    }

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

    multi sub ctor(QtBase $this, QPoint $topleft, QPoint $bottomright) {
        my $a1 = $topleft.address;
        my $a2 = $bottomright.address;
        $this.address = QWQRectCtor_2($a1, $a2);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, QPoint $topleft, QPoint $bottomright) {
        my $a1 = $topleft.address;
        my $a2 = $bottomright.address;
        $this.address = SCWQRectCtor_2($a1, $a2);
        $this.ownedByRaku = True;
    }

    multi sub ctor(QtBase $this, Int $left, Int $top, Int $width, Int $height) {
        $this.address = QWQRectCtor_4($left, $top, $width, $height);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, Int $left, Int $top, Int $width, Int $height) {
        $this.address = SCWQRectCtor_4($left, $top, $width, $height);
        $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 QRect $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 {
            QWQRectDtor(self.address);
            self.ownedByRaku = False;
        }
    }

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

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

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

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

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

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

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

    method normalized( --> QRect)
    {
        my $result = QWQRectnormalized(self.address);
        my $result1 = QRect.new($result, obr => True);
        return $result1;
    }

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

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

    method setX(Int $x)
    {
        QWQRectsetX(self.address, $x);
    }

    method setY(Int $y)
    {
        QWQRectsetY(self.address, $y);
    }

    method topLeft( --> QPoint)
    {
        my $result = QWQRecttopLeft(self.address);
        my $result1 = QPoint.new($result, obr => True);
        return $result1;
    }

    method bottomRight( --> QPoint)
    {
        my $result = QWQRectbottomRight(self.address);
        my $result1 = QPoint.new($result, obr => True);
        return $result1;
    }

    method topRight( --> QPoint)
    {
        my $result = QWQRecttopRight(self.address);
        my $result1 = QPoint.new($result, obr => True);
        return $result1;
    }

    method bottomLeft( --> QPoint)
    {
        my $result = QWQRectbottomLeft(self.address);
        my $result1 = QPoint.new($result, obr => True);
        return $result1;
    }

    method center( --> QPoint)
    {
        my $result = QWQRectcenter(self.address);
        my $result1 = QPoint.new($result, obr => True);
        return $result1;
    }

    multi method translate(Int $dx, Int $dy)
    {
        QWQRecttranslate_1(self.address, $dx, $dy);
    }

    multi method translate(QPoint $p)
    {
        my $a1 = $p.address;
        QWQRecttranslate_2(self.address, $a1);
    }

    multi method translated(Int $dx, Int $dy --> QRect)
    {
        my $result = QWQRecttranslated_1(self.address, $dx, $dy);
        my $result1 = QRect.new($result, obr => True);
        return $result1;
    }

    multi method translated(QPoint $p --> QRect)
    {
        my $a1 = $p.address;
        my $result = QWQRecttranslated_2(self.address, $a1);
        my $result1 = QRect.new($result, obr => True);
        return $result1;
    }

    method transposed( --> QRect)
    {
        my $result = QWQRecttransposed(self.address);
        my $result1 = QRect.new($result, obr => True);
        return $result1;
    }

    method setRect(Int $x, Int $y, Int $w, Int $h)
    {
        QWQRectsetRect(self.address, $x, $y, $w, $h);
    }

    method adjust(Int $x1, Int $y1, Int $x2, Int $y2)
    {
        QWQRectadjust(self.address, $x1, $y1, $x2, $y2);
    }

    method adjusted(Int $x1, Int $y1, Int $x2, Int $y2 --> QRect)
    {
        my $result = QWQRectadjusted(self.address, $x1, $y1, $x2, $y2);
        my $result1 = QRect.new($result, obr => True);
        return $result1;
    }

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

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

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

    method setWidth(Int $w)
    {
        QWQRectsetWidth(self.address, $w);
    }

    method setHeight(Int $h)
    {
        QWQRectsetHeight(self.address, $h);
    }

    method united(QRect $other --> QRect)
    {
        my $a1 = $other.address;
        my $result = QWQRectunited(self.address, $a1);
        my $result1 = QRect.new($result, obr => True);
        return $result1;
    }

}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



