20 #ifndef KMJOBMANAGER_H
21 #define KMJOBMANAGER_H
23 #if !defined( _TDEPRINT_COMPILE ) && defined( __GNUC__ )
24 #warning internal header, do not use except if you are a TDEPrint developer
28 #include <tqptrlist.h>
30 #include <tqvaluelist.h>
32 #include <tdelibs_export.h>
36 class TDEActionCollection;
46 class TDEPRINT_EXPORT KMJobManager :
public TQObject
51 enum JobType { ActiveJobs = 0, CompletedJobs = 1 };
54 JobFilter() { m_type[0] = m_type[1] = 0; m_isspecial =
false; }
59 KMJobManager(TQObject *parent = 0,
const char *name = 0);
60 virtual ~KMJobManager();
62 static KMJobManager*
self();
64 void addPrinter(
const TQString& pr, JobType type = ActiveJobs,
bool isSpecial =
false);
65 void removePrinter(
const TQString& pr, JobType type = ActiveJobs);
67 TQDict<JobFilter>* filter();
69 void setLimit(
int val);
72 KMJob* findJob(
const TQString& uri);
74 bool sendCommand(
const TQString& uri,
int action,
const TQString& arg = TQString::null);
75 bool sendCommand(
const TQPtrList<KMJob>& jobs,
int action,
const TQString& arg = TQString::null);
76 const TQPtrList<KMJob>& jobList(
bool reload =
true);
78 KMThreadJob* threadJob();
80 virtual int actions();
81 virtual TQValueList<TDEAction*> createPluginActions(TDEActionCollection*);
82 virtual void validatePluginActions(TDEActionCollection*,
const TQPtrList<KMJob>&);
83 virtual bool doPluginAction(
int,
const TQPtrList<KMJob>&);
86 void discardAllJobs();
87 void removeDiscardedJobs();
90 virtual bool listJobs(
const TQString& prname, JobType type,
int limit = 0);
91 virtual bool sendCommandSystemJob(
const TQPtrList<KMJob>& jobs,
int action,
const TQString& arg = TQString::null);
92 bool sendCommandThreadJob(
const TQPtrList<KMJob>& jobs,
int action,
const TQString& arg = TQString::null);
95 TQPtrList<KMJob> m_jobs;
96 TQDict<JobFilter> m_filter;
97 KMThreadJob *m_threadjob;
100 inline TQDict<KMJobManager::JobFilter>* KMJobManager::filter()
101 {
return &m_filter; }
103 inline void KMJobManager::clearFilter()
104 { m_filter.clear(); }
106 inline KMThreadJob* KMJobManager::threadJob()
107 {
return m_threadjob; }