• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. The KDE Frameworks
  3. KIO
  • KDE Home
  • Contact Us

Quick Links

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

Class Picker

About

Resource and network access abstraction

Maintainer
David Faure
Supported platforms
FreeBSD, Linux, MacOSX, Windows
Community
IRC: #kde-devel on Freenode
Mailing list: kde-frameworks-devel
Use with CMake
find_package(KF5KIO)
target_link_libraries(yourapp KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM)
Use with QMake
QT += KIOCore KIOFileWidgets KIOWidgets KNTLM 
Clone
git clone git://anongit.kde.org/kio.git
Browse source
KIO on cgit.kde.org

KIO

  • frameworks
  • frameworks
  • kio
  • src
  • core
slaveinterface.h
1 /* This file is part of the KDE project
2  Copyright (C) 2000 David Faure <[email protected]>
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 <qplatformdefs.h>
24 
25 #include <QObject>
26 #include <QHostInfo>
27 
28 #include <kio/global.h>
29 #include <kio/udsentry.h>
30 #include <kio/authinfo.h>
31 
32 class QUrl;
33 
34 namespace KIO
35 {
36 
37 class Connection;
38 // better there is one ...
39 class 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 #if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 0)
55  INF_GETTING_FILE,
56 #else
57  INF_GETTING_FILE_DEPRECATED_DO_NOT_USE,
58 #endif
59  INF_UNUSED = 25,
60  INF_INFOMESSAGE,
61  INF_META_DATA,
62  INF_NETWORK_STATUS,
63  INF_MESSAGEBOX,
64  INF_POSITION
65  // add new ones here once a release is done, to avoid breaking binary compatibility
66 };
67 
71 enum Message {
72  MSG_DATA = 100,
73  MSG_DATA_REQ,
74  MSG_ERROR,
75  MSG_CONNECTED,
76  MSG_FINISHED,
77  MSG_STAT_ENTRY, // 105
78  MSG_LIST_ENTRIES,
79  MSG_RENAMED,
80  MSG_RESUME,
81 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 45)
82  MSG_SLAVE_STATUS,
83 #else
84  MSG_SLAVE_STATUS_DEPRECATED_DO_NOT_USE,
85 #endif
86  MSG_SLAVE_ACK, // 110
87  MSG_NET_REQUEST,
88  MSG_NET_DROP,
89  MSG_NEED_SUBURL_DATA,
90  MSG_CANRESUME,
91 #if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 1)
92  MSG_AUTH_KEY,
93  MSG_DEL_AUTH_KEY,
94 #else
95  MSG_AUTH_KEY_DEPRECATED_DO_NOT_USE,
96  MSG_DEL_AUTH_KEY_DEPRECATED_DO_NOT_USE,
97 #endif
98  MSG_OPENED,
99  MSG_WRITTEN,
100  MSG_HOST_INFO_REQ,
101  MSG_PRIVILEGE_EXEC,
102  MSG_SLAVE_STATUS_V2
103  // add new ones here once a release is done, to avoid breaking binary compatibility
104 };
105 
115 class KIOCORE_EXPORT SlaveInterface : public QObject
116 {
117  Q_OBJECT
118 
119 protected:
120  SlaveInterface(SlaveInterfacePrivate &dd, QObject *parent = nullptr);
121 public:
122 
123  virtual ~SlaveInterface();
124 
125 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
126  // TODO KF6: remove these methods, Connection isn't an exported class
127  KIOCORE_DEPRECATED_VERSION(5, 0, "Do not use")
128  void setConnection(Connection *connection);
129  KIOCORE_DEPRECATED_VERSION(5, 0, "Do not use")
130  Connection *connection() const;
131 #endif
132 
133  // Send our answer to the MSG_RESUME (canResume) request
134  // (to tell the "put" job whether to resume or not)
135  void sendResumeAnswer(bool resume);
136 
142  void sendMessageBoxAnswer(int result);
143 
144  void setOffset(KIO::filesize_t offset);
145  KIO::filesize_t offset() const;
146 
147 Q_SIGNALS:
149  // Messages sent by the slave
151 
152  void data(const QByteArray &);
153  void dataReq();
154  void error(int, const QString &);
155  void connected();
156  void finished();
157  void slaveStatus(qint64, const QByteArray &, const QString &, bool);
158  void listEntries(const KIO::UDSEntryList &);
159  void statEntry(const KIO::UDSEntry &);
160  void needSubUrlData();
161 
162  void canResume(KIO::filesize_t);
163 
164  void open();
165  void written(KIO::filesize_t);
166  void close();
167 
168  void privilegeOperationRequested();
169 
171  // Info sent by the slave
173  void metaData(const KIO::MetaData &);
174  void totalSize(KIO::filesize_t);
175  void processedSize(KIO::filesize_t);
176  void redirection(const QUrl &);
177  void position(KIO::filesize_t);
178 
179  void speed(unsigned long);
180  void errorPage();
181  void mimeType(const QString &);
182  void warning(const QString &);
183  void infoMessage(const QString &);
184  //void connectFinished(); //it does not get emitted anywhere
185 
186 protected:
188  // Dispatching
190 
191  virtual bool dispatch();
192  virtual bool dispatch(int _cmd, const QByteArray &data);
193 
194  void messageBox(int type, const QString &text, const QString &caption,
195  const QString &buttonYes, const QString &buttonNo);
196 
197  void messageBox(int type, const QString &text, const QString &caption,
198  const QString &buttonYes, const QString &buttonNo,
199  const QString &dontAskAgainName);
200 
201  // I need to identify the slaves
202  void requestNetwork(const QString &, const QString &);
203  void dropNetwork(const QString &, const QString &);
204 
205 protected Q_SLOTS:
206  void calcSpeed();
207 protected:
208  SlaveInterfacePrivate *const d_ptr;
209  Q_DECLARE_PRIVATE(SlaveInterface)
210 private:
211  Q_PRIVATE_SLOT(d_func(), void slotHostInfo(QHostInfo))
212 };
213 
214 }
215 
216 #endif
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:51
QByteArray
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:88
KIO::MSG_DEL_AUTH_KEY
Definition: slaveinterface.h:93
KIO
A namespace for KIO globals.
Definition: authinfo.h:34
KIO::SlaveInterface
There are two classes that specifies the protocol between application ( KIO::Job) and kioslave...
Definition: slaveinterface.h:115
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: metadata.h:34
KIO::MSG_SLAVE_STATUS
Definition: slaveinterface.h:82
KIO::Info
Info
Identifiers for KIO informational messages.
Definition: slaveinterface.h:46
QObject
KIO::MSG_RENAMED
unused
Definition: slaveinterface.h:79
QString
QList< UDSEntry >
QUrl
KIO::Message
Message
Identifiers for KIO data messages.
Definition: slaveinterface.h:71
KIO::MSG_AUTH_KEY
Definition: slaveinterface.h:92
KIO::INF_UNUSED
now unused
Definition: slaveinterface.h:59
KIO::open
KIOCORE_EXPORT FileJob * open(const QUrl &url, QIODevice::OpenMode mode)
Open ( random access I/O )
Definition: filejob.cpp:221
KIO::INF_GETTING_FILE
Definition: slaveinterface.h:55
QHostInfo
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Dec 6 2019 03:50:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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