Eneboo - Documentación para desarrolladores
src/flbase/aqsobjects/AQSHttp_p.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQSHttp_p.h
00003  -------------------
00004  begin                : 28/04/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 AQSHTTP_P_H_
00020 #define AQSHTTP_P_H_
00021 
00022 #include "AQSNetworkProtocol_p.h"
00023 #include "AQSHttpRequestHeader_p.h"
00024 #include "AQSIODevice_p.h"
00025 #include <qhttp.h>
00026 
00027 class AQSHttp : public AQSNetworkProtocol
00028 {
00029   Q_OBJECT
00030 
00031   AQ_DECLARE_AQS_OBJECT(Http, NetworkProtocol);
00032 
00033   //@AQ_BEGIN_DEF_PUB_SLOTS@
00034 public slots:
00035   int setHost(const QString &, uint = 80);
00036   int get(const QString &, QIODevice *);
00037   int get(const QString &, AQSIODevice *);
00038   int post(const QString &, QIODevice *, QIODevice *);
00039   int post(const QString &, QIODevice *, AQSIODevice *);
00040   int post(const QString &, AQSIODevice *, QIODevice *);
00041   int post(const QString &, AQSIODevice *, AQSIODevice *);
00042   int post(const QString &, QByteArray *, QIODevice *);
00043   int post(const QString &, QByteArray *, AQSIODevice *);
00044   int post(const QString &, AQSByteArray *, QIODevice *);
00045   int post(const QString &, AQSByteArray *, AQSIODevice *);
00046   int head(const QString &);
00047   int request(QHttpRequestHeader *, QIODevice *, QIODevice *);
00048   int request(QHttpRequestHeader *, QIODevice *, AQSIODevice *);
00049   int request(QHttpRequestHeader *, AQSIODevice *, QIODevice *);
00050   int request(QHttpRequestHeader *, AQSIODevice *, AQSIODevice *);
00051   int request(AQSHttpRequestHeader *, QIODevice *, QIODevice *);
00052   int request(AQSHttpRequestHeader *, QIODevice *, AQSIODevice *);
00053   int request(AQSHttpRequestHeader *, AQSIODevice *, QIODevice *);
00054   int request(AQSHttpRequestHeader *, AQSIODevice *, AQSIODevice *);
00055   int request(QHttpRequestHeader *, QByteArray *, QIODevice *);
00056   int request(QHttpRequestHeader *, QByteArray *, AQSIODevice *);
00057   int request(QHttpRequestHeader *, AQSByteArray *, QIODevice *);
00058   int request(QHttpRequestHeader *, AQSByteArray *, AQSIODevice *);
00059   int request(AQSHttpRequestHeader *, QByteArray *, QIODevice *);
00060   int request(AQSHttpRequestHeader *, QByteArray *, AQSIODevice *);
00061   int request(AQSHttpRequestHeader *, AQSByteArray *, QIODevice *);
00062   int request(AQSHttpRequestHeader *, AQSByteArray *, AQSIODevice *);
00063   int closeConnection();
00064   ulong bytesAvailable() const;
00065   long readBlock(char *, ulong);
00066   QByteArray readAll();
00067   int currentId() const;
00068   QIODevice *currentSourceDevice() const;
00069   QIODevice *currentDestinationDevice() const;
00070   QHttpRequestHeader *currentRequest() const;
00071   bool hasPendingRequests() const;
00072   void clearPendingRequests();
00073   uint state() const;
00074   uint error() const;
00075   QString errorString() const;
00076 
00077 protected:
00078   static void *construct(const QSArgumentList &args) {
00079     QMap<int, QStringList> candidates;
00080     candidates[0].append(QString::null);
00081     candidates[1].append(QString::fromLatin1("QObject*"));
00082     candidates[2].append(QString::fromLatin1("QObject*,QString"));
00083     candidates[1].append(QString::fromLatin1("QString"));
00084     candidates[2].append(QString::fromLatin1("QString,uint"));
00085     candidates[3].append(QString::fromLatin1("QString,uint,QObject*"));
00086     candidates[4].append(QString::fromLatin1("QString,uint,QObject*,QString"));
00087     QString sgt(castArgsSignature(args, candidates));
00088     if (sgt.isEmpty())
00089       return new QHttp;
00090     if (sgt == QString::fromLatin1("QObject*"))
00091       return new QHttp(argValue<QObject *>(args[0]));
00092     if (sgt == QString::fromLatin1("QObject*,QString"))
00093       return new QHttp(argValue<QObject *>(args[0]),
00094                        *(argValue<QString *>(args[1])));
00095     if (sgt == QString::fromLatin1("QString"))
00096       return new QHttp(*(argValue<QString *>(args[0])));
00097     if (sgt == QString::fromLatin1("QString,uint"))
00098       return new QHttp(*(argValue<QString *>(args[0])),
00099                        args[1].variant().toUInt());
00100     if (sgt == QString::fromLatin1("QString,uint,QObject*"))
00101       return new QHttp(*(argValue<QString *>(args[0])),
00102                        args[1].variant().toUInt(),
00103                        argValue<QObject *>(args[2]));
00104     if (sgt == QString::fromLatin1("QString,uint,QObject*,QString"))
00105       return new QHttp(*(argValue<QString *>(args[0])),
00106                        args[1].variant().toUInt(),
00107                        argValue<QObject *>(args[2]),
00108                        *(argValue<QString *>(args[3])));
00109     return 0;
00110   }
00111 
00112 public:
00113   static QMap<int, QStringList> candidateConstructors() {
00114     QMap<int, QStringList> candidates;
00115     candidates[0].append(QString::null);
00116     candidates[1].append(QString::fromLatin1("QObject*"));
00117     candidates[2].append(QString::fromLatin1("QObject*,QString"));
00118     candidates[1].append(QString::fromLatin1("QString"));
00119     candidates[2].append(QString::fromLatin1("QString,uint"));
00120     candidates[3].append(QString::fromLatin1("QString,uint,QObject*"));
00121     candidates[4].append(QString::fromLatin1("QString,uint,QObject*,QString"));
00122     return candidates;
00123   }
00124   //@AQ_END_DEF_PUB_SLOTS@
00125 };
00126 
00127 //@AQ_BEGIN_IMP_PUB_SLOTS@
00128 inline int AQSHttp::setHost(const QString &arg0,  uint arg1)
00129 {
00130   AQ_CALL_RET_V(setHost(arg0, arg1), int);
00131 }
00132 inline int AQSHttp::get(const QString &arg0,  QIODevice *arg1)
00133 {
00134   AQ_CALL_RET_V(get(arg0, arg1), int);
00135 }
00136 inline int AQSHttp::get(const QString &arg0, AQSIODevice *arg1)
00137 {
00138   AQ_CALL_RET_V(get(arg0, *arg1), int);
00139 }
00140 inline int AQSHttp::post(const QString &arg0,  QIODevice *arg1,  QIODevice *arg2)
00141 {
00142   AQ_CALL_RET_V(post(arg0, arg1, arg2), int);
00143 }
00144 inline int AQSHttp::post(const QString &arg0,  QIODevice *arg1, AQSIODevice *arg2)
00145 {
00146   AQ_CALL_RET_V(post(arg0, arg1, *arg2), int);
00147 }
00148 inline int AQSHttp::post(const QString &arg0, AQSIODevice *arg1,  QIODevice *arg2)
00149 {
00150   AQ_CALL_RET_V(post(arg0, *arg1, arg2), int);
00151 }
00152 inline int AQSHttp::post(const QString &arg0, AQSIODevice *arg1, AQSIODevice *arg2)
00153 {
00154   AQ_CALL_RET_V(post(arg0, *arg1, *arg2), int);
00155 }
00156 inline int AQSHttp::post(const QString &arg0,  QByteArray *arg1,  QIODevice *arg2)
00157 {
00158   AQ_CALL_RET_V(post(arg0, *arg1, arg2), int);
00159 }
00160 inline int AQSHttp::post(const QString &arg0,  QByteArray *arg1, AQSIODevice *arg2)
00161 {
00162   AQ_CALL_RET_V(post(arg0, *arg1, *arg2), int);
00163 }
00164 inline int AQSHttp::post(const QString &arg0, AQSByteArray *arg1,  QIODevice *arg2)
00165 {
00166   AQ_CALL_RET_V(post(arg0, *arg1, arg2), int);
00167 }
00168 inline int AQSHttp::post(const QString &arg0, AQSByteArray *arg1, AQSIODevice *arg2)
00169 {
00170   AQ_CALL_RET_V(post(arg0, *arg1, *arg2), int);
00171 }
00172 inline int AQSHttp::head(const QString &arg0)
00173 {
00174   AQ_CALL_RET_V(head(arg0), int);
00175 }
00176 inline int AQSHttp::request(QHttpRequestHeader *arg0,  QIODevice *arg1,  QIODevice *arg2)
00177 {
00178   AQ_CALL_RET_V(request(*arg0, arg1, arg2), int);
00179 }
00180 inline int AQSHttp::request(QHttpRequestHeader *arg0,  QIODevice *arg1, AQSIODevice *arg2)
00181 {
00182   AQ_CALL_RET_V(request(*arg0, arg1, *arg2), int);
00183 }
00184 inline int AQSHttp::request(QHttpRequestHeader *arg0, AQSIODevice *arg1,  QIODevice *arg2)
00185 {
00186   AQ_CALL_RET_V(request(*arg0, *arg1, arg2), int);
00187 }
00188 inline int AQSHttp::request(QHttpRequestHeader *arg0, AQSIODevice *arg1, AQSIODevice *arg2)
00189 {
00190   AQ_CALL_RET_V(request(*arg0, *arg1, *arg2), int);
00191 }
00192 inline int AQSHttp::request(AQSHttpRequestHeader *arg0,  QIODevice *arg1,  QIODevice *arg2)
00193 {
00194   AQ_CALL_RET_V(request(*arg0, arg1, arg2), int);
00195 }
00196 inline int AQSHttp::request(AQSHttpRequestHeader *arg0,  QIODevice *arg1, AQSIODevice *arg2)
00197 {
00198   AQ_CALL_RET_V(request(*arg0, arg1, *arg2), int);
00199 }
00200 inline int AQSHttp::request(AQSHttpRequestHeader *arg0, AQSIODevice *arg1,  QIODevice *arg2)
00201 {
00202   AQ_CALL_RET_V(request(*arg0, *arg1, arg2), int);
00203 }
00204 inline int AQSHttp::request(AQSHttpRequestHeader *arg0, AQSIODevice *arg1, AQSIODevice *arg2)
00205 {
00206   AQ_CALL_RET_V(request(*arg0, *arg1, *arg2), int);
00207 }
00208 inline int AQSHttp::request(QHttpRequestHeader *arg0,  QByteArray *arg1,  QIODevice *arg2)
00209 {
00210   AQ_CALL_RET_V(request(*arg0, *arg1, arg2), int);
00211 }
00212 inline int AQSHttp::request(QHttpRequestHeader *arg0,  QByteArray *arg1, AQSIODevice *arg2)
00213 {
00214   AQ_CALL_RET_V(request(*arg0, *arg1, *arg2), int);
00215 }
00216 inline int AQSHttp::request(QHttpRequestHeader *arg0, AQSByteArray *arg1,  QIODevice *arg2)
00217 {
00218   AQ_CALL_RET_V(request(*arg0, *arg1, arg2), int);
00219 }
00220 inline int AQSHttp::request(QHttpRequestHeader *arg0, AQSByteArray *arg1, AQSIODevice *arg2)
00221 {
00222   AQ_CALL_RET_V(request(*arg0, *arg1, *arg2), int);
00223 }
00224 inline int AQSHttp::request(AQSHttpRequestHeader *arg0,  QByteArray *arg1,  QIODevice *arg2)
00225 {
00226   AQ_CALL_RET_V(request(*arg0, *arg1, arg2), int);
00227 }
00228 inline int AQSHttp::request(AQSHttpRequestHeader *arg0,  QByteArray *arg1, AQSIODevice *arg2)
00229 {
00230   AQ_CALL_RET_V(request(*arg0, *arg1, *arg2), int);
00231 }
00232 inline int AQSHttp::request(AQSHttpRequestHeader *arg0, AQSByteArray *arg1,  QIODevice *arg2)
00233 {
00234   AQ_CALL_RET_V(request(*arg0, *arg1, arg2), int);
00235 }
00236 inline int AQSHttp::request(AQSHttpRequestHeader *arg0, AQSByteArray *arg1, AQSIODevice *arg2)
00237 {
00238   AQ_CALL_RET_V(request(*arg0, *arg1, *arg2), int);
00239 }
00240 inline int AQSHttp::closeConnection()
00241 {
00242   AQ_CALL_RET_V(closeConnection(), int);
00243 }
00244 inline ulong AQSHttp::bytesAvailable() const
00245 {
00246   AQ_CALL_RET_V(bytesAvailable(), ulong);
00247 }
00248 inline long AQSHttp::readBlock(char *arg0,  ulong arg1)
00249 {
00250   AQ_CALL_RET_V(readBlock(arg0, arg1), long);
00251 }
00252 inline QByteArray AQSHttp::readAll()
00253 {
00254   AQ_CALL_RET_V(readAll(), QByteArray);
00255 }
00256 inline int AQSHttp::currentId() const
00257 {
00258   AQ_CALL_RET_V(currentId(), int);
00259 }
00260 inline QIODevice *AQSHttp::currentSourceDevice() const
00261 {
00262   AQ_CALL_RET(currentSourceDevice());
00263 }
00264 inline QIODevice *AQSHttp::currentDestinationDevice() const
00265 {
00266   AQ_CALL_RET(currentDestinationDevice());
00267 }
00268 inline QHttpRequestHeader *AQSHttp::currentRequest() const
00269 {
00270   AQ_CALL_RET_PTR(currentRequest(), QHttpRequestHeader);
00271 }
00272 inline bool AQSHttp::hasPendingRequests() const
00273 {
00274   AQ_CALL_RET_V(hasPendingRequests(), bool);
00275 }
00276 inline void AQSHttp::clearPendingRequests()
00277 {
00278   AQ_CALL_VOID(clearPendingRequests());
00279 }
00280 inline uint AQSHttp::state() const
00281 {
00282   AQ_CALL_RET_V(state(), uint);
00283 }
00284 inline uint AQSHttp::error() const
00285 {
00286   AQ_CALL_RET_V(error(), uint);
00287 }
00288 inline QString AQSHttp::errorString() const
00289 {
00290   AQ_CALL_RET_V(errorString(), QString);
00291 }
00292 //@AQ_END_IMP_PUB_SLOTS@
00293 
00294 #endif /* AQSHTTP_P_H_ */
00295 // @AQSOBJECT@
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'