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

kdeprint

  • kdeprint
kmmanager.h
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <kdeprint@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 KMMANAGER_H
21 #define KMMANAGER_H
22 
23 #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ )
24 #warning internal header, do not use except if you are a KDEPrint developer
25 #endif
26 
27 #include <kdeprint/kmprinter.h>
28 
29 #include <tqobject.h>
30 #include <tqstring.h>
31 #include <tqptrlist.h>
32 
33 class DrMain;
34 class KMDBEntry;
35 class KMVirtualManager;
36 class KMSpecialManager;
37 class TQWidget;
38 class KActionCollection;
39 class PrinterFilter;
40 
48 class KDEPRINT_EXPORT KMManager : public TQObject
49 {
50  Q_OBJECT
51 
52 friend class KMVirtualManager;
53 friend class KMSpecialManager;
54 friend class KMFactory;
55 
56 public:
57  enum PrinterOperations {
58  PrinterEnabling = 0x01,
59  PrinterCreation = 0x02,
60  PrinterDefault = 0x04,
61  PrinterTesting = 0x08,
62  PrinterConfigure = 0x10,
63  PrinterRemoval = 0x20,
64  PrinterAll = 0xFF
65  };
66  enum ServerOperations {
67  ServerRestarting = 0x1,
68  ServerConfigure = 0x2,
69  ServerAll = 0xF
70  };
71 
72  KMManager(TQObject *parent = 0, const char *name = 0);
73  virtual ~KMManager();
74 
75  static KMManager* self();
76 
77  // error management functions
78  TQString errorMsg() const { return m_errormsg; }
79  void setErrorMsg(const TQString& s) { m_errormsg = s; }
80 
81  // support management ?
82  bool hasManagement() const { return m_hasmanagement; }
83 
84  // printer management functions
85  virtual bool createPrinter(KMPrinter *p);
86  virtual bool removePrinter(KMPrinter *p);
87  virtual bool enablePrinter(KMPrinter *p, bool on);
88  virtual bool startPrinter(KMPrinter *p, bool on);
89  virtual bool completePrinter(KMPrinter *p);
90  virtual bool completePrinterShort(KMPrinter *p);
91  virtual bool setDefaultPrinter(KMPrinter *p);
92  virtual bool testPrinter(KMPrinter *p);
93  bool upPrinter(KMPrinter *p, bool state);
94  bool modifyPrinter(KMPrinter *oldp, KMPrinter *newp);
95  bool removePrinter(const TQString& name);
96  bool enablePrinter(const TQString& name, bool state);
97  bool startPrinter(const TQString& name, bool state);
98  bool completePrinter(const TQString& name);
99  bool setDefaultPrinter(const TQString& name);
100  int printerOperationMask() const { return m_printeroperationmask; }
101  int addPrinterWizard(TQWidget *parent = 0);
102 
103  // special printer management functions
104  bool createSpecialPrinter(KMPrinter *p);
105  bool removeSpecialPrinter(KMPrinter *p);
106 
107  // printer listing functions
108  KMPrinter* findPrinter(const TQString& name);
109  TQPtrList<KMPrinter>* printerList(bool reload = true);
110  TQPtrList<KMPrinter>* printerListComplete(bool reload = true);
111  KMPrinter* defaultPrinter();
112  void enableFilter(bool on);
113  bool isFilterEnabled() const;
114 
115  // driver DB functions
116  virtual TQString driverDbCreationProgram();
117  virtual TQString driverDirectory();
118 
119  // driver functions
120  virtual DrMain* loadPrinterDriver(KMPrinter *p, bool config = false);
121  virtual DrMain* loadDbDriver(KMDBEntry *entry);
122  virtual DrMain* loadFileDriver(const TQString& filename);
123  DrMain* loadDriver(KMPrinter *p, bool config = false);
124  virtual bool savePrinterDriver(KMPrinter *p, DrMain *d);
125  virtual bool validateDbDriver(KMDBEntry *entry);
126 
127  // configuration functions
128  bool invokeOptionsDialog(TQWidget *parent = 0);
129  virtual TQString stateInformation();
130 
131  // server functions
132  int serverOperationMask() const { return m_serveroperationmask; }
133  virtual bool restartServer();
134  virtual bool configureServer(TQWidget *parent = 0);
135  virtual TQStringList detectLocalPrinters();
136 
137  // additional actions (for print manager)
138  virtual void createPluginActions(KActionCollection*);
139  virtual void validatePluginActions(KActionCollection*, KMPrinter*);
140 
141  // utility function
142  void checkUpdatePossible();
143 
144 signals:
145  void updatePossible(bool);
146  void printerListUpdated();
147 
148 protected:
149  // the real printer listing job is done here
150  virtual void listPrinters();
151 
152  // utility functions
153  void addPrinter(KMPrinter *p); // in any case, the pointer given MUST not be used after
154  // calling this function. Useful when listing printers.
155  void setHardDefault(KMPrinter*);
156  void setSoftDefault(KMPrinter*);
157  KMPrinter* softDefault() const;
158  KMPrinter* hardDefault() const;
159  // this function uncompress the given file (or does nothing
160  // if the file is not compressed). Returns wether the file was
161  // compressed or not.
162  bool uncompressFile(const TQString& srcname, TQString& destname);
163  bool notImplemented();
164  void setHasManagement(bool on) { m_hasmanagement = on; }
165  void setPrinterOperationMask(int m) { m_printeroperationmask = m; }
166  void setServerOperationMask(int m) { m_serveroperationmask = m; }
167  TQString testPage();
168  void discardAllPrinters(bool);
169  void setUpdatePossible( bool );
170  virtual void checkUpdatePossibleInternal();
171 
172 protected:
173  QString m_errormsg;
174  KMPrinterList m_printers, m_fprinters; // filtered printers
175  bool m_hasmanagement;
176  int m_printeroperationmask;
177  int m_serveroperationmask;
178  KMSpecialManager *m_specialmgr;
179  KMVirtualManager *m_virtualmgr;
180  PrinterFilter *m_printerfilter;
181  bool m_updatepossible;
182 };
183 
184 #endif

kdeprint

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

kdeprint

Skip menu "kdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeprint by doxygen 1.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |