kmcupsmanager.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KMCUPSMANAGER_H
00021 #define KMCUPSMANAGER_H
00022
00023 #include "kmmanager.h"
00024
00025 class IppRequest;
00026 class KLibrary;
00027 class KExtendedSocket;
00028
00029 namespace KNetwork {
00030 class KStreamSocket;
00031 }
00032
00033 class KMCupsManager : public KMManager
00034 {
00035 friend class KMWIppPrinter;
00036 friend class KMCupsJobManager;
00037
00038 Q_OBJECT
00039 public:
00040 KMCupsManager(QObject *parent, const char *name, const QStringList & );
00041 virtual ~KMCupsManager();
00042
00043
00044 bool createPrinter(KMPrinter *p);
00045 bool removePrinter(KMPrinter *p);
00046 bool enablePrinter(KMPrinter *p, bool state);
00047 bool startPrinter(KMPrinter *p, bool state);
00048 bool completePrinter(KMPrinter *p);
00049 bool completePrinterShort(KMPrinter *p);
00050 bool setDefaultPrinter(KMPrinter *p);
00051 bool testPrinter(KMPrinter *p);
00052
00053
00054
00055 QString driverDbCreationProgram();
00056 QString driverDirectory();
00057
00058 DrMain* loadPrinterDriver(KMPrinter *p, bool config = false);
00059 DrMain* loadFileDriver(const QString& filename);
00060 bool savePrinterDriver(KMPrinter *p, DrMain *d);
00061
00062 bool restartServer();
00063 bool configureServer(QWidget *parent = 0);
00064 QStringList detectLocalPrinters();
00065
00066 void createPluginActions(KActionCollection*);
00067 void validatePluginActions(KActionCollection*, KMPrinter*);
00068 QString stateInformation();
00069
00070 public slots:
00071 void exportDriver();
00072 void printerIppReport();
00073
00074 protected slots:
00075 void slotConnectionFailed( int );
00076 void slotConnectionSuccess();
00077 void slotAsyncConnect();
00078
00079 void hostPingSlot();
00080 void hostPingFailedSlot();
00081
00082 protected:
00083
00084 void listPrinters();
00085 void loadServerPrinters();
00086 void processRequest(IppRequest*);
00087 bool setPrinterState(KMPrinter *p, int st);
00088 DrMain* loadDriverFile(const QString& filename);
00089 DrMain* loadMaticDriver(const QString& drname);
00090 void saveDriverFile(DrMain *driver, const QString& filename);
00091 void reportIppError(IppRequest*);
00092 void* loadCupsdConfFunction(const char*);
00093 void unloadCupsdConf();
00094 QString cupsInstallDir();
00095 void ippReport(IppRequest&, int, const QString&);
00096 void checkUpdatePossibleInternal();
00097
00098 private:
00099 KLibrary *m_cupsdconf;
00100 KMPrinter *m_currentprinter;
00101 KNetwork::KStreamSocket *m_socket;
00102 bool m_hostSuccess;
00103 bool m_lookupDone;
00104 };
00105
00106 #endif
|