• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
slave.h
Go to the documentation of this file.
1// -*- c++ -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (c) 2000 Waldo Bastian <bastian@kde.org>
5 * 2000 Stephan Kulow <coolo@kde.org>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License version 2 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 **/
21
22#ifndef KIO_SLAVE_H
23#define KIO_SLAVE_H
24
25#define KIO_SLAVE_EXPORT KIO_EXPORT
26
27#include <time.h>
28#include <unistd.h>
29
30#include <QtCore/QObject>
31
32#include <kurl.h>
33
34#include "kio/slaveinterface.h"
35
36namespace KIO {
37
38class SlavePrivate;
39class SimpleJob;
40// Attention developers: If you change the implementation of KIO::Slave,
41// do *not* use connection() or slaveconn but the respective KIO::Slave
42// accessor methods. Otherwise classes derived from Slave might break. (LS)
43//
44// Do not use this class directly, outside of KIO. Only use the Slave pointer
45// that is returned by the scheduler for passing it around.
46//
47// TODO: KDE5: Separate public API and private stuff for this better
48class KIO_SLAVE_EXPORT Slave : public KIO::SlaveInterface
49{
50 Q_OBJECT
51public:
52 explicit Slave(const QString &protocol, QObject *parent = 0);
53
54 virtual ~Slave();
55
56 void setPID(pid_t);
57 int slave_pid();
58
59 void setJob(KIO::SimpleJob *job);
60 KIO::SimpleJob *job() const;
61
65 void kill();
66
70 bool isAlive();
71
79 virtual void setHost( const QString &host, quint16 port,
80 const QString &user, const QString &passwd);
81
85 void resetHost();
86
90 virtual void setConfig(const MetaData &config);
91
97 QString protocol();
98
99 void setProtocol(const QString & protocol);
100
113 QString slaveProtocol();
114
118 QString host();
119
123 quint16 port();
124
128 QString user();
129
133 QString passwd();
134
145 static Slave* createSlave( const QString &protocol, const KUrl& url, int& error, QString& error_text );
146
151 static Slave* holdSlave( const QString &protocol, const KUrl& url );
152
158 static bool checkForHeldSlave(const KUrl& url);
159
160 // == communication with connected kioslave ==
161 // whenever possible prefer these methods over the respective
162 // methods in connection()
166 virtual void suspend();
167
171 virtual void resume();
172
177 virtual bool suspended();
178
184 virtual void send(int cmd, const QByteArray &arr = QByteArray());
185
186 // == end communication with connected kioslave ==
195 virtual void hold(const KUrl &url); // TODO KDE5: no reason to be virtual
196
200 time_t idleTime();
201
205 void setIdle();
206
207 /*
208 * @returns Whether the slave is connected
209 * (Connection oriented slaves only)
210 */
211 bool isConnected();
212 void setConnected(bool c);
213
214 void ref();
215 void deref();
216
217public Q_SLOTS:
218 void accept();
219 void gotInput();
220 void timeout();
221
222Q_SIGNALS:
223 void slaveDied(KIO::Slave *slave);
224
225private:
226 Q_DECLARE_PRIVATE(Slave)
227};
228
229}
230
231#undef KIO_SLAVE_EXPORT
232
233#endif
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:397
KIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:322
KIO::SlaveInterface
There are two classes that specifies the protocol between application ( KIO::Job) and kioslave.
Definition: slaveinterface.h:99
KIO::Slave
Definition: slave.h:49
KIO::Slave::slaveDied
void slaveDied(KIO::Slave *slave)
KUrl
QObject
timeout
int timeout
kurl.h
deref
void deref()
ref
void ref()
config
KSharedConfigPtr config()
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
KIO_SLAVE_EXPORT
#define KIO_SLAVE_EXPORT
Definition: slave.h:25
slaveinterface.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal