kdeprint Library API Documentation

kmjobmanager.h

00001 /* 00002 * This file is part of the KDE libraries 00003 * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License version 2 as published by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 * Boston, MA 02111-1307, USA. 00018 **/ 00019 00020 #ifndef KMJOBMANAGER_H 00021 #define KMJOBMANAGER_H 00022 00023 #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ ) 00024 #warning internal header, do not use except if you are a KDEPrint developer 00025 #endif 00026 00027 #include <qobject.h> 00028 #include <qptrlist.h> 00029 #include <qdict.h> 00030 #include <qvaluelist.h> 00031 00032 class KMJob; 00033 class KMThreadJob; 00034 class KActionCollection; 00035 class KAction; 00036 00044 class KMJobManager : public QObject 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 enum JobType { ActiveJobs = 0, CompletedJobs = 1 }; 00050 struct JobFilter 00051 { 00052 JobFilter() { m_type[0] = m_type[1] = 0; m_isspecial = false; } 00053 int m_type[2]; 00054 bool m_isspecial; 00055 }; 00056 00057 KMJobManager(QObject *parent = 0, const char *name = 0); 00058 virtual ~KMJobManager(); 00059 00060 static KMJobManager* self(); 00061 00062 void addPrinter(const QString& pr, JobType type = ActiveJobs, bool isSpecial = false); 00063 void removePrinter(const QString& pr, JobType type = ActiveJobs); 00064 void clearFilter(); 00065 QDict<JobFilter>* filter(); 00066 int limit(); 00067 void setLimit(int val); 00068 00069 //KMJob* findJob(int ID); 00070 KMJob* findJob(const QString& uri); 00071 //bool sendCommand(int ID, int action, const QString& arg = QString::null); 00072 bool sendCommand(const QString& uri, int action, const QString& arg = QString::null); 00073 bool sendCommand(const QPtrList<KMJob>& jobs, int action, const QString& arg = QString::null); 00074 const QPtrList<KMJob>& jobList(bool reload = true); 00075 void addJob(KMJob*); 00076 KMThreadJob* threadJob(); 00077 00078 virtual int actions(); 00079 virtual QValueList<KAction*> createPluginActions(KActionCollection*); 00080 virtual void validatePluginActions(KActionCollection*, const QPtrList<KMJob>&); 00081 virtual bool doPluginAction(int, const QPtrList<KMJob>&); 00082 00083 protected: 00084 void discardAllJobs(); 00085 void removeDiscardedJobs(); 00086 00087 protected: 00088 virtual bool listJobs(const QString& prname, JobType type, int limit = 0); 00089 virtual bool sendCommandSystemJob(const QPtrList<KMJob>& jobs, int action, const QString& arg = QString::null); 00090 bool sendCommandThreadJob(const QPtrList<KMJob>& jobs, int action, const QString& arg = QString::null); 00091 00092 protected: 00093 QPtrList<KMJob> m_jobs; 00094 QDict<JobFilter> m_filter; 00095 KMThreadJob *m_threadjob; 00096 }; 00097 00098 inline QDict<KMJobManager::JobFilter>* KMJobManager::filter() 00099 { return &m_filter; } 00100 00101 inline void KMJobManager::clearFilter() 00102 { m_filter.clear(); } 00103 00104 inline KMThreadJob* KMJobManager::threadJob() 00105 { return m_threadjob; } 00106 00107 #endif
KDE Logo
This file is part of the documentation for kdeprint Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Aug 30 22:55:49 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003