Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSSqlQuery_p.h 00003 ------------------- 00004 begin : 09/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 AQSSQLQUERY_P_H_ 00020 #define AQSSQLQUERY_P_H_ 00021 00022 #include "AQSObject_p.h" 00023 #include "AQObjects.h" 00024 00025 class AQSSqlQuery : public AQSObject 00026 { 00027 Q_OBJECT 00028 00029 AQ_DECLARE_AQS_AQOBJECT(SqlQuery, Object); 00030 00031 public slots: 00032 void setSelect(const QString &s, const QString &sep = QString::fromLatin1(",")) { 00033 AQ_CALL_VOID(setSelect(s, sep)); 00034 } 00035 00036 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00037 public slots: 00038 QString select() const; 00039 QString from() const; 00040 QString where() const; 00041 QString orderBy() const; 00042 void setFrom(const QString &); 00043 void setWhere(const QString &); 00044 void setOrderBy(const QString &); 00045 QString sql() const; 00046 QStringList fieldList() const; 00047 QVariant value(int) const; 00048 QVariant value(const QString &) const; 00049 bool isNull(int) const; 00050 QString posToFieldName(const int) const; 00051 int fieldNameToPos(const QString &) const; 00052 void setTablesList(const QString &); 00053 QVariant valueParam(const QString &) const; 00054 void setValueParam(const QString &, const QVariant &); 00055 bool next(); 00056 bool prev(); 00057 bool first(); 00058 bool last(); 00059 bool exec(); 00060 void showDebug(); 00061 int size() const; 00062 void setForwardOnly(bool); 00063 QSqlError *lastError() const; 00064 QString lastQuery() const; 00065 00066 protected: 00067 static void *construct(const QSArgumentList &args) { 00068 QMap<int, QStringList> candidates; 00069 candidates[0].append(QString::null); 00070 candidates[1].append(QString::fromLatin1("QObject*")); 00071 candidates[2].append(QString::fromLatin1("QObject*,QString")); 00072 QString sgt(castArgsSignature(args, candidates)); 00073 if (sgt.isEmpty()) 00074 return new AQSqlQuery; 00075 if (sgt == QString::fromLatin1("QObject*")) 00076 return new AQSqlQuery(argValue<QObject *>(args[0])); 00077 if (sgt == QString::fromLatin1("QObject*,QString")) 00078 return new AQSqlQuery(argValue<QObject *>(args[0]), 00079 *(argValue<QString *>(args[1]))); 00080 return 0; 00081 } 00082 00083 public: 00084 static QMap<int, QStringList> candidateConstructors() { 00085 QMap<int, QStringList> candidates; 00086 candidates[0].append(QString::null); 00087 candidates[1].append(QString::fromLatin1("QObject*")); 00088 candidates[2].append(QString::fromLatin1("QObject*,QString")); 00089 return candidates; 00090 } 00091 //@AQ_END_DEF_PUB_SLOTS@ 00092 }; 00093 00094 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00095 inline QString AQSSqlQuery::select() const 00096 { 00097 AQ_CALL_RET_V(select(), QString); 00098 } 00099 inline QString AQSSqlQuery::from() const 00100 { 00101 AQ_CALL_RET_V(from(), QString); 00102 } 00103 inline QString AQSSqlQuery::where() const 00104 { 00105 AQ_CALL_RET_V(where(), QString); 00106 } 00107 inline QString AQSSqlQuery::orderBy() const 00108 { 00109 AQ_CALL_RET_V(orderBy(), QString); 00110 } 00111 inline void AQSSqlQuery::setFrom(const QString &arg0) 00112 { 00113 AQ_CALL_VOID(setFrom(arg0)); 00114 } 00115 inline void AQSSqlQuery::setWhere(const QString &arg0) 00116 { 00117 AQ_CALL_VOID(setWhere(arg0)); 00118 } 00119 inline void AQSSqlQuery::setOrderBy(const QString &arg0) 00120 { 00121 AQ_CALL_VOID(setOrderBy(arg0)); 00122 } 00123 inline QString AQSSqlQuery::sql() const 00124 { 00125 AQ_CALL_RET_V(sql(), QString); 00126 } 00127 inline QStringList AQSSqlQuery::fieldList() const 00128 { 00129 AQ_CALL_RET_V(fieldList(), QStringList); 00130 } 00131 inline QVariant AQSSqlQuery::value(int arg0) const 00132 { 00133 AQ_CALL_RET_V(value(arg0), QVariant); 00134 } 00135 inline QVariant AQSSqlQuery::value(const QString &arg0) const 00136 { 00137 AQ_CALL_RET_V(value(arg0), QVariant); 00138 } 00139 inline bool AQSSqlQuery::isNull(int arg0) const 00140 { 00141 AQ_CALL_RET_V(isNull(arg0), bool); 00142 } 00143 inline QString AQSSqlQuery::posToFieldName(const int arg0) const 00144 { 00145 AQ_CALL_RET_V(posToFieldName(arg0), QString); 00146 } 00147 inline int AQSSqlQuery::fieldNameToPos(const QString &arg0) const 00148 { 00149 AQ_CALL_RET_V(fieldNameToPos(arg0), int); 00150 } 00151 inline void AQSSqlQuery::setTablesList(const QString &arg0) 00152 { 00153 AQ_CALL_VOID(setTablesList(arg0)); 00154 } 00155 inline QVariant AQSSqlQuery::valueParam(const QString &arg0) const 00156 { 00157 AQ_CALL_RET_V(valueParam(arg0), QVariant); 00158 } 00159 inline void AQSSqlQuery::setValueParam(const QString &arg0, const QVariant &arg1) 00160 { 00161 AQ_CALL_VOID(setValueParam(arg0, arg1)); 00162 } 00163 inline bool AQSSqlQuery::next() 00164 { 00165 AQ_CALL_RET_V(next(), bool); 00166 } 00167 inline bool AQSSqlQuery::prev() 00168 { 00169 AQ_CALL_RET_V(prev(), bool); 00170 } 00171 inline bool AQSSqlQuery::first() 00172 { 00173 AQ_CALL_RET_V(first(), bool); 00174 } 00175 inline bool AQSSqlQuery::last() 00176 { 00177 AQ_CALL_RET_V(last(), bool); 00178 } 00179 inline bool AQSSqlQuery::exec() 00180 { 00181 AQ_CALL_RET_V(exec(), bool); 00182 } 00183 inline void AQSSqlQuery::showDebug() 00184 { 00185 AQ_CALL_VOID(showDebug()); 00186 } 00187 inline int AQSSqlQuery::size() const 00188 { 00189 AQ_CALL_RET_V(size(), int); 00190 } 00191 inline void AQSSqlQuery::setForwardOnly(bool arg0) 00192 { 00193 AQ_CALL_VOID(setForwardOnly(arg0)); 00194 } 00195 inline QSqlError *AQSSqlQuery::lastError() const 00196 { 00197 AQ_CALL_RET_PTR(lastError(), QSqlError); 00198 } 00199 inline QString AQSSqlQuery::lastQuery() const 00200 { 00201 AQ_CALL_RET_V(lastQuery(), QString); 00202 } 00203 //@AQ_END_IMP_PUB_SLOTS@ 00204 00205 #endif /* AQSSQLQUERY_P_H_ */ 00206 // @AQOBJECT@