• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
kmjobmanager.h
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License version 2 as published by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  **/
19 
20 #ifndef KMJOBMANAGER_H
21 #define KMJOBMANAGER_H
22 
23 #if !defined( _TDEPRINT_COMPILE ) && defined( __GNUC__ )
24 #warning internal header, do not use except if you are a TDEPrint developer
25 #endif
26 
27 #include <tqobject.h>
28 #include <tqptrlist.h>
29 #include <tqdict.h>
30 #include <tqvaluelist.h>
31 
32 #include <tdelibs_export.h>
33 
34 class KMJob;
35 class KMThreadJob;
36 class TDEActionCollection;
37 class TDEAction;
38 
46 class TDEPRINT_EXPORT KMJobManager : public TQObject
47 {
48  Q_OBJECT
49 
50 public:
51  enum JobType { ActiveJobs = 0, CompletedJobs = 1 };
52  struct JobFilter
53  {
54  JobFilter() { m_type[0] = m_type[1] = 0; m_isspecial = false; }
55  int m_type[2];
56  bool m_isspecial;
57  };
58 
59  KMJobManager(TQObject *parent = 0, const char *name = 0);
60  virtual ~KMJobManager();
61 
62  static KMJobManager* self();
63 
64  void addPrinter(const TQString& pr, JobType type = ActiveJobs, bool isSpecial = false);
65  void removePrinter(const TQString& pr, JobType type = ActiveJobs);
66  void clearFilter();
67  TQDict<JobFilter>* filter();
68  int limit();
69  void setLimit(int val);
70 
71  //KMJob* findJob(int ID);
72  KMJob* findJob(const TQString& uri);
73  //bool sendCommand(int ID, int action, const TQString& arg = TQString::null);
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);
77  void addJob(KMJob*);
78  KMThreadJob* threadJob();
79 
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>&);
84 
85 protected:
86  void discardAllJobs();
87  void removeDiscardedJobs();
88 
89 protected:
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);
93 
94 protected:
95  TQPtrList<KMJob> m_jobs;
96  TQDict<JobFilter> m_filter;
97  KMThreadJob *m_threadjob;
98 };
99 
100 inline TQDict<KMJobManager::JobFilter>* KMJobManager::filter()
101 { return &m_filter; }
102 
103 inline void KMJobManager::clearFilter()
104 { m_filter.clear(); }
105 
106 inline KMThreadJob* KMJobManager::threadJob()
107 { return m_threadjob; }
108 
109 #endif

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.