2016-02-17 10:11:00 +03:00
|
|
|
/***************************************************************************
|
|
|
|
* This file is part of the Lime Report project *
|
2021-08-18 20:21:36 +03:00
|
|
|
* Copyright (C) 2021 by Alexander Arin *
|
2016-02-17 10:11:00 +03:00
|
|
|
* arin_a@bk.ru *
|
|
|
|
* *
|
|
|
|
** GNU General Public License Usage **
|
|
|
|
* *
|
|
|
|
* This library is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
** GNU Lesser General Public License **
|
|
|
|
* *
|
|
|
|
* This library is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Lesser General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this library. *
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
* This library is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef LRREPORTDESIGNINTF_P_H
|
|
|
|
#define LRREPORTDESIGNINTF_P_H
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
#include "lrbanddesignintf.h"
|
2016-02-17 10:11:00 +03:00
|
|
|
#include "lrcollection.h"
|
|
|
|
#include "lrdatasourcemanager.h"
|
2017-11-24 00:13:47 +03:00
|
|
|
#include "lrdesignerplugininterface.h"
|
2024-09-04 17:31:16 +03:00
|
|
|
#include "lrglobal.h"
|
2017-11-27 23:14:05 +03:00
|
|
|
#include "lrreportdesignwindowintrerface.h"
|
2024-09-04 17:31:16 +03:00
|
|
|
#include "lrreportengine.h"
|
|
|
|
#include "lrreportrender.h"
|
|
|
|
#include "lrreporttranslation.h"
|
|
|
|
#include "lrscriptenginemanager.h"
|
|
|
|
#include "serializators/lrstorageintf.h"
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
#include <QLocale>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSharedPointer>
|
2017-04-20 05:43:48 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class QFileSystemWatcher;
|
2018-06-23 00:04:28 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
namespace LimeReport {
|
2016-02-17 10:11:00 +03:00
|
|
|
|
|
|
|
class PageDesignIntf;
|
|
|
|
class PrintRange;
|
2016-04-21 17:53:31 +03:00
|
|
|
class ReportDesignWindow;
|
2018-06-23 00:04:28 +03:00
|
|
|
class ReportExporterInterface;
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class WatermarkHelper {
|
2019-04-02 22:56:12 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
WatermarkHelper(const WatermarkSetting& watermark): m_watermark(watermark) { }
|
2019-04-02 22:56:12 +03:00
|
|
|
qreal sceneX();
|
|
|
|
qreal sceneY();
|
|
|
|
qreal sceneWidth();
|
|
|
|
qreal sceneHeight();
|
|
|
|
QPointF scenePos();
|
2024-09-04 17:31:16 +03:00
|
|
|
QSizeF sceneSize();
|
|
|
|
QPointF mapToPage(const PageItemDesignIntf& page);
|
|
|
|
|
2019-04-02 22:56:12 +03:00
|
|
|
private:
|
|
|
|
qreal valueToPixels(qreal value);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2019-04-02 22:56:12 +03:00
|
|
|
private:
|
2019-04-06 00:28:02 +03:00
|
|
|
const WatermarkSetting& m_watermark;
|
2019-04-02 22:56:12 +03:00
|
|
|
};
|
|
|
|
|
2017-11-24 00:13:47 +03:00
|
|
|
class ReportEnginePrivateInterface {
|
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
virtual PageDesignIntf* appendPage(const QString& pageName = "") = 0;
|
|
|
|
virtual bool deletePage(PageDesignIntf* page) = 0;
|
|
|
|
virtual void reorderPages(const QList<PageDesignIntf*>& reorderedPages) = 0;
|
|
|
|
virtual int pageCount() = 0;
|
|
|
|
virtual PageDesignIntf* pageAt(int index) = 0;
|
|
|
|
virtual void clearReport() = 0;
|
|
|
|
virtual ScriptEngineContext* scriptContext() = 0;
|
|
|
|
virtual ScriptEngineManager* scriptManager() = 0;
|
|
|
|
virtual DataSourceManager* dataManager() = 0;
|
|
|
|
virtual QString reportFileName() = 0;
|
|
|
|
virtual void setReportFileName(const QString& reportFileName) = 0;
|
|
|
|
virtual bool isNeedToSave() = 0;
|
|
|
|
virtual bool emitSaveReport() = 0;
|
|
|
|
virtual bool emitSaveReportAs() = 0;
|
|
|
|
virtual void emitSaveFinished() = 0;
|
|
|
|
virtual bool saveToFile(const QString& fileName = "") = 0;
|
|
|
|
virtual bool isSaved() = 0;
|
|
|
|
virtual QString reportName() = 0;
|
|
|
|
virtual bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange) = 0;
|
|
|
|
virtual bool emitLoadReport() = 0;
|
|
|
|
virtual void emitLoadFinished() = 0;
|
|
|
|
virtual void clearSelection() = 0;
|
|
|
|
virtual bool printReport(QPrinter* printer = 0) = 0;
|
|
|
|
virtual void previewReport(PreviewHints hints = PreviewBarsUserSetting) = 0;
|
|
|
|
virtual void setCurrentReportsDir(const QString& dirName) = 0;
|
|
|
|
virtual QString currentReportsDir() = 0;
|
|
|
|
virtual bool setDefaultExportDir(const QString& dirName) = 0;
|
|
|
|
virtual QString defaultExportDir() = 0;
|
|
|
|
virtual bool suppressFieldAndVarError() const = 0;
|
|
|
|
virtual void setSuppressFieldAndVarError(bool suppressFieldAndVarError) = 0;
|
|
|
|
virtual void setStyleSheet(const QString& styleSheet) = 0;
|
|
|
|
virtual QString styleSheet() const = 0;
|
2018-05-15 22:14:17 +03:00
|
|
|
virtual QList<QLocale::Language> designerLanguages() = 0;
|
2024-09-04 17:31:16 +03:00
|
|
|
virtual QLocale::Language currentDesignerLanguage() = 0;
|
|
|
|
virtual void setCurrentDesignerLanguage(QLocale::Language language) = 0;
|
|
|
|
virtual void cancelRender() = 0;
|
|
|
|
virtual void setShowProgressDialog(bool value) = 0;
|
|
|
|
virtual bool isShowProgressDialog() const = 0;
|
|
|
|
virtual bool isBusy() = 0;
|
|
|
|
virtual int baseItemPadding() const = 0;
|
|
|
|
virtual void setBaseItemPadding(int baseTextItemPadding) = 0;
|
2017-11-24 00:13:47 +03:00
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class PrintProcessor {
|
2019-02-06 23:48:52 +03:00
|
|
|
public:
|
|
|
|
explicit PrintProcessor(QPrinter* printer);
|
2024-09-04 17:31:16 +03:00
|
|
|
~PrintProcessor()
|
|
|
|
{
|
|
|
|
if (m_painter)
|
|
|
|
delete m_painter;
|
|
|
|
}
|
2019-02-06 23:48:52 +03:00
|
|
|
bool printPage(LimeReport::PageItemDesignIntf::Ptr page);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2019-02-06 23:48:52 +03:00
|
|
|
private:
|
|
|
|
void initPrinter(PageItemDesignIntf* page);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2019-02-06 23:48:52 +03:00
|
|
|
private:
|
|
|
|
QPrinter* m_printer;
|
|
|
|
QPainter* m_painter;
|
2019-10-12 22:31:35 +03:00
|
|
|
LimeReport::PageDesignIntf m_renderPage;
|
2019-02-06 23:48:52 +03:00
|
|
|
bool m_firstPage;
|
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
class ReportEnginePrivate:
|
|
|
|
public QObject,
|
|
|
|
public ICollectionContainer,
|
|
|
|
public ITranslationContainer,
|
|
|
|
public IExternalPainter,
|
|
|
|
public ReportEnginePrivateInterface {
|
2016-02-17 10:11:00 +03:00
|
|
|
Q_OBJECT
|
|
|
|
Q_DECLARE_PUBLIC(ReportEngine)
|
2021-08-18 05:32:45 +03:00
|
|
|
Q_PROPERTY(ACollectionProperty pages READ fakeCollectionReader)
|
2016-06-10 18:05:18 +03:00
|
|
|
Q_PROPERTY(QObject* datasourcesManager READ dataManager)
|
|
|
|
Q_PROPERTY(QObject* scriptContext READ scriptContext)
|
2024-09-04 17:31:16 +03:00
|
|
|
Q_PROPERTY(bool suppressFieldAndVarError READ suppressFieldAndVarError WRITE
|
|
|
|
setSuppressFieldAndVarError)
|
2024-07-24 22:44:58 +03:00
|
|
|
Q_PROPERTY(int baseItemPadding READ baseItemPadding WRITE setBaseItemPadding)
|
2017-07-29 00:54:43 +03:00
|
|
|
Q_PROPERTY(ATranslationProperty translation READ fakeTranslationReader)
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
enum AppendType {
|
|
|
|
MixPages,
|
|
|
|
AppendPages
|
|
|
|
};
|
2021-02-17 21:53:55 +03:00
|
|
|
|
2016-03-30 23:21:44 +03:00
|
|
|
friend class PreviewReportWidget;
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
bool printPages(ReportPages pages, QPrinter* printer);
|
|
|
|
void printPages(ReportPages pages, QMap<QString, QPrinter*> printers,
|
|
|
|
bool printToAllPrinters = false);
|
2017-09-01 02:02:51 +03:00
|
|
|
Q_INVOKABLE QStringList aviableReportTranslations();
|
|
|
|
Q_INVOKABLE void setReportTranslation(const QString& languageName);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
public:
|
2024-09-04 17:31:16 +03:00
|
|
|
explicit ReportEnginePrivate(QObject* parent = 0);
|
2016-02-17 10:11:00 +03:00
|
|
|
virtual ~ReportEnginePrivate();
|
2016-06-10 18:05:18 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
PageDesignIntf* appendPage(const QString& pageName = "");
|
|
|
|
bool deletePage(PageDesignIntf* page);
|
|
|
|
PageDesignIntf* createPreviewPage();
|
|
|
|
PageDesignIntf* pageAt(int index)
|
|
|
|
{
|
|
|
|
return (index <= (m_pages.count() - 1)) ? m_pages.at(index) : 0;
|
|
|
|
}
|
|
|
|
int pageCount() { return m_pages.count(); }
|
|
|
|
DataSourceManager* dataManager() { return m_datasources; }
|
|
|
|
ScriptEngineContext* scriptContext() { return m_scriptEngineContext; }
|
2017-08-18 22:55:29 +03:00
|
|
|
ScriptEngineManager* scriptManager();
|
2024-09-04 17:31:16 +03:00
|
|
|
IDataSourceManager* dataManagerIntf() { return m_datasources; }
|
2016-02-17 10:28:27 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
IScriptEngineManager* scriptManagerIntf()
|
|
|
|
{
|
2016-02-17 10:28:27 +03:00
|
|
|
ScriptEngineManager::instance().setDataManager(dataManager());
|
|
|
|
return &ScriptEngineManager::instance();
|
|
|
|
}
|
2016-02-17 10:11:00 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
void clearReport();
|
|
|
|
bool printReport(QPrinter* printer = 0);
|
|
|
|
bool printReport(QMap<QString, QPrinter*> printers, bool printToAllPrinters);
|
2019-10-12 22:31:35 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
void printToFile(const QString& fileName);
|
|
|
|
bool printToPDF(const QString& fileName);
|
|
|
|
bool exportReport(QString exporterName, const QString& fileName = "",
|
|
|
|
const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
|
|
|
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
|
|
|
void previewReport(QPrinter* printer, PreviewHints hints = PreviewBarsUserSetting);
|
2017-11-27 23:14:05 +03:00
|
|
|
|
|
|
|
ReportDesignWindowInterface* getDesignerWindow();
|
2024-09-04 17:31:16 +03:00
|
|
|
void designReport(bool showModal);
|
|
|
|
void setSettings(QSettings* value);
|
|
|
|
void setShowProgressDialog(bool value) { m_showProgressDialog = value; }
|
|
|
|
bool isShowProgressDialog() const { return m_showProgressDialog; }
|
|
|
|
QSettings* settings();
|
|
|
|
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange);
|
|
|
|
bool loadFromByteArray(QByteArray* data, const QString& name = "");
|
|
|
|
bool loadFromString(const QString& report, const QString& name = "");
|
|
|
|
QString reportFileName() { return m_fileName; }
|
|
|
|
void setReportFileName(const QString& reportFileName) { m_fileName = reportFileName; }
|
|
|
|
bool saveToFile(const QString& fileName = "");
|
|
|
|
QByteArray saveToByteArray();
|
2016-02-17 10:39:17 +03:00
|
|
|
QString saveToString();
|
2024-09-04 17:31:16 +03:00
|
|
|
bool isNeedToSave();
|
2016-02-17 10:11:00 +03:00
|
|
|
QString lastError();
|
2024-09-04 17:31:16 +03:00
|
|
|
ReportEngine* q_ptr;
|
2018-05-23 19:01:30 +03:00
|
|
|
bool emitSaveReport();
|
|
|
|
bool emitSaveReportAs();
|
2016-02-17 10:39:17 +03:00
|
|
|
bool emitLoadReport();
|
2016-04-21 17:44:58 +03:00
|
|
|
void emitSaveFinished();
|
2018-05-23 19:01:30 +03:00
|
|
|
void emitLoadFinished();
|
2018-05-08 16:30:10 +03:00
|
|
|
void emitPrintedToPDF(QString fileName);
|
2016-02-17 10:39:17 +03:00
|
|
|
bool isSaved();
|
|
|
|
void setCurrentReportsDir(const QString& dirName);
|
2024-09-04 17:31:16 +03:00
|
|
|
QString currentReportsDir() { return m_reportsDir; }
|
2024-07-25 21:44:11 +03:00
|
|
|
bool setDefaultExportDir(const QString& dirname);
|
2024-09-04 17:31:16 +03:00
|
|
|
QString defaultExportDir() { return m_exportDir; }
|
|
|
|
void setReportName(const QString& reportName) { m_reportName = reportName; }
|
|
|
|
QString reportName() { return m_reportName; }
|
|
|
|
bool hasActivePreview() { return m_activePreview; }
|
|
|
|
PageDesignIntf* createPreviewScene(QObject* parent);
|
|
|
|
PreviewReportWidget* createPreviewWidget(QWidget* parent);
|
2016-04-06 22:03:58 +03:00
|
|
|
QIcon previewWindowIcon() const;
|
2024-09-04 17:31:16 +03:00
|
|
|
void setPreviewWindowIcon(const QIcon& previewWindowIcon);
|
2016-04-06 22:03:58 +03:00
|
|
|
QString previewWindowTitle() const;
|
2024-09-04 17:31:16 +03:00
|
|
|
void setPreviewWindowTitle(const QString& previewWindowTitle);
|
2019-02-18 15:16:55 +03:00
|
|
|
QColor previewWindowPageBackground();
|
|
|
|
void setPreviewWindowPageBackground(QColor color);
|
2016-04-06 22:03:58 +03:00
|
|
|
|
2016-06-24 23:15:59 +03:00
|
|
|
bool suppressFieldAndVarError() const;
|
|
|
|
void setSuppressFieldAndVarError(bool suppressFieldAndVarError);
|
2024-07-24 22:44:58 +03:00
|
|
|
int baseItemPadding() const;
|
|
|
|
void setBaseItemPadding(int baseTextItemPadding);
|
2016-12-13 12:47:46 +03:00
|
|
|
bool isBusy();
|
2017-02-03 14:20:30 +03:00
|
|
|
bool resultIsEditable() const;
|
|
|
|
void setResultEditable(bool value);
|
2019-04-10 16:23:50 +03:00
|
|
|
bool saveToFileIsVisible() const;
|
|
|
|
void setSaveToFileVisible(bool value);
|
|
|
|
bool printToPdfIsVisible() const;
|
|
|
|
void setPrintToPdfVisible(bool value);
|
|
|
|
bool printIsVisible() const;
|
|
|
|
void setPrintVisible(bool value);
|
2017-02-03 14:20:30 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
void setPassPhrase(const QString& passPhrase);
|
2017-07-29 00:54:43 +03:00
|
|
|
bool addTranslationLanguage(QLocale::Language language);
|
2017-08-16 01:18:56 +03:00
|
|
|
bool removeTranslationLanguage(QLocale::Language language);
|
2017-07-29 00:54:43 +03:00
|
|
|
bool setReportLanguage(QLocale::Language language);
|
|
|
|
QList<QLocale::Language> aviableLanguages();
|
|
|
|
ReportTranslation* reportTranslation(QLocale::Language language);
|
2024-09-04 17:31:16 +03:00
|
|
|
void reorderPages(const QList<PageDesignIntf*>& reorderedPages);
|
2017-09-21 22:02:13 +03:00
|
|
|
void clearSelection();
|
2017-11-01 22:09:19 +03:00
|
|
|
Qt::LayoutDirection previewLayoutDirection();
|
|
|
|
void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
|
2017-12-11 16:48:00 +03:00
|
|
|
QString styleSheet() const;
|
2024-09-04 17:31:16 +03:00
|
|
|
void setStyleSheet(const QString& styleSheet);
|
2018-05-15 22:14:17 +03:00
|
|
|
QList<QLocale::Language> designerLanguages();
|
2018-04-10 16:28:48 +03:00
|
|
|
QLocale::Language currentDesignerLanguage();
|
|
|
|
void setCurrentDesignerLanguage(QLocale::Language language);
|
2018-07-11 02:42:43 +03:00
|
|
|
ScaleType previewScaleType();
|
2024-09-04 17:31:16 +03:00
|
|
|
int previewScalePercent();
|
|
|
|
void setPreviewScaleType(const ScaleType& previewScaleType, int percent = 0);
|
|
|
|
void addWatermark(const WatermarkSetting& watermarkSetting);
|
|
|
|
void clearWatermarks();
|
2019-05-29 16:32:58 +03:00
|
|
|
IPreparedPages* preparedPages();
|
2019-05-29 03:41:18 +03:00
|
|
|
bool showPreparedPages(PreviewHints hints);
|
2024-09-04 17:31:16 +03:00
|
|
|
bool showPreparedPages(QPrinter* defaultPrinter, PreviewHints hints);
|
2019-05-29 03:41:18 +03:00
|
|
|
bool prepareReportPages();
|
2019-06-03 22:30:50 +03:00
|
|
|
bool printPreparedPages();
|
2016-02-17 10:11:00 +03:00
|
|
|
signals:
|
2024-09-04 17:31:16 +03:00
|
|
|
void pagesLoadFinished();
|
|
|
|
void datasourceCollectionLoadFinished(const QString& collectionName);
|
|
|
|
void cleared();
|
|
|
|
void renderStarted();
|
|
|
|
void renderFinished();
|
|
|
|
void renderPageFinished(int renderedPageCount);
|
|
|
|
void onSave(bool& saved);
|
|
|
|
void onSaveAs(bool& saved);
|
|
|
|
void onSavePreview(bool& saved, LimeReport::IPreparedPages* pages);
|
|
|
|
void onLoad(bool& loaded);
|
|
|
|
void saveFinished();
|
|
|
|
void loadFinished();
|
|
|
|
void printedToPDF(QString fileName);
|
2018-05-21 21:18:23 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
void getAvailableDesignerLanguages(QList<QLocale::Language>* languages);
|
|
|
|
void currentDefaultDesignerLanguageChanged(QLocale::Language);
|
|
|
|
QLocale::Language getCurrentDefaultDesignerLanguage();
|
|
|
|
void externalPaint(const QString& objectName, QPainter* painter,
|
|
|
|
const QStyleOptionGraphicsItem*);
|
|
|
|
void printingStarted(int pageCount);
|
|
|
|
void printingFinished();
|
|
|
|
void pagePrintingFinished(int index);
|
2018-12-12 22:55:03 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
public slots:
|
2024-09-04 17:31:16 +03:00
|
|
|
bool slotLoadFromFile(const QString& fileName);
|
|
|
|
void cancelRender();
|
|
|
|
void cancelPrinting();
|
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
protected:
|
2024-09-04 17:31:16 +03:00
|
|
|
PageDesignIntf* createPage(const QString& pageName = "", bool preview = false);
|
|
|
|
bool showPreviewWindow(ReportPages pages, PreviewHints hints, QPrinter* printer);
|
|
|
|
void internalPrintPages(ReportPages pages, QPrinter& printer);
|
2016-02-17 10:11:00 +03:00
|
|
|
protected slots:
|
2024-09-04 17:31:16 +03:00
|
|
|
void slotDataSourceCollectionLoaded(const QString& collectionName);
|
2016-02-20 13:37:18 +03:00
|
|
|
private slots:
|
2018-02-28 23:19:04 +03:00
|
|
|
void slotPreviewWindowDestroyed(QObject* window);
|
|
|
|
void slotDesignerWindowDestroyed(QObject* window);
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
private:
|
2024-09-04 17:31:16 +03:00
|
|
|
// ICollectionContainer
|
|
|
|
virtual QObject* createElement(const QString&, const QString&);
|
|
|
|
virtual int elementsCount(const QString&);
|
|
|
|
virtual QObject* elementAt(const QString&, int index);
|
|
|
|
virtual void collectionLoadFinished(const QString&);
|
|
|
|
void saveError(QString message);
|
|
|
|
void showError(QString message);
|
|
|
|
// ICollectionContainer
|
|
|
|
// ITranslationContainer
|
|
|
|
Translations* translations() { return &m_translations; }
|
2017-08-05 01:38:19 +03:00
|
|
|
void updateTranslations();
|
2024-09-04 17:31:16 +03:00
|
|
|
// ITranslationContainer
|
2016-02-17 10:11:00 +03:00
|
|
|
ReportPages renderToPages();
|
2021-02-17 21:53:55 +03:00
|
|
|
ReportPages appendPages(ReportPages s1, ReportPages s2, AppendType appendType);
|
2016-02-17 10:11:00 +03:00
|
|
|
QString renderToString();
|
2024-09-04 17:31:16 +03:00
|
|
|
PageItemDesignIntf* getPageByName(const QString& pageName);
|
|
|
|
ATranslationProperty fakeTranslationReader() { return ATranslationProperty(); }
|
|
|
|
PageItemDesignIntf* createRenderingPage(PageItemDesignIntf* page);
|
2018-12-12 22:55:03 +03:00
|
|
|
void initReport();
|
2024-09-04 17:31:16 +03:00
|
|
|
void paintByExternalPainter(const QString& objectName, QPainter* painter,
|
|
|
|
const QStyleOptionGraphicsItem* options);
|
|
|
|
void dropChanges()
|
|
|
|
{
|
|
|
|
m_datasources->dropChanges();
|
|
|
|
m_scriptEngineContext->dropChanges();
|
|
|
|
}
|
2020-02-04 11:40:05 +03:00
|
|
|
void clearRenderingPages();
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2016-02-17 10:11:00 +03:00
|
|
|
private:
|
|
|
|
QList<PageDesignIntf*> m_pages;
|
2018-03-07 19:54:57 +03:00
|
|
|
QList<PageItemDesignIntf*> m_renderingPages;
|
2019-05-29 03:41:18 +03:00
|
|
|
ReportPages m_preparedPages;
|
2019-05-29 16:32:58 +03:00
|
|
|
PreparedPages* m_preparedPagesManager;
|
2016-02-17 10:11:00 +03:00
|
|
|
DataSourceManager* m_datasources;
|
2016-06-10 18:05:18 +03:00
|
|
|
ScriptEngineContext* m_scriptEngineContext;
|
2016-02-17 10:11:00 +03:00
|
|
|
ReportRender::Ptr m_reportRender;
|
|
|
|
QString m_fileName;
|
|
|
|
QString m_lastError;
|
|
|
|
QSettings* m_settings;
|
|
|
|
bool m_ownedSettings;
|
|
|
|
QScopedPointer<QPrinter> m_printer;
|
|
|
|
bool m_printerSelected;
|
|
|
|
bool m_showProgressDialog;
|
2016-02-17 10:39:17 +03:00
|
|
|
QString m_reportsDir;
|
2024-07-25 21:44:11 +03:00
|
|
|
QString m_exportDir;
|
2016-02-17 10:39:17 +03:00
|
|
|
QString m_reportName;
|
2016-02-20 13:37:18 +03:00
|
|
|
QMainWindow* m_activePreview;
|
2016-04-06 22:03:58 +03:00
|
|
|
QIcon m_previewWindowIcon;
|
|
|
|
QString m_previewWindowTitle;
|
2017-11-27 23:14:05 +03:00
|
|
|
QPointer<ReportDesignWindowInterface> m_designerWindow;
|
2016-06-24 23:15:59 +03:00
|
|
|
ReportSettings m_reportSettings;
|
2016-12-13 12:47:46 +03:00
|
|
|
bool m_reportRendering;
|
2017-02-03 14:20:30 +03:00
|
|
|
bool m_resultIsEditable;
|
2017-02-16 04:11:39 +03:00
|
|
|
QString m_passPhrase;
|
2024-09-04 17:31:16 +03:00
|
|
|
QFileSystemWatcher* m_fileWatcher;
|
2017-07-29 00:54:43 +03:00
|
|
|
Translations m_translations;
|
2017-08-16 01:18:56 +03:00
|
|
|
QLocale::Language m_reportLanguage;
|
|
|
|
void activateLanguage(QLocale::Language language);
|
2017-11-01 22:09:19 +03:00
|
|
|
Qt::LayoutDirection m_previewLayoutDirection;
|
2018-06-21 13:38:47 +03:00
|
|
|
LimeReportDesignerPluginInterface* m_designerFactory;
|
2017-12-11 16:48:00 +03:00
|
|
|
QString m_styleSheet;
|
2018-04-10 16:28:48 +03:00
|
|
|
QLocale::Language m_currentDesignerLanguage;
|
2018-06-23 00:04:28 +03:00
|
|
|
QMap<QString, ReportExporterInterface*> exporters;
|
2018-07-11 02:42:43 +03:00
|
|
|
ScaleType m_previewScaleType;
|
|
|
|
int m_previewScalePercent;
|
2019-01-16 03:58:54 +03:00
|
|
|
int m_startTOCPage;
|
2019-02-18 15:16:55 +03:00
|
|
|
QColor m_previewPageBackgroundColor;
|
2019-03-30 09:37:40 +03:00
|
|
|
QVector<WatermarkSetting> m_watermarks;
|
2024-09-04 17:31:16 +03:00
|
|
|
BaseDesignIntf* createWatermark(PageDesignIntf* page, WatermarkSetting watermarkSetting);
|
2019-04-10 16:23:50 +03:00
|
|
|
bool m_saveToFileVisible;
|
|
|
|
bool m_printToPdfVisible;
|
|
|
|
bool m_printVisible;
|
2019-10-12 22:31:35 +03:00
|
|
|
bool m_cancelPrinting;
|
2016-02-17 10:11:00 +03:00
|
|
|
};
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
} // namespace LimeReport
|
2016-02-17 10:11:00 +03:00
|
|
|
#endif // LRREPORTDESIGNINTF_P_H
|