Eneboo - Documentación para desarrolladores
src/flbase/aqsobjects/AQSRegion_p.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQSRegion_p.h
00003  -------------------
00004  begin                : 18/02/2011
00005  copyright            : (C) 2003-2011 by InfoSiAL S.L.
00006  email                : mail@infosial.com
00007  ***************************************************************************/
00008 /***************************************************************************
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; version 2 of the License.               *
00012  ***************************************************************************/
00013 /***************************************************************************
00014  Este  programa es software libre. Puede redistribuirlo y/o modificarlo
00015  bajo  los  términos  de  la  Licencia  Pública General de GNU   en  su
00016  versión 2, publicada  por  la  Free  Software Foundation.
00017  ***************************************************************************/
00018 
00019 #ifndef AQSREGION_P_H_
00020 #define AQSREGION_P_H_
00021 
00022 #include "AQSPointArray_p.h"
00023 #include <qregion.h>
00024 
00025 // @AQ_PTR_INDIRECTION@
00026 
00027 class AQSRegion : public AQSVoidPtr
00028 {
00029   Q_OBJECT
00030 
00031   Q_PROPERTY(QRegion toVariant READ toVariant);
00032 
00033   AQ_DECLARE_AQS_VOID(Region, VoidPtr);
00034 
00035 public:
00036   QRegion toVariant() const {
00037     if (!o_)
00038       return QRegion();
00039     return *o_;
00040   }
00041 
00042 protected:
00043   void specializedInternalFinish() {
00044     if (!wrap_)
00045       delete o_;
00046   }
00047 
00048   //@AQ_BEGIN_DEF_PUB_SLOTS@
00049 public slots:
00050   bool isNull() const;
00051   bool isEmpty() const;
00052   bool contains(const QPoint &) const;
00053   bool contains(const QRect &) const;
00054   void translate(int, int);
00055   QRegion *unite(QRegion *) const;
00056   QRegion *unite(AQSRegion *) const;
00057   QRegion *intersect(QRegion *) const;
00058   QRegion *intersect(AQSRegion *) const;
00059   QRegion *subtract(QRegion *) const;
00060   QRegion *subtract(AQSRegion *) const;
00061   QRegion *eor(QRegion *) const;
00062   QRegion *eor(AQSRegion *) const;
00063   QRect boundingRect() const;
00064 
00065 protected:
00066   static void *construct(const QSArgumentList &args) {
00067     QMap<int, QStringList> candidates;
00068     candidates[0].append(QString::null);
00069     candidates[4].append(QString::fromLatin1("int,int,int,int"));
00070     candidates[5].append(QString::fromLatin1("int,int,int,int,QRegion::RegionType"));
00071     candidates[1].append(QString::fromLatin1("QRect"));
00072     candidates[2].append(QString::fromLatin1("QRect,QRegion::RegionType"));
00073     candidates[1].append(QString::fromLatin1("QPointArray*"));
00074     candidates[2].append(QString::fromLatin1("QPointArray*,bool"));
00075     candidates[1].append(QString::fromLatin1("QRegion*"));
00076     QString sgt(castArgsSignature(args, candidates));
00077     if (sgt.isEmpty())
00078       return new QRegion;
00079     if (sgt == QString::fromLatin1("int,int,int,int"))
00080       return new QRegion(args[0].variant().toInt(),
00081                          args[1].variant().toInt(),
00082                          args[2].variant().toInt(),
00083                          args[3].variant().toInt());
00084     if (sgt == QString::fromLatin1("int,int,int,int,QRegion::RegionType"))
00085       return new QRegion(args[0].variant().toInt(),
00086                          args[1].variant().toInt(),
00087                          args[2].variant().toInt(),
00088                          args[3].variant().toInt(),
00089                          static_cast<QRegion::RegionType>(args[4].variant().toUInt()));
00090     if (sgt == QString::fromLatin1("QRect"))
00091       return new QRegion(*(argValue<QRect *>(args[0])));
00092     if (sgt == QString::fromLatin1("QRect,QRegion::RegionType"))
00093       return new QRegion(*(argValue<QRect *>(args[0])),
00094                          static_cast<QRegion::RegionType>(args[1].variant().toUInt()));
00095     if (sgt == QString::fromLatin1("QPointArray*"))
00096       return new QRegion(*argValue<QPointArray *>(args[0]));
00097     if (sgt == QString::fromLatin1("QPointArray*,bool"))
00098       return new QRegion(*argValue<QPointArray *>(args[0]),
00099                          args[1].variant().toBool());
00100     if (sgt == QString::fromLatin1("QRegion*"))
00101       return new QRegion(*argValue<QRegion *>(args[0]));
00102     return 0;
00103   }
00104 
00105 public:
00106   static QMap<int, QStringList> candidateConstructors() {
00107     QMap<int, QStringList> candidates;
00108     candidates[0].append(QString::null);
00109     candidates[4].append(QString::fromLatin1("int,int,int,int"));
00110     candidates[5].append(QString::fromLatin1("int,int,int,int,QRegion::RegionType"));
00111     candidates[1].append(QString::fromLatin1("QRect"));
00112     candidates[2].append(QString::fromLatin1("QRect,QRegion::RegionType"));
00113     candidates[1].append(QString::fromLatin1("QPointArray*"));
00114     candidates[2].append(QString::fromLatin1("QPointArray*,bool"));
00115     candidates[1].append(QString::fromLatin1("QRegion*"));
00116     return candidates;
00117   }
00118   //@AQ_END_DEF_PUB_SLOTS@
00119 };
00120 
00121 //@AQ_BEGIN_IMP_PUB_SLOTS@
00122 inline bool AQSRegion::isNull() const
00123 {
00124   AQ_CALL_RET_V(isNull(), bool);
00125 }
00126 inline bool AQSRegion::isEmpty() const
00127 {
00128   AQ_CALL_RET_V(isEmpty(), bool);
00129 }
00130 inline bool AQSRegion::contains(const QPoint &arg0) const
00131 {
00132   AQ_CALL_RET_V(contains(arg0), bool);
00133 }
00134 inline bool AQSRegion::contains(const QRect &arg0) const
00135 {
00136   AQ_CALL_RET_V(contains(arg0), bool);
00137 }
00138 inline void AQSRegion::translate(int arg0,  int arg1)
00139 {
00140   AQ_CALL_VOID(translate(arg0, arg1));
00141 }
00142 inline QRegion *AQSRegion::unite(QRegion *arg0) const
00143 {
00144   AQ_CALL_RET_PTR(unite(*arg0), QRegion);
00145 }
00146 inline QRegion *AQSRegion::unite(AQSRegion *arg0) const
00147 {
00148   AQ_CALL_RET_PTR(unite(*arg0), QRegion);
00149 }
00150 inline QRegion *AQSRegion::intersect(QRegion *arg0) const
00151 {
00152   AQ_CALL_RET_PTR(intersect(*arg0), QRegion);
00153 }
00154 inline QRegion *AQSRegion::intersect(AQSRegion *arg0) const
00155 {
00156   AQ_CALL_RET_PTR(intersect(*arg0), QRegion);
00157 }
00158 inline QRegion *AQSRegion::subtract(QRegion *arg0) const
00159 {
00160   AQ_CALL_RET_PTR(subtract(*arg0), QRegion);
00161 }
00162 inline QRegion *AQSRegion::subtract(AQSRegion *arg0) const
00163 {
00164   AQ_CALL_RET_PTR(subtract(*arg0), QRegion);
00165 }
00166 inline QRegion *AQSRegion::eor(QRegion *arg0) const
00167 {
00168   AQ_CALL_RET_PTR(eor(*arg0), QRegion);
00169 }
00170 inline QRegion *AQSRegion::eor(AQSRegion *arg0) const
00171 {
00172   AQ_CALL_RET_PTR(eor(*arg0), QRegion);
00173 }
00174 inline QRect AQSRegion::boundingRect() const
00175 {
00176   AQ_CALL_RET_V(boundingRect(), QRect);
00177 }
00178 //@AQ_END_IMP_PUB_SLOTS@
00179 
00180 #endif /* AQSREGION_P_H_ */
00181 // @AQSVOIDPTR@
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'