• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • core
jobqueue.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2005 Dario Massarin <nekkar@libero.it>
4 
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.
9 */
10 
11 
12 #ifndef JOBQUEUE_H
13 #define JOBQUEUE_H
14 
26 #include <QList>
27 #include "../kget_export.h"
28 
29 class Job;
30 class Scheduler;
31 
32 class KGET_EXPORT JobQueue : public QObject
33 {
34  Q_OBJECT
35  public:
36  enum Status {Running, Stopped};
37  typedef QList<Job *>::iterator iterator;
38 
39  JobQueue(Scheduler * parent);
40  virtual ~JobQueue();
41 
47  virtual void setStatus(Status queueStatus);
48 
52  Status status() const {return m_status;}
53 
57  iterator begin() {return m_jobs.begin();}
58 
62  iterator end() {return m_jobs.end();}
63 
67  Job * last() {return m_jobs.last();}
68 
72  int size() const {return m_jobs.size();}
73 
80  int indexOf(Job * job) const {return m_jobs.indexOf(job);}
81 
85  Job * operator[] (int i) const {return m_jobs[i];}
86 
90  const QList<Job *> runningJobs();
91 
99  void setMaxSimultaneousJobs(int n);
100 
105  int maxSimultaneousJobs() const;
106 
107  protected:
113  void append(Job * job);
114 
120  void append(const QList<Job*> &jobs);
121 
127  void prepend(Job * job);
128 
135  void insert(Job * job, Job * after);
136 
142  void remove(Job * job);
143 
149  void remove(const QList<Job*> jobs);
150 
157  void move(Job * job, Job * after);
158 
159  Scheduler * scheduler() {return m_scheduler;}
160 
161  private:
162  QList<Job *> m_jobs;
163 
164  int m_maxSimultaneousJobs;
165 
166  Scheduler * m_scheduler;
167  Status m_status;
168 };
169 
170 #endif
JobQueue::scheduler
Scheduler * scheduler()
Definition: jobqueue.h:159
Scheduler
Scheduler class: what handle all the jobs in kget.
Definition: scheduler.h:32
JobQueue::size
int size() const
Definition: jobqueue.h:72
Job
Definition: job.h:35
QObject
JobQueue::Status
Status
Definition: jobqueue.h:36
JobQueue::begin
iterator begin()
Definition: jobqueue.h:57
JobQueue::status
Status status() const
Definition: jobqueue.h:52
JobQueue
Definition: jobqueue.h:32
JobQueue::end
iterator end()
Definition: jobqueue.h:62
KGET_EXPORT
#define KGET_EXPORT
Definition: kget_export.h:24
JobQueue::indexOf
int indexOf(Job *job) const
Definition: jobqueue.h:80
JobQueue::last
Job * last()
Definition: jobqueue.h:67
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

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