Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 FLJasperEngine.h 00003 ------------------- 00004 begin : 02/01/2011 00005 copyright : (C) 2003-2011 by InfoSiAL S.L. 00006 email : mail@infosial.com 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; version 2 of the License. * 00012 ***************************************************************************/ 00013 /*************************************************************************** 00014 Este programa es software libre. Puede redistribuirlo y/o modificarlo 00015 bajo los términos de la Licencia Pública General de GNU en su 00016 versión 2, publicada por la Free Software Foundation. 00017 ***************************************************************************/ 00018 00019 #ifndef FLJASPERENGINE_H_ 00020 #define FLJASPERENGINE_H_ 00021 00022 #include <qobject.h> 00023 #include <qdom.h> 00024 00025 class FLDomNodeInterface; 00026 class FLJasperEnginePrivate; 00027 class FLReportPages; 00028 00037 class FLJasperEngine : public QObject 00038 { 00039 Q_OBJECT 00040 Q_ENUMS(AQReportsMsgType) 00041 00042 public: 00043 00044 enum AQReportsMsgType { AQErrorMsg, AQLogMsg, AQSysMsg }; 00045 00046 FLJasperEngine(QObject *parent = 0); 00047 ~FLJasperEngine(); 00048 00049 public slots: 00050 00065 bool setReportData(QDomNode n); 00066 bool setReportData(FLDomNodeInterface *n); 00067 00077 bool setReportTemplate(const QString &t); 00078 00084 QDomDocument rptXmlData() const; 00085 FLDomNodeInterface *reportData() const; 00086 00092 QDomDocument rptXmlTemplate() const; 00093 FLDomNodeInterface *reportTemplate() const; 00094 00111 void setDataSourceParameters(const QString &selectExpression, 00112 const QString &datePattern, 00113 const QString &numberPattern); 00114 00124 QString compileReport(); 00125 00142 QString fillReport(); 00143 00157 FLReportPages *printReportToPages(); 00158 00166 void updateReportPages(); 00167 00179 bool printReport(bool withPrintDialog = true); 00180 00194 bool printReport(const QString &printServiceName, int copies = 1); 00195 00200 QStringList printServiceNames(); 00201 00221 bool exportReportToFile(const QString &outFileName, const QString &format); 00222 00231 void execExportFileDialog(const QString &defaultFileName = QString::null, 00232 const QString &defaultFormat = QString::null); 00233 00240 void exportReportToPdf(const QString &outFileName = QString::null, 00241 bool withFileDialog = true); 00242 00249 void exportReportToCsv(const QString &outFileName = QString::null, 00250 bool withFileDialog = true); 00251 00256 QString lastJasperFile() const; 00257 00262 QString lastJRPrintFile() const; 00263 00268 FLReportPages *lastReportPages() const; 00269 00273 void setShowErrorDialog(bool b = true); 00274 00275 signals: 00276 00281 void msgReceived(int, const QString &); 00282 00283 private slots: 00284 00288 void setDefaultExportFormat(const QString &format); 00289 00290 private: 00291 00292 FLJasperEnginePrivate *d; 00293 00297 void msgHandler(AQReportsMsgType type, const QString &msg); 00298 friend void JasperEngineMsgHandler(AQReportsMsgType, const char *, void *); 00299 }; 00300 00301 #endif /* FLJASPERENGINE_H_ */