KD Reports  1.9
KDReportsPreviewDialog.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDReports OR LicenseRef-KDAB-KDReports-US
8 **
9 ** Licensees holding valid commercial KD Reports licenses may use this file in
10 ** accordance with the KD Reports Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 
17 #ifndef KDREPORTSPREVIEWDIALOG_H
18 #define KDREPORTSPREVIEWDIALOG_H
19 
20 #include "KDReportsGlobal.h"
21 #include <QDialog>
22 #include <QPrinter>
23 
24 namespace KDReports {
25 class Report;
26 class PreviewWidget;
27 class PreviewDialogPrivate;
28 
33 class KDREPORTS_EXPORT PreviewDialog : public QDialog
34 {
35  Q_OBJECT
36 
37 public:
41  explicit PreviewDialog( KDReports::Report* report, QWidget *parent = 0 );
42 
43  ~PreviewDialog() override;
44 
52  void setQuickPrinterName( const QString &printerName );
53 
60  void setDefaultSaveDirectory( const QString &path );
61 
70  void setDirectoryBrowsingEnabled( bool allowed );
71 
75  bool isSelected( int pageNumber ) const;
76 
84  void setPageSizeChangeAllowed( bool b );
85 
91  void setShowTableSettingsDialog( bool b );
92 
97  void setWidthForEndlessPrinter( qreal widthMM );
98 
99  // maybe setZoomFactor() to set the initial value?
100 
108  virtual bool showTableSettingsDialog( KDReports::Report* report );
109 
115  KDReports::PreviewWidget* previewWidget();
116 
120  enum Result { Printed = 10, SavedSuccessfully, SaveError };
121 
126  QString savedFileName() const;
127 
128 Q_SIGNALS:
130  void pageSizeChanged( QPrinter::PageSize pageSize );
132  void orientationChanged( QPrinter::Orientation orientation );
133 
134 public Q_SLOTS:
136  void accept() override;
138  void reject() override;
139 
140 private:
141  Q_PRIVATE_SLOT( d, void _kd_slotTableBreakingDialog() )
142  Q_PRIVATE_SLOT( d, void _kd_slotPrintWithDialog() )
143  Q_PRIVATE_SLOT( d, void _kd_slotQuickPrint() )
144  Q_PRIVATE_SLOT( d, void _kd_slotSave() )
145  PreviewDialogPrivate* const d;
146 };
147 
148 }
149 
150 #endif
Definition: KDReportsReport.h:99
Definition: KDReportsAbstractTableElement.h:30
Definition: KDReportsPreviewDialog.h:33
Definition: KDReportsPreviewWidget.h:34
Result
Definition: KDReportsPreviewDialog.h:120

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-reports/