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

KIO

  • kio
  • kio
slaveinterface.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2000 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __kio_slaveinterface_h
21#define __kio_slaveinterface_h
22
23#include <unistd.h>
24#include <sys/types.h>
25
26#include <QtCore/QObject>
27#include <QtNetwork/QHostInfo>
28
29#include <kio/global.h>
30#include <kio/udsentry.h>
31#include <kio/authinfo.h>
32
33class KUrl;
34
35namespace KIO {
36
37class Connection;
38// better there is one ...
39class SlaveInterfacePrivate;
40
41 // Definition of enum Command has been moved to global.h
42
46 enum Info {
47 INF_TOTAL_SIZE = 10,
48 INF_PROCESSED_SIZE = 11,
49 INF_SPEED,
50 INF_REDIRECTION = 20,
51 INF_MIME_TYPE = 21,
52 INF_ERROR_PAGE = 22,
53 INF_WARNING = 23,
54 INF_GETTING_FILE, // Deprecated
55 INF_UNUSED = 25, // now unused
56 INF_INFOMESSAGE,
57 INF_META_DATA,
58 INF_NETWORK_STATUS,
59 INF_MESSAGEBOX,
60 INF_POSITION
61 // add new ones here once a release is done, to avoid breaking binary compatibility
62 };
63
67 enum Message {
68 MSG_DATA = 100,
69 MSG_DATA_REQ,
70 MSG_ERROR,
71 MSG_CONNECTED,
72 MSG_FINISHED,
73 MSG_STAT_ENTRY, // 105
74 MSG_LIST_ENTRIES,
75 MSG_RENAMED, // unused
76 MSG_RESUME,
77 MSG_SLAVE_STATUS,
78 MSG_SLAVE_ACK, // 110
79 MSG_NET_REQUEST,
80 MSG_NET_DROP,
81 MSG_NEED_SUBURL_DATA,
82 MSG_CANRESUME,
83 MSG_AUTH_KEY, // 115 // deprecated.
84 MSG_DEL_AUTH_KEY, // deprecated.
85 MSG_OPENED,
86 MSG_WRITTEN,
87 MSG_HOST_INFO_REQ
88 // add new ones here once a release is done, to avoid breaking binary compatibility
89 };
90
98class KIO_EXPORT SlaveInterface : public QObject
99{
100 Q_OBJECT
101
102protected:
103 SlaveInterface(SlaveInterfacePrivate &dd, QObject *parent = 0);
104public:
105
106 virtual ~SlaveInterface();
107
108 void setConnection( Connection* connection );
109 Connection *connection() const;
110
111 // Send our answer to the MSG_RESUME (canResume) request
112 // (to tell the "put" job whether to resume or not)
113 void sendResumeAnswer( bool resume );
114
120 void sendMessageBoxAnswer(int result);
121
122 void setOffset( KIO::filesize_t offset );
123 KIO::filesize_t offset() const;
124
133 KDE_DEPRECATED QWidget* window() const;
134
142 KDE_DEPRECATED void setWindow(QWidget* window);
143
144Q_SIGNALS:
146 // Messages sent by the slave
148
149 void data( const QByteArray & );
150 void dataReq( );
151 void error( int , const QString & );
152 void connected();
153 void finished();
154 void slaveStatus(pid_t, const QByteArray&, const QString &, bool);
155 void listEntries( const KIO::UDSEntryList& );
156 void statEntry( const KIO::UDSEntry& );
157 void needSubUrlData();
158
159 void canResume( KIO::filesize_t );
160
161 void open();
162 void written( KIO::filesize_t );
163
165 // Info sent by the slave
167 void metaData( const KIO::MetaData & );
168 void totalSize( KIO::filesize_t );
169 void processedSize( KIO::filesize_t );
170 void redirection( const KUrl& );
171 void position( KIO::filesize_t );
172
173 void speed( unsigned long );
174 void errorPage();
175 void mimeType( const QString & );
176 void warning( const QString & );
177 void infoMessage( const QString & );
178 //void connectFinished(); //it does not get emitted anywhere
179
180protected:
182 // Dispatching
184
185 virtual bool dispatch();
186 virtual bool dispatch( int _cmd, const QByteArray &data );
187
188 void messageBox( int type, const QString &text, const QString &caption,
189 const QString &buttonYes, const QString &buttonNo );
190
191 void messageBox( int type, const QString &text, const QString &caption,
192 const QString &buttonYes, const QString &buttonNo,
193 const QString &dontAskAgainName );
194
195 // I need to identify the slaves
196 void requestNetwork( const QString &, const QString &);
197 void dropNetwork( const QString &, const QString &);
198
199protected Q_SLOTS:
200 void calcSpeed();
201protected:
202 SlaveInterfacePrivate* const d_ptr;
203 Q_DECLARE_PRIVATE(SlaveInterface)
204private:
205 Q_PRIVATE_SLOT(d_func(), void slotHostInfo(QHostInfo))
206};
207
208}
209
210// moved to udesentry.cpp!!!
211// KIO_EXPORT QDataStream &operator <<(QDataStream &s, const KIO::UDSEntry &e );
212// KIO_EXPORT QDataStream &operator >>(QDataStream &s, KIO::UDSEntry &e );
213
214#endif
authinfo.h
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:397
KIO::SlaveInterfacePrivate
Definition: slaveinterface_p.h:33
KIO::SlaveInterface
There are two classes that specifies the protocol between application ( KIO::Job) and kioslave.
Definition: slaveinterface.h:99
KIO::SlaveInterface::written
void written(KIO::filesize_t)
KIO::SlaveInterface::redirection
void redirection(const KUrl &)
KIO::SlaveInterface::infoMessage
void infoMessage(const QString &)
KIO::SlaveInterface::totalSize
void totalSize(KIO::filesize_t)
KIO::SlaveInterface::d_ptr
SlaveInterfacePrivate *const d_ptr
Definition: slaveinterface.h:202
KIO::SlaveInterface::position
void position(KIO::filesize_t)
KIO::SlaveInterface::connected
void connected()
KIO::SlaveInterface::slaveStatus
void slaveStatus(pid_t, const QByteArray &, const QString &, bool)
KIO::SlaveInterface::listEntries
void listEntries(const KIO::UDSEntryList &)
KIO::SlaveInterface::warning
void warning(const QString &)
KIO::SlaveInterface::finished
void finished()
KIO::SlaveInterface::statEntry
void statEntry(const KIO::UDSEntry &)
KIO::SlaveInterface::speed
void speed(unsigned long)
KIO::SlaveInterface::dataReq
void dataReq()
KIO::SlaveInterface::needSubUrlData
void needSubUrlData()
KIO::SlaveInterface::metaData
void metaData(const KIO::MetaData &)
KIO::SlaveInterface::canResume
void canResume(KIO::filesize_t)
KIO::SlaveInterface::open
void open()
KIO::SlaveInterface::data
void data(const QByteArray &)
KIO::SlaveInterface::processedSize
void processedSize(KIO::filesize_t)
KIO::SlaveInterface::mimeType
void mimeType(const QString &)
KIO::SlaveInterface::error
void error(int, const QString &)
KIO::SlaveInterface::errorPage
void errorPage()
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:59
KUrl
QList< UDSEntry >
QObject
QWidget
global.h
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
KIO::Info
Info
Identifiers for KIO informational messages.
Definition: slaveinterface.h:46
KIO::INF_META_DATA
@ INF_META_DATA
Definition: slaveinterface.h:57
KIO::INF_NETWORK_STATUS
@ INF_NETWORK_STATUS
Definition: slaveinterface.h:58
KIO::INF_MESSAGEBOX
@ INF_MESSAGEBOX
Definition: slaveinterface.h:59
KIO::INF_TOTAL_SIZE
@ INF_TOTAL_SIZE
Definition: slaveinterface.h:47
KIO::INF_REDIRECTION
@ INF_REDIRECTION
Definition: slaveinterface.h:50
KIO::INF_MIME_TYPE
@ INF_MIME_TYPE
Definition: slaveinterface.h:51
KIO::INF_SPEED
@ INF_SPEED
Definition: slaveinterface.h:49
KIO::INF_ERROR_PAGE
@ INF_ERROR_PAGE
Definition: slaveinterface.h:52
KIO::INF_WARNING
@ INF_WARNING
Definition: slaveinterface.h:53
KIO::INF_PROCESSED_SIZE
@ INF_PROCESSED_SIZE
Definition: slaveinterface.h:48
KIO::INF_INFOMESSAGE
@ INF_INFOMESSAGE
Definition: slaveinterface.h:56
KIO::INF_UNUSED
@ INF_UNUSED
Definition: slaveinterface.h:55
KIO::INF_POSITION
@ INF_POSITION
Definition: slaveinterface.h:60
KIO::INF_GETTING_FILE
@ INF_GETTING_FILE
Definition: slaveinterface.h:54
KIO::Message
Message
Identifiers for KIO data messages.
Definition: slaveinterface.h:67
KIO::MSG_RESUME
@ MSG_RESUME
Definition: slaveinterface.h:76
KIO::MSG_CANRESUME
@ MSG_CANRESUME
Definition: slaveinterface.h:82
KIO::MSG_STAT_ENTRY
@ MSG_STAT_ENTRY
Definition: slaveinterface.h:73
KIO::MSG_SLAVE_STATUS
@ MSG_SLAVE_STATUS
Definition: slaveinterface.h:77
KIO::MSG_SLAVE_ACK
@ MSG_SLAVE_ACK
Definition: slaveinterface.h:78
KIO::MSG_FINISHED
@ MSG_FINISHED
Definition: slaveinterface.h:72
KIO::MSG_HOST_INFO_REQ
@ MSG_HOST_INFO_REQ
Definition: slaveinterface.h:87
KIO::MSG_ERROR
@ MSG_ERROR
Definition: slaveinterface.h:70
KIO::MSG_LIST_ENTRIES
@ MSG_LIST_ENTRIES
Definition: slaveinterface.h:74
KIO::MSG_DATA
@ MSG_DATA
Definition: slaveinterface.h:68
KIO::MSG_NET_REQUEST
@ MSG_NET_REQUEST
Definition: slaveinterface.h:79
KIO::MSG_CONNECTED
@ MSG_CONNECTED
Definition: slaveinterface.h:71
KIO::MSG_DEL_AUTH_KEY
@ MSG_DEL_AUTH_KEY
Definition: slaveinterface.h:84
KIO::MSG_NEED_SUBURL_DATA
@ MSG_NEED_SUBURL_DATA
Definition: slaveinterface.h:81
KIO::MSG_RENAMED
@ MSG_RENAMED
Definition: slaveinterface.h:75
KIO::MSG_AUTH_KEY
@ MSG_AUTH_KEY
Definition: slaveinterface.h:83
KIO::MSG_DATA_REQ
@ MSG_DATA_REQ
Definition: slaveinterface.h:69
KIO::MSG_NET_DROP
@ MSG_NET_DROP
Definition: slaveinterface.h:80
KIO::MSG_WRITTEN
@ MSG_WRITTEN
Definition: slaveinterface.h:86
KIO::MSG_OPENED
@ MSG_OPENED
Definition: slaveinterface.h:85
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
udsentry.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