• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.11.5 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 
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon May 5 2014 18:13:46 by doxygen 1.8.3.1 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.11.5 API Reference

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