KD Reports API Documentation  2.0
KDReportsPreviewDialog.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2022 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 = nullptr);
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,
121  SavedSuccessfully,
122  SaveError };
123 
128  QString savedFileName() const;
129 
130 Q_SIGNALS:
131 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
132  void pageSizeChanged(QPrinter::PageSize pageSize);
135  void orientationChanged(QPrinter::Orientation orientation);
136 #else
137  void pageSizeChanged(const QPageSize &pageSize);
140  void orientationChanged(QPageLayout::Orientation orientation);
141 #endif
142 
146  void linkActivated(const QUrl &url);
147 
148 public Q_SLOTS:
150  void accept() override;
152  void reject() override;
153 
154 private:
155  PreviewDialogPrivate *const d;
156 };
157 
158 }
159 
160 #endif
KDReports::PreviewWidget
Definition: KDReportsPreviewWidget.h:48
KDReports::Report
Definition: KDReportsReport.h:80
KDReportsGlobal.h
KDREPORTS_EXPORT
#define KDREPORTS_EXPORT
Definition: KDReportsGlobal.h:29
KDReports
Definition: KDReportsAbstractReportLayout_p.h:30

© 2007-2021 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/
Generated on Sat Jan 8 2022 02:38:32 for KD Reports API Documentation by doxygen 1.8.17