Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSBrush_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 AQSBRUSH_P_H_ 00020 #define AQSBRUSH_P_H_ 00021 00022 #include "AQSPixmap_p.h" 00023 #include <qbrush.h> 00024 00025 // @AQ_PTR_INDIRECTION@ 00026 00027 class AQSBrush : public AQSVoidPtr 00028 { 00029 Q_OBJECT 00030 00031 Q_ENUMS(BrushStyle) 00032 00033 Q_PROPERTY(QBrush toVariant READ toVariant); 00034 00035 AQ_DECLARE_AQS_VOID(Brush, VoidPtr); 00036 00037 public: 00038 QBrush toVariant() const { 00039 if (!o_) 00040 return QBrush(); 00041 return *o_; 00042 } 00043 00044 protected: 00045 void specializedInternalFinish() { 00046 if (!wrap_) 00047 delete o_; 00048 } 00049 00050 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00051 public slots: 00052 uint style() const; 00053 void setStyle(BrushStyle); 00054 QColor *color() const; 00055 void setColor(QColor *); 00056 void setColor(AQSColor *); 00057 QPixmap *pixmap() const; 00058 void setPixmap(QPixmap *); 00059 void setPixmap(AQSPixmap *); 00060 00061 protected: 00062 static void *construct(const QSArgumentList &args) { 00063 QMap<int, QStringList> candidates; 00064 candidates[0].append(QString::null); 00065 candidates[1].append(QString::fromLatin1("Qt::BrushStyle")); 00066 candidates[1].append(QString::fromLatin1("QColor*")); 00067 candidates[2].append(QString::fromLatin1("QColor*,Qt::BrushStyle")); 00068 candidates[2].append(QString::fromLatin1("QColor*,QPixmap*")); 00069 candidates[1].append(QString::fromLatin1("QBrush*")); 00070 QString sgt(castArgsSignature(args, candidates)); 00071 if (sgt.isEmpty()) 00072 return new QBrush; 00073 if (sgt == QString::fromLatin1("Qt::BrushStyle")) 00074 return new QBrush(static_cast<Qt::BrushStyle>(args[0].variant().toUInt())); 00075 if (sgt == QString::fromLatin1("QColor*")) 00076 return new QBrush(*argValue<QColor *>(args[0])); 00077 if (sgt == QString::fromLatin1("QColor*,Qt::BrushStyle")) 00078 return new QBrush(*argValue<QColor *>(args[0]), 00079 static_cast<Qt::BrushStyle>(args[1].variant().toUInt())); 00080 if (sgt == QString::fromLatin1("QColor*,QPixmap*")) 00081 return new QBrush(*argValue<QColor *>(args[0]), 00082 *argValue<QPixmap *>(args[1])); 00083 if (sgt == QString::fromLatin1("QBrush*")) 00084 return new QBrush(*argValue<QBrush *>(args[0])); 00085 return 0; 00086 } 00087 00088 public: 00089 static QMap<int, QStringList> candidateConstructors() { 00090 QMap<int, QStringList> candidates; 00091 candidates[0].append(QString::null); 00092 candidates[1].append(QString::fromLatin1("Qt::BrushStyle")); 00093 candidates[1].append(QString::fromLatin1("QColor*")); 00094 candidates[2].append(QString::fromLatin1("QColor*,Qt::BrushStyle")); 00095 candidates[2].append(QString::fromLatin1("QColor*,QPixmap*")); 00096 candidates[1].append(QString::fromLatin1("QBrush*")); 00097 return candidates; 00098 } 00099 //@AQ_END_DEF_PUB_SLOTS@ 00100 }; 00101 00102 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00103 inline uint AQSBrush::style() const 00104 { 00105 AQ_CALL_RET_V(style(), uint); 00106 } 00107 inline void AQSBrush::setStyle(BrushStyle arg0) 00108 { 00109 AQ_CALL_VOID(setStyle(arg0)); 00110 } 00111 inline QColor *AQSBrush::color() const 00112 { 00113 AQ_CALL_RET_PTR(color(), QColor); 00114 } 00115 inline void AQSBrush::setColor(QColor *arg0) 00116 { 00117 AQ_CALL_VOID(setColor(*arg0)); 00118 } 00119 inline void AQSBrush::setColor(AQSColor *arg0) 00120 { 00121 AQ_CALL_VOID(setColor(*arg0)); 00122 } 00123 inline QPixmap *AQSBrush::pixmap() const 00124 { 00125 AQ_CALL_RET(pixmap()); 00126 } 00127 inline void AQSBrush::setPixmap(QPixmap *arg0) 00128 { 00129 AQ_CALL_VOID(setPixmap(*arg0)); 00130 } 00131 inline void AQSBrush::setPixmap(AQSPixmap *arg0) 00132 { 00133 AQ_CALL_VOID(setPixmap(*arg0)); 00134 } 00135 //@AQ_END_IMP_PUB_SLOTS@ 00136 00137 #endif /* AQSBRUSH_P_H_ */ 00138 // @AQSVOIDPTR@