0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-26 01:24:39 +03:00
LimeReport/limereport/lrpreviewreportwidget.h

72 lines
1.7 KiB
C
Raw Normal View History

2016-03-30 23:04:59 +03:00
#ifndef LRPREVIEWREPORTWIDGET_H
#define LRPREVIEWREPORTWIDGET_H
#include <QWidget>
2018-07-11 02:42:43 +03:00
#include <QTimer>
2016-03-30 23:04:59 +03:00
#include "lrglobal.h"
namespace LimeReport {
namespace Ui {
class PreviewReportWidget;
}
class PreviewReportWidgetPrivate;
class ReportEnginePrivate;
class LIMEREPORT_EXPORT PreviewReportWidget : public QWidget
{
Q_OBJECT
friend class ReportEnginePrivate;
friend class PreviewReportWindow;
friend class PreviewReportWidgetPrivate;
public:
explicit PreviewReportWidget(ReportEnginePrivate *report, QWidget *parent = 0);
~PreviewReportWidget();
2018-07-11 02:42:43 +03:00
ScaleType scaleType() const;
int scalePercent() const;
void setScaleType(const ScaleType &scaleType, int percent = 0);
2016-03-30 23:04:59 +03:00
public slots:
void refreshPages();
2016-04-02 03:38:23 +03:00
void zoomIn();
void zoomOut();
void firstPage();
void priorPage();
void nextPage();
void lastPage();
void print();
void printToPDF();
void pageNavigatorChanged(int value);
void saveToFile();
void setScalePercent(int percent);
void fitWidth();
void fitPage();
2018-07-11 02:42:43 +03:00
protected:
void resizeEvent(QResizeEvent *);
2016-03-30 23:04:59 +03:00
signals:
void pageChanged(int page);
2016-04-02 03:38:23 +03:00
void scalePercentChanged(int percent);
void pagesSet(int pageCount);
2016-03-30 23:04:59 +03:00
private slots:
void slotSliderMoved(int value);
void reportEngineDestroyed(QObject* object);
2016-04-05 23:06:11 +03:00
void slotZoomed(double);
2018-07-11 02:42:43 +03:00
void resizeDone();
2016-03-30 23:04:59 +03:00
private:
void initPreview();
void setErrorsMesagesVisible(bool visible);
void setErrorMessages(const QStringList &value);
2016-04-02 03:38:23 +03:00
void emitPageSet();
2016-03-30 23:04:59 +03:00
private:
Ui::PreviewReportWidget *ui;
PreviewReportWidgetPrivate* d_ptr;
2018-07-11 02:42:43 +03:00
ScaleType m_scaleType;
int m_scalePercent;
QTimer m_resizeTimer;
2016-03-30 23:04:59 +03:00
};
} // namespace LimeReport
#endif // LRPREVIEWREPORTWIDGET_H