KIO
scheduler.h
Go to the documentation of this file.
00001 // -*- c++ -*- 00002 /* This file is part of the KDE libraries 00003 Copyright (C) 2000 Stephan Kulow <coolo@kde.org> 00004 Waldo Bastian <bastian@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef _kio_scheduler_h 00023 #define _kio_scheduler_h 00024 00025 #include "kio/job.h" 00026 #include "kio/jobclasses.h" 00027 #include <QtCore/QTimer> 00028 #include <QtCore/QMap> 00029 #include <QtGui/QWidgetList> 00030 #include <sys/types.h> // pid_t 00031 00032 namespace KIO { 00033 00034 class Slave; 00035 class SlaveConfig; 00036 class SessionData; 00037 00038 class SchedulerPrivate; 00110 class KIO_EXPORT Scheduler : public QObject 00111 { 00112 Q_OBJECT 00113 Q_CLASSINFO("D-Bus Interface", "org.kde.KIO.Scheduler") 00114 public: 00121 static void doJob(SimpleJob *job); 00122 00128 #ifndef KDE_NO_DEPRECATED 00129 KDE_DEPRECATED static void scheduleJob(SimpleJob *job); 00130 #endif 00131 00140 static void setJobPriority(SimpleJob *job, int priority); 00141 00146 static void cancelJob(SimpleJob *job); 00147 00153 static void jobFinished(KIO::SimpleJob *job, KIO::Slave *slave); 00154 00166 static void putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url); 00167 00172 static void removeSlaveOnHold(); 00173 00179 static void publishSlaveOnHold(); 00180 00192 static KIO::Slave *getConnectedSlave(const KUrl &url, 00193 const KIO::MetaData &config = MetaData() ); 00194 00211 static bool assignJobToSlave(KIO::Slave *slave, KIO::SimpleJob *job); 00212 00225 static bool disconnectSlave(KIO::Slave *slave); 00226 00233 static void registerWindow(QWidget *wid); 00234 00239 static void unregisterWindow(QObject *wid); 00240 00247 // KDE5: those methods should probably be removed, ugly and only marginally useful 00248 static bool connect( const char *signal, const QObject *receiver, 00249 const char *member); 00250 00251 static bool connect( const QObject* sender, const char* signal, 00252 const QObject* receiver, const char* member ); 00253 00254 static bool disconnect( const QObject* sender, const char* signal, 00255 const QObject* receiver, const char* member ); 00256 00257 bool connect( const QObject *sender, const char *signal, 00258 const char *member ); 00259 00265 static void checkSlaveOnHold(bool b); 00266 00267 static void emitReparseSlaveConfiguration(); 00268 00269 Q_SIGNALS: 00270 void slaveConnected(KIO::Slave *slave); 00271 void slaveError(KIO::Slave *slave, int error, const QString &errorMsg); 00272 00273 // DBUS 00274 Q_SCRIPTABLE void reparseSlaveConfiguration(const QString &); 00275 00276 private: 00277 Q_DISABLE_COPY(Scheduler) 00278 Scheduler(); 00279 ~Scheduler(); 00280 00281 static Scheduler *self(); 00282 00283 Q_PRIVATE_SLOT(schedulerPrivate, void slotSlaveDied(KIO::Slave *slave)) 00284 Q_PRIVATE_SLOT(schedulerPrivate, void slotSlaveStatus(pid_t pid, const QByteArray &protocol, 00285 const QString &host, bool connected)) 00286 00287 // connected to D-Bus signal: 00288 Q_PRIVATE_SLOT(schedulerPrivate, void slotReparseSlaveConfiguration(const QString &, const QDBusMessage&)) 00289 00290 Q_PRIVATE_SLOT(schedulerPrivate, void slotSlaveConnected()) 00291 Q_PRIVATE_SLOT(schedulerPrivate, void slotSlaveError(int error, const QString &errorMsg)) 00292 Q_PRIVATE_SLOT(schedulerPrivate, void slotUnregisterWindow(QObject *)) 00293 private: 00294 friend class SchedulerPrivate; 00295 SchedulerPrivate *const d; 00296 }; 00297 00298 } 00299 #endif
KDE 4.6 API Reference