diff options
Diffstat (limited to 'src/kvilib/net/kvi_http.h')
-rw-r--r-- | src/kvilib/net/kvi_http.h | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/kvilib/net/kvi_http.h b/src/kvilib/net/kvi_http.h index 1bd6a9d9..de4457d8 100644 --- a/src/kvilib/net/kvi_http.h +++ b/src/kvilib/net/kvi_http.h @@ -33,10 +33,10 @@ #include "kvi_inttypes.h" #include "kvi_url.h" -#include <qobject.h> +#include <tqobject.h> #include "kvi_pointerhashtable.h" #include "kvi_file.h" -#include <qstringlist.h> +#include <tqstringlist.h> class KviDns; class KviSSL; @@ -45,12 +45,13 @@ class KviHttpRequestThread; // // This class implements a HTTP protocol client. // It's able to send GET, POST and HEAD requests, -// download stuff to a file or to a qt SLOT(). +// download stuff to a file or to a qt TQT_SLOT(). // -class KVILIB_API KviHttpRequest : public QObject, public KviHeapObject +class KVILIB_API KviHttpRequest : public TQObject, public KviHeapObject { Q_OBJECT + TQ_OBJECT public: enum ProcessingType { @@ -73,19 +74,19 @@ public: protected: // data KviUrl m_url; - QString m_szFileName; + TQString m_szFileName; ProcessingType m_eProcessingType; ExistingFileAction m_eExistingFileAction; void * m_pPrivateData; unsigned int m_uMaxContentLength; unsigned int m_uContentOffset; - QString m_szPostData; + TQString m_szPostData; // status - QString m_szLastError; + TQString m_szLastError; unsigned int m_uTotalSize; unsigned int m_uReceivedSize; // internal status - QString m_szIp; + TQString m_szIp; KviDns * m_pDns; KviHttpRequestThread * m_pThread; KviDataBuffer * m_pBuffer; @@ -97,15 +98,15 @@ protected: KviFile * m_pFile; protected: bool startDnsLookup(); - virtual bool event(QEvent *e); + virtual bool event(TQEvent *e); void processData(KviDataBuffer * data); bool processHeader(KviStr &szHeader); bool openFile(); void emitLines(KviDataBuffer * pDataBuffer); - void resetStatus(); + void resettqStatus(); void resetData(); - void resetInternalStatus(); + void resetInternaltqStatus(); protected slots: void dnsLookupDone(KviDns *d); void haveServerIp(); @@ -113,7 +114,7 @@ public: const KviUrl & url(){ return m_url; }; ProcessingType processingType(){ return m_eProcessingType; }; ExistingFileAction existingFileAction(){ return m_eExistingFileAction; }; - const QString &fileName(){ return m_szFileName; }; + const TQString &fileName(){ return m_szFileName; }; void * privateData(){ return m_pPrivateData; }; unsigned int maxContentLength(){ return m_uMaxContentLength; }; unsigned int contentOffset(){ return m_uContentOffset; }; @@ -122,11 +123,11 @@ public: void reset(); - void setPostData(const QString &szPostData){ m_szPostData = szPostData; }; + void setPostData(const TQString &szPostData){ m_szPostData = szPostData; }; void setUrl(const KviUrl &u){ m_url = u; }; void setProcessingType(ProcessingType t){ m_eProcessingType = t; }; void setExistingFileAction(ExistingFileAction a){ m_eExistingFileAction = a; }; - void setFileName(const QString &szFileName){ m_szFileName = szFileName; }; + void setFileName(const TQString &szFileName){ m_szFileName = szFileName; }; void setPrivateData(void * ptr){ m_pPrivateData = ptr; }; void setMaxContentLength(int uMaxContentLength){ m_uMaxContentLength = uMaxContentLength; }; //0 means unlimited // this will work regardless of ExistingFileAction : even if the file doesn't exist @@ -135,25 +136,25 @@ public: bool start(); // this is a shortcut for reset()+setUrl()+setProcessingType()+setFileName()+start() - bool get(const KviUrl &u,ProcessingType p = WholeFile,const QString &szFileName = QString::null); + bool get(const KviUrl &u,ProcessingType p = WholeFile,const TQString &szFileName = TQString()); - const QString & lastError(){ return m_szLastError; }; + const TQString & lastError(){ return m_szLastError; }; void abort(); signals: - void resolvingHost(const QString &hostname); - void contactingHost(const QString &ipandport); + void resolvingHost(const TQString &hostname); + void contactingHost(const TQString &ipandport); void connectionEstabilished(); - void receivedResponse(const QString &response); + void receivedResponse(const TQString &response); void terminated(bool bSuccess); - void status(const QString &message); + void status(const TQString &message); void data(const KviStr &data); void binaryData(const KviDataBuffer &data); void header(KviPointerHashTable<const char *,KviStr> * hdr); - void requestSent(const QStringList &request); + void requestSent(const TQStringList &request); }; @@ -164,13 +165,13 @@ public: enum RequestMethod { Post, Get , Head }; protected: KviHttpRequestThread(KviHttpRequest * r, - const QString &szHost, - const QString &szIp, + const TQString &szHost, + const TQString &szIp, unsigned short uPort, - const QString &szPath, + const TQString &szPath, unsigned int uContentOffset, RequestMethod m, - const QString &szPostData = QString::null, + const TQString &szPostData = TQString(), bool bUseSSL = false); public: @@ -178,12 +179,12 @@ public: protected: KviHttpRequest * m_pRequest; - QString m_szHost; - QString m_szIp; - QString m_szPath; + TQString m_szHost; + TQString m_szIp; + TQString m_szPath; unsigned int m_uContentOffset; RequestMethod m_eRequestMethod; - QString m_szPostData; + TQString m_szPostData; unsigned short m_uPort; kvi_socket_t m_sock; |