diff options
Diffstat (limited to 'src/torclient.h')
-rw-r--r-- | src/torclient.h | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/src/torclient.h b/src/torclient.h index caaed20..bb64476 100644 --- a/src/torclient.h +++ b/src/torclient.h @@ -21,7 +21,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ @@ -29,11 +29,11 @@ #ifndef _TORCLIENT_H_ #define _TORCLIENT_H_ -#include <qsocket.h> -#include <qtextstream.h> +#include <ntqsocket.h> +#include <ntqtextstream.h> #include <kdebug.h> #include <kconfigskeleton.h> -#include <qlistview.h> +#include <ntqlistview.h> #include "torkconfig.h" @@ -44,44 +44,44 @@ class PrevConfig { public: PrevConfig(): pr(0) {} - PrevConfig( const QString& name, const QVariant& property ) + PrevConfig( const TQString& name, const TQVariant& property ) : nm(name), pr(property) {} - typedef QValueList<PrevConfig> PrevConfigList; - QString name() const { return nm; } - QVariant property() const { return pr; } - void setName( QString n ) { nm = n; } - void setProperty( QVariant p ) { pr = p; } + typedef TQValueList<PrevConfig> PrevConfigList; + TQString name() const { return nm; } + TQVariant property() const { return pr; } + void setName( TQString n ) { nm = n; } + void setProperty( TQVariant p ) { pr = p; } private: - QString nm; - QVariant pr; + TQString nm; + TQVariant pr; }; -class TorClient : public QObject +class TorClient : public TQObject { Q_OBJECT public: - TorClient( const QString &host, Q_UINT16 port ); + TorClient( const TQString &host, TQ_UINT16 port ); virtual ~TorClient(); - void sendToServer(const QString &string) + void sendToServer(const TQString &string) { if (!socket) return; - QTextStream os(socket); + TQTextStream os(socket); os << string << "\r\n"; } - QStringList currentServerReport() + TQStringList currentServerReport() { return serverReport; } - QStringList currentClientReport() + TQStringList currentClientReport() { return clientReport; } @@ -90,8 +90,8 @@ public: bool isControllerWorking( ); void updatePrevConfig(PrevConfig::PrevConfigList previtems); void newIdentity(); - void createService(const QString &dir, const QString &port); - void setBandwidth(const QString &rate, const QString &burst, const QString &max); + void createService(const TQString &dir, const TQString &port); + void setBandwidth(const TQString &rate, const TQString &burst, const TQString &max); void setGeoIPAvailable(bool set){geoip_db = set;}; unsigned long int getCurBandwidthRate(){return m_CurBandwidthRate;}; unsigned long int getCurBandwidthBurst(){return m_CurBandwidthBurst;}; @@ -104,22 +104,22 @@ public: signals: - void streamStatusUpdate(const QString &, const QString &, - const QString &, const QString &, const QString &); - void ORStatusUpdate(const QString &, const QString &); - void guardStatusUpdate(const QString &, const QString &); - void circuitStatusUpdate(const QString &, const QString &, - const QString &, const QString &); - void infoUpdate(const QString &,const QString &, const QString &); - void bwUpdate(const QString &,const QString &); - void updateActiveServers(const QStringList &); - void updateServerStatus(const QString &, const QString &, - const QString &,const QString &); + void streamStatusUpdate(const TQString &, const TQString &, + const TQString &, const TQString &, const TQString &); + void ORStatusUpdate(const TQString &, const TQString &); + void guardStatusUpdate(const TQString &, const TQString &); + void circuitStatusUpdate(const TQString &, const TQString &, + const TQString &, const TQString &); + void infoUpdate(const TQString &,const TQString &, const TQString &); + void bwUpdate(const TQString &,const TQString &); + void updateActiveServers(const TQStringList &); + void updateServerStatus(const TQString &, const TQString &, + const TQString &,const TQString &); void fatalError(); void serverError(); - void displayError(const QString &,const QString &); - void displayServer(const QString &,const QString &); - void whatImDoing(const QString &); + void displayError(const TQString &,const TQString &); + void displayServer(const TQString &,const TQString &); + void whatImDoing(const TQString &); void copyOldConfig(); void shouldIApplySettings(); void torConnectionClosed(); @@ -128,26 +128,26 @@ signals: void needAlphaVersion( ); void connectedToTor( ); void authenticated(); - void streamBwUpdate(const QString &,const QString &,const QString & ); - void setTorCaption(const QString &); - void processWarning(const QString &,const QString &); - void processQuestion(const QString &,const QString &); - void showServerBW(const QString&); - void updateTrayIcon(const QString&); - void resolvedAddress(const QString&); + void streamBwUpdate(const TQString &,const TQString &,const TQString & ); + void setTorCaption(const TQString &); + void processWarning(const TQString &,const TQString &); + void processQuestion(const TQString &,const TQString &); + void showServerBW(const TQString&); + void updateTrayIcon(const TQString&); + void resolvedAddress(const TQString&); void authenticationFailed(); public slots: void socketReadyRead(); void applySettingsToRunningTor(); - void attemptAttach(const QString &, const QString &); - void attemptExtendCircuit(const QString &, const QString &, bool); - void attemptCreateCircuit(const QString &, bool); - void attemptCloseStream(const QString &); + void attemptAttach(const TQString &, const TQString &); + void attemptExtendCircuit(const TQString &, const TQString &, bool); + void attemptCreateCircuit(const TQString &, bool); + void attemptCloseStream(const TQString &); void attemptAttachStreams( bool ); - void attemptCloseCircuit(const QString &); - void fetchServerInfo(const QString &); - void fetchServerInfoByNick(const QString &); + void attemptCloseCircuit(const TQString &); + void fetchServerInfo(const TQString &); + void fetchServerInfoByNick(const TQString &); void slotCheckTorNet(); void authenticate(); void slotCheckGuards(); @@ -158,17 +158,17 @@ public slots: void clearNodes(); void strictExitNodes( bool strict ); void configureServer( int orPort, int dirPort); - void closeAllCircuits( QListView* &circuitList); + void closeAllCircuits( TQListView* &circuitList); void allowPlainTextPorts( ); void assignPortToRemove(); - void resolveAddress(const QString &); + void resolveAddress(const TQString &); void terminateTor(); private slots: void closeConnection() { socket->close(); - if ( socket->state() == QSocket::Closing ) { + if ( socket->state() == TQSocket::Closing ) { // We have a delayed close. connect( socket, SIGNAL(delayedCloseFinished()), SLOT(socketClosed()) ); @@ -195,36 +195,36 @@ private slots: void socketError( int e ) { - if ( e == QSocket::ErrHostNotFound || - e == QSocket::ErrConnectionRefused ) + if ( e == TQSocket::ErrHostNotFound || + e == TQSocket::ErrConnectionRefused ) emit fatalError(); } - void parseEvent(const QString &type, const QString &info); - void parseStream(const QString &info); - void parseGuards(const QString &info); - void parseORConn(const QString &info); - void parseServer(const QString &info); - void parseCircuit(const QString &info); - void parseInfo(const QString &type, const QString &info); - void parseBW(const QString &info); - void parseAddrmap(const QString &info); - void parseStreamBW(const QString &info); - void parseDirStatus(const QString &info); - void parseStatusGeneral(const QString &info); + void parseEvent(const TQString &type, const TQString &info); + void parseStream(const TQString &info); + void parseGuards(const TQString &info); + void parseORConn(const TQString &info); + void parseServer(const TQString &info); + void parseCircuit(const TQString &info); + void parseInfo(const TQString &type, const TQString &info); + void parseBW(const TQString &info); + void parseAddrmap(const TQString &info); + void parseStreamBW(const TQString &info); + void parseDirStatus(const TQString &info); + void parseStatusGeneral(const TQString &info); void resetClientReport(); - void updateCandidateServers(const QString &path); - void handle250(const QString &line); - void updateServerReport(const QString &message, - const QString &info); - void updateClientReport(const QString &message); - void populateMessageFromStatusDetail(const QString &line, - QString &message); - void handleTorVersion( const QString &caption); + void updateCandidateServers(const TQString &path); + void handle250(const TQString &line); + void updateServerReport(const TQString &message, + const TQString &info); + void updateClientReport(const TQString &message); + void populateMessageFromStatusDetail(const TQString &line, + TQString &message); + void handleTorVersion( const TQString &caption); void readRouters(); private: - QSocket *socket; + TQSocket *socket; bool m_expectingCircuitInfo; bool m_expectingStreamInfo; bool m_expectingOrconnInfo; @@ -233,18 +233,18 @@ private: bool m_expectingServerInfo; bool m_resolvingServerAddress; bool geoip_db; - QString m_currentTorVersion; + TQString m_currentTorVersion; bool elementShouldBeUsed(const KConfigSkeletonItem* it); bool noSpecialProcessing(const KConfigSkeletonItem* it); bool readCookie(); - QString ds_identity; - QString ds_fp_identity; - QString ds_ip; - QString ds_server; - QString ds_date; - QString ds_statuses; - QString m_statustip; - QString m_statustiptmp; + TQString ds_identity; + TQString ds_fp_identity; + TQString ds_ip; + TQString ds_server; + TQString ds_date; + TQString ds_statuses; + TQString m_statustip; + TQString m_statustiptmp; bool m_controllerWorking; bool authorityread; bool m_firstloadcomplete; @@ -253,20 +253,20 @@ private: int m_CurBandwidthRate; int m_CurBandwidthBurst; int m_CurMaxAdvertisedBandwidth; - QString m_statustipIP; - typedef QMap<QString, QString> statusmap; + TQString m_statustipIP; + typedef TQMap<TQString, TQString> statusmap; statusmap statusMessage; statusmap serverStatus; statusmap serverStatusIcon; statusmap clientStatus; statusmap portMessage; statusmap clientStatusIcon; - QStringList serverReport; - QStringList clientReport; - QStringList m_WarnedPorts; - QStringList m_portsToReject; - QString m_portToRemove; - QStringList logResolveList; + TQStringList serverReport; + TQStringList clientReport; + TQStringList m_WarnedPorts; + TQStringList m_portsToReject; + TQString m_portToRemove; + TQStringList logResolveList; }; #endif // |