KD Reports  1.7
KDReportsPreviewDialog.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2015 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 
97  void setShowTableSettingsDialog( bool b );
98 
103  void setWidthForEndlessPrinter( qreal widthMM );
104 
105  // maybe setZoomFactor() to set the initial value?
106 
114  virtual bool showTableSettingsDialog( KDReports::Report* report );
115 
121  KDReports::PreviewWidget* previewWidget();
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
Definition: KDReportsReport.h:107
Definition: KDReportsAbstractTableElement.h:33
Definition: KDReportsPreviewDialog.h:39
Definition: KDReportsPreviewWidget.h:40
Result
Definition: KDReportsPreviewDialog.h:126

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-reports/