• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.4 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  virtual ~SlaveInterface();
106 
107  void setConnection( Connection* connection );
108  Connection *connection() const;
109 
110  // Send our answer to the MSG_RESUME (canResume) request
111  // (to tell the "put" job whether to resume or not)
112  void sendResumeAnswer( bool resume );
113 
114  void setOffset( KIO::filesize_t offset );
115  KIO::filesize_t offset() const;
116 
124  QWidget* window() const;
125 
132  void setWindow(QWidget* window);
133 
134 Q_SIGNALS:
136  // Messages sent by the slave
138 
139  void data( const QByteArray & );
140  void dataReq( );
141  void error( int , const QString & );
142  void connected();
143  void finished();
144  void slaveStatus(pid_t, const QByteArray&, const QString &, bool);
145  void listEntries( const KIO::UDSEntryList& );
146  void statEntry( const KIO::UDSEntry& );
147  void needSubUrlData();
148 
149  void canResume( KIO::filesize_t );
150 
151  void open();
152  void written( KIO::filesize_t );
153 
155  // Info sent by the slave
157  void metaData( const KIO::MetaData & );
158  void totalSize( KIO::filesize_t );
159  void processedSize( KIO::filesize_t );
160  void redirection( const KUrl& );
161  void position( KIO::filesize_t );
162 
163  void speed( unsigned long );
164  void errorPage();
165  void mimeType( const QString & );
166  void warning( const QString & );
167  void infoMessage( const QString & );
168  //void connectFinished(); //it does not get emitted anywhere
169 
170 protected:
172  // Dispatching
174 
175  virtual bool dispatch();
176  virtual bool dispatch( int _cmd, const QByteArray &data );
177 
178  void messageBox( int type, const QString &text, const QString &caption,
179  const QString &buttonYes, const QString &buttonNo );
180 
181  void messageBox( int type, const QString &text, const QString &caption,
182  const QString &buttonYes, const QString &buttonNo,
183  const QString &dontAskAgainName );
184 
185  // I need to identify the slaves
186  void requestNetwork( const QString &, const QString &);
187  void dropNetwork( const QString &, const QString &);
188 
189 protected Q_SLOTS:
190  void calcSpeed();
191 protected:
192  SlaveInterfacePrivate* const d_ptr;
193  Q_DECLARE_PRIVATE(SlaveInterface)
194 private:
195  Q_PRIVATE_SLOT(d_func(), void slotHostInfo(QHostInfo))
196 };
197 
198 }
199 
200 // moved to udesentry.cpp!!!
201 // KIO_EXPORT QDataStream &operator <<(QDataStream &s, const KIO::UDSEntry &e );
202 // KIO_EXPORT QDataStream &operator >>(QDataStream &s, KIO::UDSEntry &e );
203 
204 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 22:01:52 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.10.4 API Reference

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