### ----------------------------------------------------
### -- Qt::QtWidgets
### -- Licenses: GPL-3.0-or-later
### -- Authors: Yves Guillemot <yc.guillemot@wanadoo.fr>
### -- File: lib/Qt/QtWidgets/QGraphicsLineItem.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::QGraphicsItem:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::QRectF: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::RQGraphicsLineItem:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQPen:ver<0.0.7>:auth<zef:yguillemot>:api<2>;
use Qt::QtWidgets::RQPointF:ver<0.0.7>:auth<zef:yguillemot>:api<2>;



class QGraphicsLineItem:ver<0.0.7>:auth<zef:yguillemot>:api<2>
    is QGraphicsItem
    is QtObject
    does RQGraphicsLineItem
    is export {

    multi sub ctor(QtBase $this, Real $x1, Real $y1, Real $x2, Real $y2, QGraphicsItem $parent = (QGraphicsItem)) {
        my Num $a1 = $x1.Num;
        my Num $a2 = $y1.Num;
        my Num $a3 = $x2.Num;
        my Num $a4 = $y2.Num;
        my $a5 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = QWQGraphicsLineItemCtor_3($a1, $a2, $a3, $a4, $a5);
        $this.ownedByRaku = True;
    }

    multi sub subClassCtor(QtBase $this, Real $x1, Real $y1, Real $x2, Real $y2, QGraphicsItem $parent = (QGraphicsItem)) {
        my Num $a1 = $x1.Num;
        my Num $a2 = $y1.Num;
        my Num $a3 = $x2.Num;
        my Num $a4 = $y2.Num;
        my $a5 = ?$parent ?? $parent.address !! QWInt2Pointer(0);
        $this.address = SCWQGraphicsLineItemCtor_3($a1, $a2, $a3, $a4, $a5);
        $this.ownedByRaku = True;
    }

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

    method setPen(RQPen $pen)
    {
        my $a1 = $pen.address;
        QWQGraphicsLineItemsetPen(self.address, $a1);
    }

    multi method setLine(Real $x1, Real $y1, Real $x2, Real $y2)
    {
        my Num $a1 = $x1.Num;
        my Num $a2 = $y1.Num;
        my Num $a3 = $x2.Num;
        my Num $a4 = $y2.Num;
        QWQGraphicsLineItemsetLine_2(self.address, $a1, $a2, $a3, $a4);
    }

    method boundingRect( --> QRectF)
    {
        my $result = QWQGraphicsLineItemboundingRect(self.address);
        my $result1 = QRectF.new($result, obr => True);
        return $result1;
    }

    method contains(RQPointF $point --> Bool)
    {
        my $a1 = $point.address;
        my $result = QWQGraphicsLineItemcontains(self.address, $a1);
        my $result1 = ?$result;
        return $result1;
    }

}


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

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

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

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

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

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

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

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



