• 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
scheduler.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
4  Waldo Bastian <bastian@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef _kio_scheduler_h
23 #define _kio_scheduler_h
24 
25 #include "kio/job.h"
26 #include "kio/jobclasses.h"
27 #include <QtCore/QTimer>
28 #include <QtCore/QMap>
29 #include <QtGui/QWidgetList>
30 #include <sys/types.h> // pid_t
31 
32 namespace KIO {
33 
34  class Slave;
35  class SlaveConfig;
36 
37  class SchedulerPrivate;
109  class KIO_EXPORT Scheduler : public QObject
110  {
111  Q_OBJECT
112  Q_CLASSINFO("D-Bus Interface", "org.kde.KIO.Scheduler")
113  public:
120  static void doJob(SimpleJob *job);
121 
128 #ifndef KDE_NO_DEPRECATED
129  KDE_DEPRECATED static void scheduleJob(SimpleJob *job);
130 #endif
131 
140  static void setJobPriority(SimpleJob *job, int priority);
141 
146  static void cancelJob(SimpleJob *job);
147 
153  static void jobFinished(KIO::SimpleJob *job, KIO::Slave *slave);
154 
166  static void putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url);
167 
172  static void removeSlaveOnHold();
173 
179  static void publishSlaveOnHold();
180 
192  static KIO::Slave *getConnectedSlave(const KUrl &url,
193  const KIO::MetaData &config = MetaData() );
194 
211  static bool assignJobToSlave(KIO::Slave *slave, KIO::SimpleJob *job);
212 
225  static bool disconnectSlave(KIO::Slave *slave);
226 
233  static void registerWindow(QWidget *wid);
234 
239  static void unregisterWindow(QObject *wid);
240 
247  // KDE5: those methods should probably be removed, ugly and only marginally useful
248  static bool connect( const char *signal, const QObject *receiver,
249  const char *member);
250 
251  static bool connect( const QObject* sender, const char* signal,
252  const QObject* receiver, const char* member );
253 
254  static bool disconnect( const QObject* sender, const char* signal,
255  const QObject* receiver, const char* member );
256 
257  bool connect( const QObject *sender, const char *signal,
258  const char *member );
259 
265  static void checkSlaveOnHold(bool b);
266 
267  static void emitReparseSlaveConfiguration();
268 
274  static bool isSlaveOnHoldFor(const KUrl& url);
275 
281  static void updateInternalMetaData(SimpleJob* job);
282 
283  Q_SIGNALS:
284  void slaveConnected(KIO::Slave *slave);
285  void slaveError(KIO::Slave *slave, int error, const QString &errorMsg);
286 
287  // DBUS
288  Q_SCRIPTABLE void reparseSlaveConfiguration(const QString &);
289  Q_SCRIPTABLE void slaveOnHoldListChanged();
290 
291  private:
292  Q_DISABLE_COPY(Scheduler)
293  Scheduler();
294  ~Scheduler();
295 
296  static Scheduler *self();
297 
298  Q_PRIVATE_SLOT(d_func(), void slotSlaveDied(KIO::Slave *slave))
299  Q_PRIVATE_SLOT(d_func(), void slotSlaveStatus(pid_t pid, const QByteArray &protocol,
300  const QString &host, bool connected))
301 
302  // connected to D-Bus signal:
303  Q_PRIVATE_SLOT(d_func(), void slotReparseSlaveConfiguration(const QString &, const QDBusMessage&))
304  Q_PRIVATE_SLOT(d_func(), void slotSlaveOnHoldListChanged())
305 
306  Q_PRIVATE_SLOT(d_func(), void slotSlaveConnected())
307  Q_PRIVATE_SLOT(d_func(), void slotSlaveError(int error, const QString &errorMsg))
308  Q_PRIVATE_SLOT(d_func(), void slotUnregisterWindow(QObject *))
309  private:
310  friend class SchedulerPrivate;
311  SchedulerPrivate *const removeMe; // for BC only, KDE5: remove
312  SchedulerPrivate *d_func();
313 };
314 
315 }
316 #endif
QWidget
QByteArray
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:396
KUrl
KIO::Slave
Definition: slave.h:48
config
KSharedConfigPtr config()
QObject
QString
job.h
KIO::Scheduler
The KIO::Scheduler manages io-slaves for the application.
Definition: scheduler.h:109
QDBusMessage
jobclasses.h
KIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:322
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 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