Go to the documentation of this file.00001
00004 #ifndef BPSREPORT_H
00005 #define BPSREPORT_H
00006
00007 #include "bpsreportelement.h"
00008
00009 class BpsDatastore;
00010 class BpsScriptEngine;
00011 class BpsReportPage;
00012 class BpsReportSection;
00013 class QPrinter;
00014
00028 class BPSCORE_EXPORT BpsReport : public BpsReportElement
00029 {
00030 Q_OBJECT
00031 BPS_PRIVATE(BpsReport)
00032
00033 public:
00038 BpsReport(QObject* aParent = 0);
00039
00046 BpsReport(const BpsReportElement& aReportElement, QObject* aParent = 0);
00047
00048 virtual ~BpsReport();
00049
00054 BpsScriptEngine* engine();
00055
00063 void load(BpsDatastore* aDatastore, const QVariant& aKey);
00064
00072 void load(BpsDatastore* aDatastore, const QString& aPath);
00073
00080 void load(const QString& aPath);
00081
00086 void execute();
00087
00088 public slots:
00089
00094 qreal printHeight() const;
00095
00101 void setItemsCount(int aCount);
00102
00108 void setLoadedItems(int aCount);
00109
00114 int pageCount() const;
00115
00120 BpsReportPage* addPage();
00121
00128 BpsReportPage* pageAt(int aIndex) const;
00129
00136 BpsReportSection* createSection(const QString& aName);
00137
00142 void setPrinterDefaults(QPrinter* aPrinter);
00143
00151 int printedPages(QPrinter* aPrinter, int& aFirstPage = *new int, int& aLastPage = *new int) const;
00152
00157 void print(QPrinter* aPrinter);
00158
00159 signals:
00160
00165 void beginLoad(int aCount);
00166
00171 void itemsLoaded(int aCount);
00172
00177 void percentLoaded(int aPercent);
00178
00184 void pagesAdded(int aCount);
00185
00190 void endLoad(int aCount);
00191
00196 void beginPrint(int aCount);
00197
00203 void pagesPrinted(int aCount);
00204
00209 void endPrint(int aCount);
00210
00211 protected:
00212
00217 void scriptDebug(const QString& aLine) const;
00218
00223 void scriptPrint(const QString& aLine) const;
00224
00229 void scriptPerror(const QString& aLine) const;
00230
00231 };
00232
00233 Q_DECLARE_METATYPE(BpsReport*)
00234
00235 #endif // BPSREPORT_H