00001 #ifndef LABPRINTERCOMPILER_H 00002 #define LABPRINTERCOMPILER_H 00003 00004 #include <qobject.h> 00005 00006 class Q_EXPORT QlabPrinterCompiler : public QObject 00007 { 00008 Q_OBJECT 00009 00010 Q_PROPERTY( QString printer READ printer WRITE setPrinter DESIGNABLE true SCRIPTABLE true STORED true ) 00011 Q_PROPERTY( QString make READ make WRITE setMake DESIGNABLE true SCRIPTABLE true STORED true ) 00012 Q_PROPERTY( QString model READ model WRITE setModel DESIGNABLE true SCRIPTABLE true STORED true ) 00013 00014 00015 public : 00016 QlabPrinterCompiler( const QString & printer = 0, QObject * parent = 0, const char * name = 0 ) ; 00017 ~QlabPrinterCompiler() ; 00018 00019 public slots : 00020 void setPrinter( const QString & name ) ; 00021 QString printer() const ; 00022 void setMake( const QString & make ) ; 00023 QString make() const ; 00024 void setModel( const QString & model ) ; 00025 QString model() const ; 00026 00027 protected: 00028 QMap<QString, QMap<QString, QString> > printCodes ; 00029 QMap<QString, QString> compiledCodes ; 00030 00031 private : 00032 bool runIt() ; 00033 bool getDriverSource() ; 00034 QString compile( const QString & cline ) ; 00035 bool testCodes() ; 00036 bool save() ; 00037 00038 QString currentGroup ; 00039 QString printerName ; 00040 QString printerMake ; 00041 QString printerModel ; 00042 00043 00044 } ; 00045 00046 00047 00048 #endif // LABPRINTERCOMPILER_H