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 #define KIO_SLAVE_EXPORT KIO_EXPORT
00026
00027 #include <time.h>
00028 #include <unistd.h>
00029
00030 #include <QtCore/QObject>
00031
00032 #include <kurl.h>
00033
00034 #include "kio/slaveinterface.h"
00035
00036 namespace KIO {
00037
00038 class SlavePrivate;
00039
00040
00041
00042
00043
00044
00045
00046
00047 class KIO_SLAVE_EXPORT Slave : public KIO::SlaveInterface
00048 {
00049 Q_OBJECT
00050 public:
00051 explicit Slave(const QString &protocol, QObject *parent = 0);
00052
00053 virtual ~Slave();
00054
00055 void setPID(pid_t);
00056
00057 int slave_pid();
00058
00062 void kill();
00063
00067 bool isAlive();
00068
00076 virtual void setHost( const QString &host, quint16 port,
00077 const QString &user, const QString &passwd);
00078
00082 void resetHost();
00083
00087 virtual void setConfig(const MetaData &config);
00088
00094 QString protocol();
00095
00096 void setProtocol(const QString & protocol);
00109 QString slaveProtocol();
00110
00114 QString host();
00115
00119 quint16 port();
00120
00124 QString user();
00125
00129 QString passwd();
00130
00141 static Slave* createSlave( const QString &protocol, const KUrl& url, int& error, QString& error_text );
00142
00147 static Slave* holdSlave( const QString &protocol, const KUrl& url );
00148
00149
00150
00151
00155 virtual void suspend();
00159 virtual void resume();
00164 virtual bool suspended();
00170 virtual void send(int cmd, const QByteArray &arr = QByteArray());
00171
00172
00181 virtual void hold(const KUrl &url);
00182
00186 time_t idleTime();
00187
00191 void setIdle();
00192
00193
00194
00195
00196
00197 bool isConnected();
00198 void setConnected(bool c);
00199
00200 void ref();
00201 void deref();
00202
00203 public Q_SLOTS:
00204 void accept();
00205 void gotInput();
00206 void timeout();
00207 Q_SIGNALS:
00208 void slaveDied(KIO::Slave *slave);
00209
00210 private:
00211 Q_DECLARE_PRIVATE(Slave)
00212 };
00213 }
00214
00215 #undef KIO_SLAVE_EXPORT
00216
00217 #endif