23 #if !defined( _TDEPRINT_COMPILE ) && defined( __GNUC__ )
24 #warning internal header, do not use except if you are a TDEPrint developer
27 #include <tdeprint/kmprinter.h>
31 #include <tqptrlist.h>
35 class KMVirtualManager;
36 class KMSpecialManager;
38 class TDEActionCollection;
48 class TDEPRINT_EXPORT KMManager :
public TQObject
52 friend class KMVirtualManager;
53 friend class KMSpecialManager;
54 friend class KMFactory;
57 enum PrinterOperations {
58 PrinterEnabling = 0x01,
59 PrinterCreation = 0x02,
60 PrinterDefault = 0x04,
61 PrinterTesting = 0x08,
62 PrinterConfigure = 0x10,
63 PrinterRemoval = 0x20,
66 enum ServerOperations {
67 ServerRestarting = 0x1,
68 ServerConfigure = 0x2,
72 KMManager(TQObject *parent = 0,
const char *name = 0);
75 static KMManager*
self();
78 TQString errorMsg()
const {
return m_errormsg; }
79 void setErrorMsg(
const TQString& s) { m_errormsg = s; }
82 bool hasManagement()
const {
return m_hasmanagement; }
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);
104 bool createSpecialPrinter(KMPrinter *p);
105 bool removeSpecialPrinter(KMPrinter *p);
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;
116 virtual TQString driverDbCreationProgram();
117 virtual TQString driverDirectory();
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);
128 bool invokeOptionsDialog(TQWidget *parent = 0);
129 virtual TQString stateInformation();
132 int serverOperationMask()
const {
return m_serveroperationmask; }
133 virtual bool restartServer();
134 virtual bool configureServer(TQWidget *parent = 0);
135 virtual TQStringList detectLocalPrinters();
138 virtual void createPluginActions(TDEActionCollection*);
139 virtual void validatePluginActions(TDEActionCollection*, KMPrinter*);
142 void checkUpdatePossible();
145 void updatePossible(
bool );
149 virtual void listPrinters();
152 void addPrinter(KMPrinter *p);
154 void setHardDefault(KMPrinter*);
155 void setSoftDefault(KMPrinter*);
156 KMPrinter* softDefault()
const;
157 KMPrinter* hardDefault()
const;
161 bool uncompressFile(
const TQString& srcname, TQString& destname);
162 bool notImplemented();
163 void setHasManagement(
bool on) { m_hasmanagement = on; }
164 void setPrinterOperationMask(
int m) { m_printeroperationmask = m; }
165 void setServerOperationMask(
int m) { m_serveroperationmask = m; }
167 void discardAllPrinters(
bool);
168 void setUpdatePossible(
bool );
169 virtual void checkUpdatePossibleInternal();
173 KMPrinterList m_printers, m_fprinters;
174 bool m_hasmanagement;
175 int m_printeroperationmask;
176 int m_serveroperationmask;
177 KMSpecialManager *m_specialmgr;
178 KMVirtualManager *m_virtualmgr;
179 PrinterFilter *m_printerfilter;
180 bool m_updatepossible;