KD Reports  1.5
 All Classes Namespaces Functions Enumerations Enumerator Pages
KDReportsPreviewWidget.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2014 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 KDREPORTSPREVIEWWIDGET_H
24 #define KDREPORTSPREVIEWWIDGET_H
25 
26 #include "KDReportsGlobal.h"
27 #include <QWidget>
28 #include <QPrinter>
29 
30 namespace KDReports {
31 class Report;
32 
39 class KDREPORTS_EXPORT PreviewWidget : public QWidget
40 {
41  Q_OBJECT
42 
43 public:
47  explicit PreviewWidget( QWidget *parent = 0 );
48 
49  ~PreviewWidget();
50 
54  void setReport( KDReports::Report* report );
55 
59  bool isSelected( int pageNumber ) const;
60 
68  void setPageSizeChangeAllowed( bool b );
69 
75  void setShowTableSettingsDialog( bool b );
76 
81  void setWidthForEndlessPrinter( qreal widthMM );
82 
83  // maybe setZoomFactor() to set the initial value?
84 
88  KDReports::Report* report() const;
89 
94  bool printWithDialog();
95 
99  void setShowPageListWidget( bool show );
100 
104  void repaint();
105 
109  QSize sizeHint() const;
110 
111 Q_SIGNALS:
113  void pageSizeChanged( QPrinter::PageSize pageSize );
115  void orientationChanged( QPrinter::Orientation orientation );
117  void tableSettingsClicked();
118 
119 protected:
121  void resizeEvent(QResizeEvent *);
123  bool eventFilter(QObject*, QEvent*);
124 
125 private:
126  Q_PRIVATE_SLOT( d, void _kd_slotCurrentPageChanged() )
127  Q_PRIVATE_SLOT( d, void _kd_slotFirstPage() )
128  Q_PRIVATE_SLOT( d, void _kd_slotPrevPage() )
129  Q_PRIVATE_SLOT( d, void _kd_slotNextPage() )
130  Q_PRIVATE_SLOT( d, void _kd_slotLastPage() )
131  Q_PRIVATE_SLOT( d, void _kd_slotPaperSizeActivated( int ) )
132  Q_PRIVATE_SLOT( d, void _kd_slotPaperOrientationActivated( int ) )
133  Q_PRIVATE_SLOT( d, void _kd_slotZoomIn() )
134  Q_PRIVATE_SLOT( d, void _kd_slotZoomOut() )
135  Q_PRIVATE_SLOT( d, void _kd_slotZoomChanged() )
136  Q_PRIVATE_SLOT( d, void _kd_previewNextItems() )
137 
138  class Private;
139  friend class Private;
140  Private* const d;
141 };
142 
143 }
144 
145 #endif
Definition: KDReportsReport.h:108
Definition: KDReportsPreviewWidget.h:39

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