Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSFieldMD_p.h 00003 ------------------- 00004 begin : 29/03/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 AQSFIELDMD_P_H_ 00020 #define AQSFIELDMD_P_H_ 00021 00022 #include "AQSVoidPtr_p.h" 00023 #include "AQObjects.h" 00024 00025 class AQSFieldMD : public AQSVoidPtr 00026 { 00027 Q_OBJECT 00028 00029 AQ_DECLARE_AQS_VOID_AQOBJECT(FieldMD, VoidPtr); 00030 00031 protected: 00032 void specializedInternalFinish() { 00033 if (!wrap_) 00034 delete o_; 00035 } 00036 00037 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00038 public slots: 00039 QString name() const; 00040 void setName(const QString &); 00041 QString alias() const; 00042 bool allowNull() const; 00043 bool isPrimaryKey() const; 00044 bool isCompoundKey() const; 00045 int type() const; 00046 int length() const; 00047 bool calculated() const; 00048 void setCalculated(bool); 00049 bool editable() const; 00050 void setEditable(bool); 00051 bool visible() const; 00052 bool visibleGrid() const; 00053 bool generated() const; 00054 void setVisible(bool); 00055 void setVisibleGrid(bool); 00056 int partInteger() const; 00057 int partDecimal() const; 00058 bool isCounter() const; 00059 bool isIndex() const; 00060 bool isUnique() const; 00061 void addRelationMD(FLRelationMetaData *); 00062 FLRelationMetaData *relationM1() const; 00063 void setAssociatedField(FLFieldMetaData *, const QString &); 00064 void setAssociatedField(const QString &, const QString &); 00065 FLFieldMetaData *associatedField() const; 00066 QString associatedFieldFilterTo() const; 00067 QString associatedFieldName() const; 00068 QVariant defaultValue(); 00069 bool outTransaction(); 00070 QString regExpValidator(); 00071 QStringList optionsList(); 00072 void setOptionsList(const QString &); 00073 bool isCheck() const; 00074 bool hasOptionsList() const; 00075 void setMetadata(FLTableMetaData *); 00076 FLTableMetaData *metadata() const; 00077 uint flDecodeType(int); 00078 00079 protected: 00080 static void *construct(const QSArgumentList &args) { 00081 QMap<int, QStringList> candidates; 00082 candidates[5].append(QString::fromLatin1("QString,QString,bool,bool,int")); 00083 candidates[6].append(QString::fromLatin1("QString,QString,bool,bool,int,int")); 00084 candidates[7].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool")); 00085 candidates[8].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool")); 00086 candidates[9].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool")); 00087 candidates[10].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int")); 00088 candidates[11].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int")); 00089 candidates[12].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool")); 00090 candidates[13].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool")); 00091 candidates[14].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool")); 00092 candidates[15].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant")); 00093 candidates[16].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool")); 00094 candidates[17].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString")); 00095 candidates[18].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool")); 00096 candidates[19].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool,bool")); 00097 candidates[20].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool,bool,bool")); 00098 QString sgt(castArgsSignature(args, candidates)); 00099 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int")) 00100 return new AQFieldMD(*(argValue<QString *>(args[0])), 00101 *(argValue<QString *>(args[1])), 00102 args[2].variant().toBool(), 00103 args[3].variant().toBool(), 00104 args[4].variant().toInt()); 00105 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int")) 00106 return new AQFieldMD(*(argValue<QString *>(args[0])), 00107 *(argValue<QString *>(args[1])), 00108 args[2].variant().toBool(), 00109 args[3].variant().toBool(), 00110 args[4].variant().toInt(), 00111 args[5].variant().toInt()); 00112 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool")) 00113 return new AQFieldMD(*(argValue<QString *>(args[0])), 00114 *(argValue<QString *>(args[1])), 00115 args[2].variant().toBool(), 00116 args[3].variant().toBool(), 00117 args[4].variant().toInt(), 00118 args[5].variant().toInt(), 00119 args[6].variant().toBool()); 00120 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool")) 00121 return new AQFieldMD(*(argValue<QString *>(args[0])), 00122 *(argValue<QString *>(args[1])), 00123 args[2].variant().toBool(), 00124 args[3].variant().toBool(), 00125 args[4].variant().toInt(), 00126 args[5].variant().toInt(), 00127 args[6].variant().toBool(), 00128 args[7].variant().toBool()); 00129 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool")) 00130 return new AQFieldMD(*(argValue<QString *>(args[0])), 00131 *(argValue<QString *>(args[1])), 00132 args[2].variant().toBool(), 00133 args[3].variant().toBool(), 00134 args[4].variant().toInt(), 00135 args[5].variant().toInt(), 00136 args[6].variant().toBool(), 00137 args[7].variant().toBool(), 00138 args[8].variant().toBool()); 00139 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int")) 00140 return new AQFieldMD(*(argValue<QString *>(args[0])), 00141 *(argValue<QString *>(args[1])), 00142 args[2].variant().toBool(), 00143 args[3].variant().toBool(), 00144 args[4].variant().toInt(), 00145 args[5].variant().toInt(), 00146 args[6].variant().toBool(), 00147 args[7].variant().toBool(), 00148 args[8].variant().toBool(), 00149 args[9].variant().toInt()); 00150 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int")) 00151 return new AQFieldMD(*(argValue<QString *>(args[0])), 00152 *(argValue<QString *>(args[1])), 00153 args[2].variant().toBool(), 00154 args[3].variant().toBool(), 00155 args[4].variant().toInt(), 00156 args[5].variant().toInt(), 00157 args[6].variant().toBool(), 00158 args[7].variant().toBool(), 00159 args[8].variant().toBool(), 00160 args[9].variant().toInt(), 00161 args[10].variant().toInt()); 00162 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool")) 00163 return new AQFieldMD(*(argValue<QString *>(args[0])), 00164 *(argValue<QString *>(args[1])), 00165 args[2].variant().toBool(), 00166 args[3].variant().toBool(), 00167 args[4].variant().toInt(), 00168 args[5].variant().toInt(), 00169 args[6].variant().toBool(), 00170 args[7].variant().toBool(), 00171 args[8].variant().toBool(), 00172 args[9].variant().toInt(), 00173 args[10].variant().toInt(), 00174 args[11].variant().toBool()); 00175 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool")) 00176 return new AQFieldMD(*(argValue<QString *>(args[0])), 00177 *(argValue<QString *>(args[1])), 00178 args[2].variant().toBool(), 00179 args[3].variant().toBool(), 00180 args[4].variant().toInt(), 00181 args[5].variant().toInt(), 00182 args[6].variant().toBool(), 00183 args[7].variant().toBool(), 00184 args[8].variant().toBool(), 00185 args[9].variant().toInt(), 00186 args[10].variant().toInt(), 00187 args[11].variant().toBool(), 00188 args[12].variant().toBool()); 00189 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool")) 00190 return new AQFieldMD(*(argValue<QString *>(args[0])), 00191 *(argValue<QString *>(args[1])), 00192 args[2].variant().toBool(), 00193 args[3].variant().toBool(), 00194 args[4].variant().toInt(), 00195 args[5].variant().toInt(), 00196 args[6].variant().toBool(), 00197 args[7].variant().toBool(), 00198 args[8].variant().toBool(), 00199 args[9].variant().toInt(), 00200 args[10].variant().toInt(), 00201 args[11].variant().toBool(), 00202 args[12].variant().toBool(), 00203 args[13].variant().toBool()); 00204 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant")) 00205 return new AQFieldMD(*(argValue<QString *>(args[0])), 00206 *(argValue<QString *>(args[1])), 00207 args[2].variant().toBool(), 00208 args[3].variant().toBool(), 00209 args[4].variant().toInt(), 00210 args[5].variant().toInt(), 00211 args[6].variant().toBool(), 00212 args[7].variant().toBool(), 00213 args[8].variant().toBool(), 00214 args[9].variant().toInt(), 00215 args[10].variant().toInt(), 00216 args[11].variant().toBool(), 00217 args[12].variant().toBool(), 00218 args[13].variant().toBool(), 00219 *(argValue<QVariant *>(args[14]))); 00220 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool")) 00221 return new AQFieldMD(*(argValue<QString *>(args[0])), 00222 *(argValue<QString *>(args[1])), 00223 args[2].variant().toBool(), 00224 args[3].variant().toBool(), 00225 args[4].variant().toInt(), 00226 args[5].variant().toInt(), 00227 args[6].variant().toBool(), 00228 args[7].variant().toBool(), 00229 args[8].variant().toBool(), 00230 args[9].variant().toInt(), 00231 args[10].variant().toInt(), 00232 args[11].variant().toBool(), 00233 args[12].variant().toBool(), 00234 args[13].variant().toBool(), 00235 *(argValue<QVariant *>(args[14])), 00236 args[15].variant().toBool()); 00237 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString")) 00238 return new AQFieldMD(*(argValue<QString *>(args[0])), 00239 *(argValue<QString *>(args[1])), 00240 args[2].variant().toBool(), 00241 args[3].variant().toBool(), 00242 args[4].variant().toInt(), 00243 args[5].variant().toInt(), 00244 args[6].variant().toBool(), 00245 args[7].variant().toBool(), 00246 args[8].variant().toBool(), 00247 args[9].variant().toInt(), 00248 args[10].variant().toInt(), 00249 args[11].variant().toBool(), 00250 args[12].variant().toBool(), 00251 args[13].variant().toBool(), 00252 *(argValue<QVariant *>(args[14])), 00253 args[15].variant().toBool(), 00254 *(argValue<QString *>(args[16]))); 00255 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool")) 00256 return new AQFieldMD(*(argValue<QString *>(args[0])), 00257 *(argValue<QString *>(args[1])), 00258 args[2].variant().toBool(), 00259 args[3].variant().toBool(), 00260 args[4].variant().toInt(), 00261 args[5].variant().toInt(), 00262 args[6].variant().toBool(), 00263 args[7].variant().toBool(), 00264 args[8].variant().toBool(), 00265 args[9].variant().toInt(), 00266 args[10].variant().toInt(), 00267 args[11].variant().toBool(), 00268 args[12].variant().toBool(), 00269 args[13].variant().toBool(), 00270 *(argValue<QVariant *>(args[14])), 00271 args[15].variant().toBool(), 00272 *(argValue<QString *>(args[16])), 00273 args[17].variant().toBool()); 00274 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool,bool")) 00275 return new AQFieldMD(*(argValue<QString *>(args[0])), 00276 *(argValue<QString *>(args[1])), 00277 args[2].variant().toBool(), 00278 args[3].variant().toBool(), 00279 args[4].variant().toInt(), 00280 args[5].variant().toInt(), 00281 args[6].variant().toBool(), 00282 args[7].variant().toBool(), 00283 args[8].variant().toBool(), 00284 args[9].variant().toInt(), 00285 args[10].variant().toInt(), 00286 args[11].variant().toBool(), 00287 args[12].variant().toBool(), 00288 args[13].variant().toBool(), 00289 *(argValue<QVariant *>(args[14])), 00290 args[15].variant().toBool(), 00291 *(argValue<QString *>(args[16])), 00292 args[17].variant().toBool(), 00293 args[18].variant().toBool()); 00294 if (sgt == QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool,bool,bool")) 00295 return new AQFieldMD(*(argValue<QString *>(args[0])), 00296 *(argValue<QString *>(args[1])), 00297 args[2].variant().toBool(), 00298 args[3].variant().toBool(), 00299 args[4].variant().toInt(), 00300 args[5].variant().toInt(), 00301 args[6].variant().toBool(), 00302 args[7].variant().toBool(), 00303 args[8].variant().toBool(), 00304 args[9].variant().toInt(), 00305 args[10].variant().toInt(), 00306 args[11].variant().toBool(), 00307 args[12].variant().toBool(), 00308 args[13].variant().toBool(), 00309 *(argValue<QVariant *>(args[14])), 00310 args[15].variant().toBool(), 00311 *(argValue<QString *>(args[16])), 00312 args[17].variant().toBool(), 00313 args[18].variant().toBool(), 00314 args[19].variant().toBool()); 00315 return 0; 00316 } 00317 00318 public: 00319 static QMap<int, QStringList> candidateConstructors() { 00320 QMap<int, QStringList> candidates; 00321 candidates[5].append(QString::fromLatin1("QString,QString,bool,bool,int")); 00322 candidates[6].append(QString::fromLatin1("QString,QString,bool,bool,int,int")); 00323 candidates[7].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool")); 00324 candidates[8].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool")); 00325 candidates[9].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool")); 00326 candidates[10].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int")); 00327 candidates[11].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int")); 00328 candidates[12].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool")); 00329 candidates[13].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool")); 00330 candidates[14].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool")); 00331 candidates[15].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant")); 00332 candidates[16].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool")); 00333 candidates[17].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString")); 00334 candidates[18].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool")); 00335 candidates[19].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool,bool")); 00336 candidates[20].append(QString::fromLatin1("QString,QString,bool,bool,int,int,bool,bool,bool,int,int,bool,bool,bool,QVariant,bool,QString,bool,bool,bool")); 00337 return candidates; 00338 } 00339 //@AQ_END_DEF_PUB_SLOTS@ 00340 }; 00341 00342 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00343 inline QString AQSFieldMD::name() const 00344 { 00345 AQ_CALL_RET_V(name(), QString); 00346 } 00347 inline void AQSFieldMD::setName(const QString &arg0) 00348 { 00349 AQ_CALL_VOID(setName(arg0)); 00350 } 00351 inline QString AQSFieldMD::alias() const 00352 { 00353 AQ_CALL_RET_V(alias(), QString); 00354 } 00355 inline bool AQSFieldMD::allowNull() const 00356 { 00357 AQ_CALL_RET_V(allowNull(), bool); 00358 } 00359 inline bool AQSFieldMD::isPrimaryKey() const 00360 { 00361 AQ_CALL_RET_V(isPrimaryKey(), bool); 00362 } 00363 inline bool AQSFieldMD::isCompoundKey() const 00364 { 00365 AQ_CALL_RET_V(isCompoundKey(), bool); 00366 } 00367 inline int AQSFieldMD::type() const 00368 { 00369 AQ_CALL_RET_V(type(), int); 00370 } 00371 inline int AQSFieldMD::length() const 00372 { 00373 AQ_CALL_RET_V(length(), int); 00374 } 00375 inline bool AQSFieldMD::calculated() const 00376 { 00377 AQ_CALL_RET_V(calculated(), bool); 00378 } 00379 inline void AQSFieldMD::setCalculated(bool arg0) 00380 { 00381 AQ_CALL_VOID(setCalculated(arg0)); 00382 } 00383 inline bool AQSFieldMD::editable() const 00384 { 00385 AQ_CALL_RET_V(editable(), bool); 00386 } 00387 inline void AQSFieldMD::setEditable(bool arg0) 00388 { 00389 AQ_CALL_VOID(setEditable(arg0)); 00390 } 00391 inline bool AQSFieldMD::visible() const 00392 { 00393 AQ_CALL_RET_V(visible(), bool); 00394 } 00395 inline bool AQSFieldMD::visibleGrid() const 00396 { 00397 AQ_CALL_RET_V(visibleGrid(), bool); 00398 } 00399 inline bool AQSFieldMD::generated() const 00400 { 00401 AQ_CALL_RET_V(generated(), bool); 00402 } 00403 inline void AQSFieldMD::setVisible(bool arg0) 00404 { 00405 AQ_CALL_VOID(setVisible(arg0)); 00406 } 00407 inline void AQSFieldMD::setVisibleGrid(bool arg0) 00408 { 00409 AQ_CALL_VOID(setVisibleGrid(arg0)); 00410 } 00411 inline int AQSFieldMD::partInteger() const 00412 { 00413 AQ_CALL_RET_V(partInteger(), int); 00414 } 00415 inline int AQSFieldMD::partDecimal() const 00416 { 00417 AQ_CALL_RET_V(partDecimal(), int); 00418 } 00419 inline bool AQSFieldMD::isCounter() const 00420 { 00421 AQ_CALL_RET_V(isCounter(), bool); 00422 } 00423 inline bool AQSFieldMD::isIndex() const 00424 { 00425 AQ_CALL_RET_V(isIndex(), bool); 00426 } 00427 inline bool AQSFieldMD::isUnique() const 00428 { 00429 AQ_CALL_RET_V(isUnique(), bool); 00430 } 00431 inline void AQSFieldMD::addRelationMD(FLRelationMetaData *arg0) 00432 { 00433 AQ_CALL_VOID(addRelationMD(arg0)); 00434 } 00435 inline FLRelationMetaData *AQSFieldMD::relationM1() const 00436 { 00437 AQ_CALL_RET(relationM1()); 00438 } 00439 inline void AQSFieldMD::setAssociatedField(FLFieldMetaData *arg0, const QString &arg1) 00440 { 00441 AQ_CALL_VOID(setAssociatedField(arg0, arg1)); 00442 } 00443 inline void AQSFieldMD::setAssociatedField(const QString &arg0, const QString &arg1) 00444 { 00445 AQ_CALL_VOID(setAssociatedField(arg0, arg1)); 00446 } 00447 inline FLFieldMetaData *AQSFieldMD::associatedField() const 00448 { 00449 AQ_CALL_RET(associatedField()); 00450 } 00451 inline QString AQSFieldMD::associatedFieldFilterTo() const 00452 { 00453 AQ_CALL_RET_V(associatedFieldFilterTo(), QString); 00454 } 00455 inline QString AQSFieldMD::associatedFieldName() const 00456 { 00457 AQ_CALL_RET_V(associatedFieldName(), QString); 00458 } 00459 inline QVariant AQSFieldMD::defaultValue() 00460 { 00461 AQ_CALL_RET_V(defaultValue(), QVariant); 00462 } 00463 inline bool AQSFieldMD::outTransaction() 00464 { 00465 AQ_CALL_RET_V(outTransaction(), bool); 00466 } 00467 inline QString AQSFieldMD::regExpValidator() 00468 { 00469 AQ_CALL_RET_V(regExpValidator(), QString); 00470 } 00471 inline QStringList AQSFieldMD::optionsList() 00472 { 00473 AQ_CALL_RET_V(optionsList(), QStringList); 00474 } 00475 inline void AQSFieldMD::setOptionsList(const QString &arg0) 00476 { 00477 AQ_CALL_VOID(setOptionsList(arg0)); 00478 } 00479 inline bool AQSFieldMD::isCheck() const 00480 { 00481 AQ_CALL_RET_V(isCheck(), bool); 00482 } 00483 inline bool AQSFieldMD::hasOptionsList() const 00484 { 00485 AQ_CALL_RET_V(hasOptionsList(), bool); 00486 } 00487 inline void AQSFieldMD::setMetadata(FLTableMetaData *arg0) 00488 { 00489 AQ_CALL_VOID(setMetadata(arg0)); 00490 } 00491 inline FLTableMetaData *AQSFieldMD::metadata() const 00492 { 00493 AQ_CALL_RET(metadata()); 00494 } 00495 inline uint AQSFieldMD::flDecodeType(int arg0) 00496 { 00497 AQ_CALL_RET_V(flDecodeType(arg0), uint); 00498 } 00499 //@AQ_END_IMP_PUB_SLOTS@ 00500 00501 #endif /* AQSFIELDMD_P_H_ */ 00502 // @AQOBJECT_VOID@