1 /***************************************************************************
6 * begin : Tue Jan 29 2002
7 * copyright : (C) 2002 by Patrick Charbonnier
8 * email : pch@freeshell.org
10 ****************************************************************************/
12 /***************************************************************************
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 ***************************************************************************/
32 #include <qvaluestack.h>
33 #include <qwaitcondition.h>
46 class Slave
:public QObject
, public QThread
52 RETR
, RETR_CACHE
, PAUSE
, RESTART
, ABORT
, DELAY
,
53 SCHEDULE
, REMOVE
, KILL
, NOOP
58 SLV_TOTAL_SIZE
, SLV_PROGRESS_SIZE
, SLV_PROGRESS_SPEED
,
59 SLV_CAN_RESUME
, SLV_CONNECTED
,
61 SLV_RESUMED
, SLV_PAUSED
, SLV_ERROR
, SLV_BROKEN
, SLV_SCHEDULED
, SLV_DELAYED
,
62 SLV_FINISHED
, SLV_INFO
, SLV_REMOVED
, SLV_KILLED
, SLV_NOTINCACHE
66 Slave(Transfer
* _parent
, const KURL
& _src
, const KURL
& _dest
);
68 void Op(SlaveCommand _cmd
);
74 void slotCanceled(KIO::Job
*);
75 void slotConnected(KIO::Job
*);
76 void slotResult(KIO::Job
*);
77 void slotTotalSize(KIO::Job
*, KIO::filesize_t
);
78 void slotProcessedSize(KIO::Job
*, KIO::filesize_t
);
79 void slotSpeed(KIO::Job
*, unsigned long);
80 void slotInfoMessage(KIO::Job
*, const QString
&);
85 void PostMessage(SlaveResult _event
, unsigned long _data
= 0L);
86 void PostMessage(SlaveResult _event
, const QString
& _msg
);
87 void InfoMessage(const QString
& _msg
);
94 Slave::SlaveCommand
fetch_cmd();
97 QValueStack
< SlaveCommand
> stack
;
98 QWaitCondition worker
;
100 KIO::GetFileJob
* copyjob
;