1 /* This file is part of the KDE project
3 Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
11 #ifndef TRANSFERGROUPSCHEDULER_H
12 #define TRANSFERGROUPSCHEDULER_H
14 #include "core/scheduler.h"
17 * @brief TransferGroupScheduler class: what handle all the transfers in kget.
19 * This class handles all transfers of KGet, it is a modified Scheduler
23 class TransferGroupScheduler
: public Scheduler
28 TransferGroupScheduler();
29 ~TransferGroupScheduler();
31 //JobQueue notifications
32 virtual void jobQueueChangedEvent(JobQueue
* queue
, JobQueue::Status status
);
33 virtual void jobQueueMovedJobEvent(JobQueue
* queue
, Job
* job
);
34 virtual void jobQueueAddedJobEvent(JobQueue
* queue
, Job
* job
);
35 virtual void jobQueueRemovedJobEvent(JobQueue
* queue
, Job
* job
);
38 virtual void jobChangedEvent(Job
* job
, Job::Status status
);
39 virtual void jobChangedEvent(Job
* job
, Job::Policy status
);
42 * Calculates the whole SpeedLimits
44 void calculateSpeedLimits();
47 * Calculates the DownloadLimits
49 void calculateDownloadLimit();
52 * Calculates the DownloadLimits
54 void calculateUploadLimit();
57 * Sets a download limit to the scheduler
58 * @param limit the download limit
60 void setDownloadLimit(int limit
);
63 * @return the transfergroupschedulers download limit
65 int downloadLimit() const {return m_downloadLimit
;}
68 * Sets a upload limit to the scheduler
69 * @param limit the upload limit
71 void setUploadLimit(int limit
);
74 * @return the transfergroupschedulers upload limit
76 int uploadLimit() const {return m_uploadLimit
;}