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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • 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 
33 class KUrl;
34 
35 namespace KIO {
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  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 
98 class KIO_EXPORT SlaveInterface : public QObject
99 {
100  Q_OBJECT
101 
102 protected:
103  SlaveInterface(SlaveInterfacePrivate &dd, QObject *parent = 0);
104 public:
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 
144 Q_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 
180 protected:
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 
199 protected Q_SLOTS:
200  void calcSpeed();
201 protected:
202  SlaveInterfacePrivate* const d_ptr;
203  Q_DECLARE_PRIVATE(SlaveInterface)
204 private:
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
caption
QString caption()
QWidget
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
KIO::INF_NETWORK_STATUS
Definition: slaveinterface.h:58
KIO::INF_INFOMESSAGE
Definition: slaveinterface.h:56
KIO::SlaveInterface::d_ptr
SlaveInterfacePrivate *const d_ptr
Definition: slaveinterface.h:202
KIO::INF_PROCESSED_SIZE
Definition: slaveinterface.h:48
KIO::INF_META_DATA
Definition: slaveinterface.h:57
QByteArray
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:58
KIO::MSG_DEL_AUTH_KEY
Definition: slaveinterface.h:84
KIO::SlaveInterface
There are two classes that specifies the protocol between application ( KIO::Job) and kioslave...
Definition: slaveinterface.h:98
KIO::MSG_CONNECTED
Definition: slaveinterface.h:71
global.h
KIO::MSG_DATA
Definition: slaveinterface.h:68
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:396
KIO::MSG_SLAVE_STATUS
Definition: slaveinterface.h:77
KUrl
KIO::MSG_FINISHED
Definition: slaveinterface.h:72
KIO::MSG_RESUME
Definition: slaveinterface.h:76
KIO::SlaveInterfacePrivate
Definition: slaveinterface_p.h:32
KIO::Info
Info
Identifiers for KIO informational messages.
Definition: slaveinterface.h:46
KIO::MSG_LIST_ENTRIES
Definition: slaveinterface.h:74
KIO::MSG_NET_DROP
Definition: slaveinterface.h:80
QObject
KIO::open
FileJob * open(const KUrl &url, QIODevice::OpenMode mode)
Open ( random access I/O )
Definition: filejob.cpp:211
KIO::MSG_NEED_SUBURL_DATA
Definition: slaveinterface.h:81
KIO::MSG_RENAMED
Definition: slaveinterface.h:75
KIO::MSG_STAT_ENTRY
Definition: slaveinterface.h:73
KIO::MSG_NET_REQUEST
Definition: slaveinterface.h:79
QString
QList< UDSEntry >
authinfo.h
KIO::INF_TOTAL_SIZE
Definition: slaveinterface.h:47
KIO::Message
Message
Identifiers for KIO data messages.
Definition: slaveinterface.h:67
KIO::INF_WARNING
Definition: slaveinterface.h:53
KIO::MSG_AUTH_KEY
Definition: slaveinterface.h:83
KIO::INF_POSITION
Definition: slaveinterface.h:60
KIO::INF_SPEED
Definition: slaveinterface.h:49
KIO::INF_MESSAGEBOX
Definition: slaveinterface.h:59
KIO::INF_REDIRECTION
Definition: slaveinterface.h:50
KIO::MSG_DATA_REQ
Definition: slaveinterface.h:69
KIO::MSG_WRITTEN
Definition: slaveinterface.h:86
udsentry.h
KIO::MSG_SLAVE_ACK
Definition: slaveinterface.h:78
KIO::INF_UNUSED
Definition: slaveinterface.h:55
KIO::INF_GETTING_FILE
Definition: slaveinterface.h:54
KIO::MSG_ERROR
Definition: slaveinterface.h:70
KIO::MSG_CANRESUME
Definition: slaveinterface.h:82
KIO::MSG_OPENED
Definition: slaveinterface.h:85
QHostInfo
KIO::MSG_HOST_INFO_REQ
Definition: slaveinterface.h:87
KIO::INF_ERROR_PAGE
Definition: slaveinterface.h:52
KIO::INF_MIME_TYPE
Definition: slaveinterface.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:54 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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