KD Reports  1.8
KDReportsPreviewDialog.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSPREVIEWDIALOG_H
24 #define KDREPORTSPREVIEWDIALOG_H
25 
26 #include "KDReportsGlobal.h"
27 #include <QDialog>
28 #include <QPrinter>
29 
30 namespace KDReports {
31 class Report;
32 class PreviewWidget;
33 class PreviewDialogPrivate;
34 
39 class KDREPORTS_EXPORT PreviewDialog : public QDialog
40 {
41  Q_OBJECT
42 
43 public:
47  explicit PreviewDialog( KDReports::Report* report, QWidget *parent = 0 );
48 
49  ~PreviewDialog();
50 
58  void setQuickPrinterName( const QString &printerName );
59 
66  void setDefaultSaveDirectory( const QString &path );
67 
76  void setDirectoryBrowsingEnabled( bool allowed );
77 
81  bool isSelected( int pageNumber ) const;
82 
90  void setPageSizeChangeAllowed( bool b );
91 
98 
103  void setWidthForEndlessPrinter( qreal widthMM );
104 
105  // maybe setZoomFactor() to set the initial value?
106 
115 
122 
126  enum Result { Printed = 10, SavedSuccessfully, SaveError };
127 
132  QString savedFileName() const;
133 
134 Q_SIGNALS:
136  void pageSizeChanged( QPrinter::PageSize pageSize );
138  void orientationChanged( QPrinter::Orientation orientation );
139 
140 public Q_SLOTS:
142  void accept();
144  void reject();
145 
146 private:
147  Q_PRIVATE_SLOT( d, void _kd_slotTableBreakingDialog() )
148  Q_PRIVATE_SLOT( d, void _kd_slotPrintWithDialog() )
149  Q_PRIVATE_SLOT( d, void _kd_slotQuickPrint() )
150  Q_PRIVATE_SLOT( d, void _kd_slotSave() )
151  PreviewDialogPrivate* const d;
152 };
153 
154 }
155 
156 #endif
KDReports::PreviewDialog::setDefaultSaveDirectory
void setDefaultSaveDirectory(const QString &path)
KDReports::PreviewDialog
Definition: KDReportsPreviewDialog.h:40
KDReports::PreviewWidget
Definition: KDReportsPreviewWidget.h:41
KDReports::PreviewDialog::setPageSizeChangeAllowed
void setPageSizeChangeAllowed(bool b)
KDReports::PreviewDialog::reject
void reject()
Reimplemented for internal purposes. .
KDReports::PreviewDialog::isSelected
bool isSelected(int pageNumber) const
KDReports::PreviewDialog::PreviewDialog
PreviewDialog(KDReports::Report *report, QWidget *parent=0)
KDReports::Report
Definition: KDReportsReport.h:110
KDReports::PreviewDialog::showTableSettingsDialog
virtual bool showTableSettingsDialog(KDReports::Report *report)
KDReports::PreviewDialog::setDirectoryBrowsingEnabled
void setDirectoryBrowsingEnabled(bool allowed)
KDReports::PreviewDialog::savedFileName
QString savedFileName() const
KDReports::PreviewDialog::setWidthForEndlessPrinter
void setWidthForEndlessPrinter(qreal widthMM)
KDReports::PreviewDialog::pageSizeChanged
void pageSizeChanged(QPrinter::PageSize pageSize)
Emitted when the user changes the page size.
KDReports::PreviewDialog::Result
Result
Definition: KDReportsPreviewDialog.h:126
KDReports::PreviewDialog::setQuickPrinterName
void setQuickPrinterName(const QString &printerName)
KDReports::PreviewDialog::previewWidget
KDReports::PreviewWidget * previewWidget()
KDReports::PreviewDialog::setShowTableSettingsDialog
void setShowTableSettingsDialog(bool b)
KDReports::PreviewDialog::accept
void accept()
Reimplemented for internal purposes. .
KDReports::PreviewDialog::orientationChanged
void orientationChanged(QPrinter::Orientation orientation)
Emitted when the user changes the page orientation.
KDReports
Definition: KDReportsAbstractTableElement.h:36

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/