Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSHeader_p.h 00003 ------------------- 00004 begin : 06/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 AQSHEADER_P_H_ 00020 #define AQSHEADER_P_H_ 00021 00022 #include "AQSWidget_p.h" 00023 #include "AQSIconSet_p.h" 00024 #include <qheader.h> 00025 00026 class AQSHeader : public AQSWidget 00027 { 00028 Q_OBJECT 00029 00030 AQ_DECLARE_AQS_OBJECT(Header, Widget); 00031 00032 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00033 public slots: 00034 int addLabel(const QString &, int = -1); 00035 int addLabel(QIconSet *, const QString &, int = -1); 00036 int addLabel(AQSIconSet *, const QString &, int = -1); 00037 void removeLabel(int); 00038 void setLabel(int, const QString &, int = -1); 00039 void setLabel(int, QIconSet *, const QString &, int = -1); 00040 void setLabel(int, AQSIconSet *, const QString &, int = -1); 00041 QString label(int) const; 00042 void setClickEnabled(bool, int = -1); 00043 void setResizeEnabled(bool, int = -1); 00044 void setStretchEnabled(bool, int); 00045 void setStretchEnabled(bool); 00046 bool isClickEnabled(int = -1) const; 00047 bool isResizeEnabled(int = -1) const; 00048 bool isStretchEnabled(int) const; 00049 void resizeSection(int, int); 00050 int sectionSize(int) const; 00051 int sectionPos(int) const; 00052 int sectionAt(int) const; 00053 int headerWidth() const; 00054 QRect sectionRect(int) const; 00055 int mapToSection(int) const; 00056 int mapToIndex(int) const; 00057 void moveSection(int, int); 00058 void setSortIndicator(int, uint); 00059 int sortIndicatorSection() const; 00060 uint sortIndicatorOrder() const; 00061 void adjustHeaderSize(); 00062 00063 protected: 00064 static void *construct(const QSArgumentList &args) { 00065 QMap<int, QStringList> candidates; 00066 candidates[0].append(QString::null); 00067 candidates[1].append(QString::fromLatin1("QWidget*")); 00068 candidates[2].append(QString::fromLatin1("QWidget*,QString")); 00069 candidates[1].append(QString::fromLatin1("int")); 00070 candidates[2].append(QString::fromLatin1("int,QWidget*")); 00071 candidates[3].append(QString::fromLatin1("int,QWidget*,QString")); 00072 QString sgt(castArgsSignature(args, candidates)); 00073 if (sgt.isEmpty()) 00074 return new QHeader; 00075 if (sgt == QString::fromLatin1("QWidget*")) 00076 return new QHeader(argValue<QWidget *>(args[0])); 00077 if (sgt == QString::fromLatin1("QWidget*,QString")) 00078 return new QHeader(argValue<QWidget *>(args[0]), 00079 *(argValue<QString *>(args[1]))); 00080 if (sgt == QString::fromLatin1("int")) 00081 return new QHeader(args[0].variant().toInt()); 00082 if (sgt == QString::fromLatin1("int,QWidget*")) 00083 return new QHeader(args[0].variant().toInt(), 00084 argValue<QWidget *>(args[1])); 00085 if (sgt == QString::fromLatin1("int,QWidget*,QString")) 00086 return new QHeader(args[0].variant().toInt(), 00087 argValue<QWidget *>(args[1]), 00088 *(argValue<QString *>(args[2]))); 00089 return 0; 00090 } 00091 00092 public: 00093 static QMap<int, QStringList> candidateConstructors() { 00094 QMap<int, QStringList> candidates; 00095 candidates[0].append(QString::null); 00096 candidates[1].append(QString::fromLatin1("QWidget*")); 00097 candidates[2].append(QString::fromLatin1("QWidget*,QString")); 00098 candidates[1].append(QString::fromLatin1("int")); 00099 candidates[2].append(QString::fromLatin1("int,QWidget*")); 00100 candidates[3].append(QString::fromLatin1("int,QWidget*,QString")); 00101 return candidates; 00102 } 00103 //@AQ_END_DEF_PUB_SLOTS@ 00104 }; 00105 00106 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00107 inline int AQSHeader::addLabel(const QString &arg0, int arg1) 00108 { 00109 AQ_CALL_RET_V(addLabel(arg0, arg1), int); 00110 } 00111 inline int AQSHeader::addLabel(QIconSet *arg0, const QString &arg1, int arg2) 00112 { 00113 AQ_CALL_RET_V(addLabel(*arg0, arg1, arg2), int); 00114 } 00115 inline int AQSHeader::addLabel(AQSIconSet *arg0, const QString &arg1, int arg2) 00116 { 00117 AQ_CALL_RET_V(addLabel(*arg0, arg1, arg2), int); 00118 } 00119 inline void AQSHeader::removeLabel(int arg0) 00120 { 00121 AQ_CALL_VOID(removeLabel(arg0)); 00122 } 00123 inline void AQSHeader::setLabel(int arg0, const QString &arg1, int arg2) 00124 { 00125 AQ_CALL_VOID(setLabel(arg0, arg1, arg2)); 00126 } 00127 inline void AQSHeader::setLabel(int arg0, QIconSet *arg1, const QString &arg2, int arg3) 00128 { 00129 AQ_CALL_VOID(setLabel(arg0, *arg1, arg2, arg3)); 00130 } 00131 inline void AQSHeader::setLabel(int arg0, AQSIconSet *arg1, const QString &arg2, int arg3) 00132 { 00133 AQ_CALL_VOID(setLabel(arg0, *arg1, arg2, arg3)); 00134 } 00135 inline QString AQSHeader::label(int arg0) const 00136 { 00137 AQ_CALL_RET_V(label(arg0), QString); 00138 } 00139 inline void AQSHeader::setClickEnabled(bool arg0, int arg1) 00140 { 00141 AQ_CALL_VOID(setClickEnabled(arg0, arg1)); 00142 } 00143 inline void AQSHeader::setResizeEnabled(bool arg0, int arg1) 00144 { 00145 AQ_CALL_VOID(setResizeEnabled(arg0, arg1)); 00146 } 00147 inline void AQSHeader::setStretchEnabled(bool arg0, int arg1) 00148 { 00149 AQ_CALL_VOID(setStretchEnabled(arg0, arg1)); 00150 } 00151 inline void AQSHeader::setStretchEnabled(bool arg0) 00152 { 00153 AQ_CALL_VOID(setStretchEnabled(arg0)); 00154 } 00155 inline bool AQSHeader::isClickEnabled(int arg0) const 00156 { 00157 AQ_CALL_RET_V(isClickEnabled(arg0), bool); 00158 } 00159 inline bool AQSHeader::isResizeEnabled(int arg0) const 00160 { 00161 AQ_CALL_RET_V(isResizeEnabled(arg0), bool); 00162 } 00163 inline bool AQSHeader::isStretchEnabled(int arg0) const 00164 { 00165 AQ_CALL_RET_V(isStretchEnabled(arg0), bool); 00166 } 00167 inline void AQSHeader::resizeSection(int arg0, int arg1) 00168 { 00169 AQ_CALL_VOID(resizeSection(arg0, arg1)); 00170 } 00171 inline int AQSHeader::sectionSize(int arg0) const 00172 { 00173 AQ_CALL_RET_V(sectionSize(arg0), int); 00174 } 00175 inline int AQSHeader::sectionPos(int arg0) const 00176 { 00177 AQ_CALL_RET_V(sectionPos(arg0), int); 00178 } 00179 inline int AQSHeader::sectionAt(int arg0) const 00180 { 00181 AQ_CALL_RET_V(sectionAt(arg0), int); 00182 } 00183 inline int AQSHeader::headerWidth() const 00184 { 00185 AQ_CALL_RET_V(headerWidth(), int); 00186 } 00187 inline QRect AQSHeader::sectionRect(int arg0) const 00188 { 00189 AQ_CALL_RET_V(sectionRect(arg0), QRect); 00190 } 00191 inline int AQSHeader::mapToSection(int arg0) const 00192 { 00193 AQ_CALL_RET_V(mapToSection(arg0), int); 00194 } 00195 inline int AQSHeader::mapToIndex(int arg0) const 00196 { 00197 AQ_CALL_RET_V(mapToIndex(arg0), int); 00198 } 00199 inline void AQSHeader::moveSection(int arg0, int arg1) 00200 { 00201 AQ_CALL_VOID(moveSection(arg0, arg1)); 00202 } 00203 inline void AQSHeader::setSortIndicator(int arg0, uint arg1) 00204 { 00205 AQ_CALL_VOID(setSortIndicator(arg0, static_cast<Qt::SortOrder>(arg1))); 00206 } 00207 inline int AQSHeader::sortIndicatorSection() const 00208 { 00209 AQ_CALL_RET_V(sortIndicatorSection(), int); 00210 } 00211 inline uint AQSHeader::sortIndicatorOrder() const 00212 { 00213 AQ_CALL_RET_V(sortIndicatorOrder(), uint); 00214 } 00215 inline void AQSHeader::adjustHeaderSize() 00216 { 00217 AQ_CALL_VOID(adjustHeaderSize()); 00218 } 00219 //@AQ_END_IMP_PUB_SLOTS@ 00220 00221 #endif /* AQSHEADER_P_H_ */ 00222 // @AQSWIDGET@