KIO
slave.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KIO_SLAVE_H
00023 #define KIO_SLAVE_H
00024
00025 #if defined(MAKE_KIO_LIB) || defined(MAKE_KLAUNCHER)
00026 # define KIO_SLAVE_EXPORT KIO_EXPORT
00027 #else
00028 # define KIO_SLAVE_EXPORT KIO_EXPORT_DEPRECATED
00029 #endif
00030
00031 #include <time.h>
00032 #include <unistd.h>
00033
00034 #include <QtCore/QObject>
00035
00036 #include <kurl.h>
00037
00038 #include "kio/slaveinterface.h"
00039
00040 namespace KIO {
00041
00042 class SlavePrivate;
00043
00044
00045
00046 class KIO_SLAVE_EXPORT Slave : public KIO::SlaveInterface
00047 {
00048 Q_OBJECT
00049 public:
00050 explicit Slave(const QString &protocol, QObject *parent = 0);
00051
00052 virtual ~Slave();
00053
00054 void setPID(pid_t);
00055
00056 int slave_pid();
00057
00061 void kill();
00062
00066 bool isAlive();
00067
00075 virtual void setHost( const QString &host, quint16 port,
00076 const QString &user, const QString &passwd);
00077
00081 void resetHost();
00082
00086 virtual void setConfig(const MetaData &config);
00087
00093 QString protocol();
00094
00095 void setProtocol(const QString & protocol);
00108 QString slaveProtocol();
00109
00113 QString host();
00114
00118 quint16 port();
00119
00123 QString user();
00124
00128 QString passwd();
00129
00140 static Slave* createSlave( const QString &protocol, const KUrl& url, int& error, QString& error_text );
00141
00146 static Slave* holdSlave( const QString &protocol, const KUrl& url );
00147
00148
00149
00150
00154 virtual void suspend();
00158 virtual void resume();
00163 virtual bool suspended();
00169 virtual void send(int cmd, const QByteArray &arr = QByteArray());
00170
00171
00180 virtual void hold(const KUrl &url);
00181
00185 time_t idleTime();
00186
00190 void setIdle();
00191
00192
00193
00194
00195
00196 bool isConnected();
00197 void setConnected(bool c);
00198
00199 void ref();
00200 void deref();
00201
00202 public Q_SLOTS:
00203 void accept();
00204 void gotInput();
00205 void timeout();
00206 Q_SIGNALS:
00207 void slaveDied(KIO::Slave *slave);
00208
00209 private:
00210 Q_DECLARE_PRIVATE(Slave)
00211 };
00212 }
00213
00214 #undef KIO_SLAVE_EXPORT
00215
00216 #endif