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

kget

jobqueue.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002 
00003    Copyright (C) 2005 Dario Massarin <nekkar@libero.it>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 */
00010 
00011 
00012 #ifndef _JOBQUEUE_H
00013 #define _JOBQUEUE_H
00014 
00026 #include <QList>
00027 #include "kget_export.h"
00028 
00029 class Job;
00030 class Scheduler;
00031 
00032 class KGET_EXPORT JobQueue
00033 {
00034     public:
00035         enum Status {Running, Stopped};
00036         typedef QList<Job *>::iterator iterator;
00037 
00038         JobQueue(Scheduler * scheduler);
00039         virtual ~JobQueue();
00040 
00046         virtual void setStatus(Status queueStatus);
00047 
00051         Status status() const   {return m_status;}
00052 
00056         iterator begin()    {return m_jobs.begin();}
00057 
00061         iterator end()      {return m_jobs.end();}
00062 
00066         Job * last()        {return m_jobs.last();}
00067 
00071         int size() const    {return m_jobs.size();}
00072 
00079         int indexOf(Job * job) const    {return m_jobs.indexOf(job);}
00080 
00084         Job * operator[] (int i) const;
00085 
00089         const QList<Job *> runningJobs();
00090 
00097         void setMaxSimultaneousJobs(int n);
00098 
00103         int maxSimultaneousJobs() const;
00104 
00105     protected:
00111         void append(Job * job);
00112 
00118         void prepend(Job * job);
00119 
00126         void insert(Job * job, Job * after);
00127 
00133         void remove(Job * job);
00134 
00141         void move(Job * job, Job * after);
00142 
00143         Scheduler * scheduler()     {return m_scheduler;}
00144 
00145     private:
00146         QList<Job *> m_jobs;
00147 
00148         int m_maxSimultaneousJobs;
00149 
00150         Scheduler * m_scheduler;
00151         Status m_status;
00152 };
00153 
00154 #endif

kget

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

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal