• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

slave.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 /*
00003  *  This file is part of the KDE libraries
00004  *  Copyright (c) 2000 Waldo Bastian <bastian@kde.org>
00005  *                2000 Stephan Kulow <coolo@kde.org>
00006  *
00007  *  This library is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU Library General Public
00009  *  License version 2 as published by the Free Software Foundation.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Library General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Library General Public License
00017  *  along with this library; see the file COPYING.LIB.  If not, write to
00018  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  *  Boston, MA 02110-1301, USA.
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     // Attention developers: If you change the implementation of KIO::Slave,
00040     // do *not* use connection() or slaveconn but the respective KIO::Slave
00041     // accessor methods. Otherwise classes derived from Slave might break. (LS)
00042     //
00043     // Do not use this class directly, outside of KIO. Only use the Slave pointer
00044     // that is returned by the scheduler for passing it around.
00045     //
00046     // TODO: KDE5: Separate public API and private stuff for this better
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     // == communication with connected kioslave ==
00150     // whenever possible prefer these methods over the respective
00151     // methods in connection()
00155         virtual void suspend();
00159         virtual void resume();
00164         virtual bool suspended();
00170         virtual void send(int cmd, const QByteArray &arr = QByteArray());
00171 
00172     // == end communication with connected kioslave ==
00181     virtual void hold(const KUrl &url); // TODO KDE5: no reason to be virtual
00182 
00186     time_t idleTime();
00187 
00191     void setIdle();
00192 
00193         /*
00194          * @returns Whether the slave is connected
00195          * (Connection oriented slaves only)
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

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal