• Skip to content
  • Skip to link menu
KDE 4.1 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 #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     // Attention developers: If you change the implementation of KIO::Slave,
00044     // do *not* use connection() or slaveconn but the respective KIO::Slave
00045     // accessor methods. Otherwise classes derived from Slave might break. (LS)
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     // == communication with connected kioslave ==
00149     // whenever possible prefer these methods over the respective
00150     // methods in connection()
00154         virtual void suspend();
00158         virtual void resume();
00163         virtual bool suspended();
00169         virtual void send(int cmd, const QByteArray &arr = QByteArray());
00170     // == end communication with connected kioslave ==
00171 
00180     virtual void hold(const KUrl &url); // TODO KDE5: no reason to be virtual
00181 
00185     time_t idleTime();
00186 
00190     void setIdle();
00191 
00192         /*
00193          * @returns Whether the slave is connected
00194          * (Connection oriented slaves only)
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

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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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