|
Canorus
0.7
|
00001 00008 #ifndef _TYPESET_CTL_H_ 00009 #define _TYPESET_CTL_H_ 00010 00011 // Includes 00012 #include <QObject> 00013 #include <QVariant> 00014 #include <QVector> 00015 #include <QStringList> 00016 #include <QTemporaryFile> 00017 00018 // Forward declarations 00019 class CAExternProgram; 00020 class CAExport; 00021 class CADocument; 00022 00023 class CATypesetCtl : public QObject 00024 { 00025 Q_OBJECT 00026 00027 public: 00028 CATypesetCtl(); 00029 ~CATypesetCtl(); 00030 00031 void setTypesetter( const QString &roProgramName, const QString &roProgramPath = "" ); 00032 void setPS2PDF( const QString &roProgrammName, const QString &roProgramPath = "", 00033 const QStringList &roParams = (QStringList() << QString("") ) ); 00034 virtual void setExpOption( const QVariant &roName, const QVariant &roValue ); 00035 virtual void setTSetOption( const QVariant &roName, const QVariant &roValue, bool bSpace = false, bool bShortParam = true ); 00036 inline void setPDFConversion( bool bConversion ) { _bPDFConversion = bConversion; } 00037 inline void setExporter( CAExport *poExport ) { _poExport = poExport ; } 00038 // Attention: .pdf automatically added and removed if it was added internally 00039 void exportDocument( CADocument *poDoc ); 00040 void runTypesetter(); 00041 00042 inline bool getPDFConversion() { return _bPDFConversion; } 00043 inline CAExport *getExporter() { return _poExport; } 00044 inline QString getTempFilePath() { return _oOutputFileName; } 00045 bool waitForFinished ( int iMSecs ); 00046 00047 signals: 00048 void nextOutput( const QByteArray &roData ); 00049 void nextStep(); 00050 void typesetterFinished( int iExitCode ); 00051 00052 protected slots: 00053 void rcvTypesetterOutput( const QByteArray &roData ); 00054 void typsetterExited( int iExitCode ); 00055 00056 protected: 00057 bool createPDF(); 00058 00059 CAExternProgram *_poTypesetter; // Transforms exported file to pdf / postscript 00060 CAExternProgram *_poConvPS2PDF; // Transforms postscripts files to pdf if needed 00061 CAExport *_poExport; // Transforms canorus document to typesetter format 00062 QVector<QVariant> _oExpOptList; // List of options for export 00063 QVector<QVariant> _oTSetOptList; // List of options for typesetter 00064 QTemporaryFile *_poOutputFile; // Output file for pdf (also used for exported file) 00065 QString _oOutputFileName; // Output file name for pdf (temporary file deletes it on close) 00066 bool _bPDFConversion; // Do a conversion from postscript to pdf 00067 bool _bOutputFileNameFirst; // File name as first parameter ? (Default: No) 00068 }; 00069 00070 #endif // _TYPESET_CTL_H_ 00071
1.8.0