Eneboo - Documentación para desarrolladores
src/flbase/aqsobjects/AQSPen_p.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQSPen_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 AQSPEN_P_H_
00020 #define AQSPEN_P_H_
00021 
00022 #include "AQSColor_p.h"
00023 #include <qpen.h>
00024 
00025 // @AQ_PTR_INDIRECTION@
00026 
00027 class AQSPen : public AQSVoidPtr
00028 {
00029   Q_OBJECT
00030 
00031   Q_PROPERTY(QPen toVariant READ toVariant);
00032 
00033   AQ_DECLARE_AQS_VOID(Pen, VoidPtr);
00034 
00035 public:
00036   QPen toVariant() const {
00037     if (!o_)
00038       return QPen();
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   uint style() const;
00051   void setStyle(uint);
00052   uint width() const;
00053   void setWidth(uint);
00054   QColor *color() const;
00055   void setColor(QColor *);
00056   void setColor(AQSColor *);
00057   uint capStyle() const;
00058   void setCapStyle(uint);
00059   uint joinStyle() const;
00060   void setJoinStyle(uint);
00061 
00062 protected:
00063   static void *construct(const QSArgumentList &args) {
00064     QMap<int, QStringList> candidates;
00065     candidates[0].append(QString::null);
00066     candidates[1].append(QString::fromLatin1("Qt::PenStyle"));
00067     candidates[1].append(QString::fromLatin1("QColor*"));
00068     candidates[2].append(QString::fromLatin1("QColor*,uint"));
00069     candidates[3].append(QString::fromLatin1("QColor*,uint,Qt::PenStyle"));
00070     candidates[5].append(QString::fromLatin1("QColor*,uint,Qt::PenStyle,Qt::PenCapStyle,Qt::PenJoinStyle"));
00071     candidates[1].append(QString::fromLatin1("QPen*"));
00072     QString sgt(castArgsSignature(args, candidates));
00073     if (sgt.isEmpty())
00074       return new QPen;
00075     if (sgt == QString::fromLatin1("Qt::PenStyle"))
00076       return new QPen(static_cast<Qt::PenStyle>(args[0].variant().toUInt()));
00077     if (sgt == QString::fromLatin1("QColor*"))
00078       return new QPen(*argValue<QColor *>(args[0]));
00079     if (sgt == QString::fromLatin1("QColor*,uint"))
00080       return new QPen(*argValue<QColor *>(args[0]),
00081                       args[1].variant().toUInt());
00082     if (sgt == QString::fromLatin1("QColor*,uint,Qt::PenStyle"))
00083       return new QPen(*argValue<QColor *>(args[0]),
00084                       args[1].variant().toUInt(),
00085                       static_cast<Qt::PenStyle>(args[2].variant().toUInt()));
00086     if (sgt == QString::fromLatin1("QColor*,uint,Qt::PenStyle,Qt::PenCapStyle,Qt::PenJoinStyle"))
00087       return new QPen(*argValue<QColor *>(args[0]),
00088                       args[1].variant().toUInt(),
00089                       static_cast<Qt::PenStyle>(args[2].variant().toUInt()),
00090                       static_cast<Qt::PenCapStyle>(args[3].variant().toUInt()),
00091                       static_cast<Qt::PenJoinStyle>(args[4].variant().toUInt()));
00092     if (sgt == QString::fromLatin1("QPen*"))
00093       return new QPen(*argValue<QPen *>(args[0]));
00094     return 0;
00095   }
00096 
00097 public:
00098   static QMap<int, QStringList> candidateConstructors() {
00099     QMap<int, QStringList> candidates;
00100     candidates[0].append(QString::null);
00101     candidates[1].append(QString::fromLatin1("Qt::PenStyle"));
00102     candidates[1].append(QString::fromLatin1("QColor*"));
00103     candidates[2].append(QString::fromLatin1("QColor*,uint"));
00104     candidates[3].append(QString::fromLatin1("QColor*,uint,Qt::PenStyle"));
00105     candidates[5].append(QString::fromLatin1("QColor*,uint,Qt::PenStyle,Qt::PenCapStyle,Qt::PenJoinStyle"));
00106     candidates[1].append(QString::fromLatin1("QPen*"));
00107     return candidates;
00108   }
00109   //@AQ_END_DEF_PUB_SLOTS@
00110 };
00111 
00112 //@AQ_BEGIN_IMP_PUB_SLOTS@
00113 inline uint AQSPen::style() const
00114 {
00115   AQ_CALL_RET_V(style(), uint);
00116 }
00117 inline void AQSPen::setStyle(uint arg0)
00118 {
00119   AQ_CALL_VOID(setStyle(static_cast<Qt::PenStyle>(arg0)));
00120 }
00121 inline uint AQSPen::width() const
00122 {
00123   AQ_CALL_RET_V(width(), uint);
00124 }
00125 inline void AQSPen::setWidth(uint arg0)
00126 {
00127   AQ_CALL_VOID(setWidth(arg0));
00128 }
00129 inline QColor *AQSPen::color() const
00130 {
00131   AQ_CALL_RET_PTR(color(), QColor);
00132 }
00133 inline void AQSPen::setColor(QColor *arg0)
00134 {
00135   AQ_CALL_VOID(setColor(*arg0));
00136 }
00137 inline void AQSPen::setColor(AQSColor *arg0)
00138 {
00139   AQ_CALL_VOID(setColor(*arg0));
00140 }
00141 inline uint AQSPen::capStyle() const
00142 {
00143   AQ_CALL_RET_V(capStyle(), uint);
00144 }
00145 inline void AQSPen::setCapStyle(uint arg0)
00146 {
00147   AQ_CALL_VOID(setCapStyle(static_cast<Qt::PenCapStyle>(arg0)));
00148 }
00149 inline uint AQSPen::joinStyle() const
00150 {
00151   AQ_CALL_RET_V(joinStyle(), uint);
00152 }
00153 inline void AQSPen::setJoinStyle(uint arg0)
00154 {
00155   AQ_CALL_VOID(setJoinStyle(static_cast<Qt::PenJoinStyle>(arg0)));
00156 }
00157 //@AQ_END_IMP_PUB_SLOTS@
00158 
00159 #endif /* AQSPEN_P_H_ */
00160 // @AQSVOIDPTR@
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'