00001 #ifndef KDREPORTSPREVIEWWIDGET_H
00002 #define KDREPORTSPREVIEWWIDGET_H
00003
00004 #include "KDReportsGlobal.h"
00005 #include <QtGui/QWidget>
00006 #include <QtGui/QPrinter>
00007
00008 namespace KDReports {
00009 class Report;
00010
00017 class KDREPORTS_EXPORT PreviewWidget : public QWidget
00018 {
00019 Q_OBJECT
00020
00021 public:
00025 explicit PreviewWidget( QWidget *parent = 0 );
00026
00027 ~PreviewWidget();
00028
00032 void setReport( KDReports::Report* report );
00033
00037 bool isSelected( int pageNumber ) const;
00038
00046 void setPageSizeChangeAllowed( bool b );
00047
00053 void setShowTableSettingsDialog( bool b );
00054
00059 void setWidthForEndlessPrinter( qreal widthMM );
00060
00061
00062
00066 KDReports::Report* report() const;
00067
00072 bool printWithDialog();
00073
00077 void setShowPageListWidget( bool show );
00078
00082 void repaint();
00083
00087 QSize sizeHint() const;
00088
00089 Q_SIGNALS:
00091 void pageSizeChanged( QPrinter::PageSize pageSize );
00093 void orientationChanged( QPrinter::Orientation orientation );
00095 void tableSettingsClicked();
00096
00097 protected:
00099 void resizeEvent(QResizeEvent *);
00101 bool eventFilter(QObject*, QEvent*);
00102
00103 private:
00104 Q_PRIVATE_SLOT( d, void _kd_slotCurrentPageChanged() )
00105 Q_PRIVATE_SLOT( d, void _kd_slotFirstPage() )
00106 Q_PRIVATE_SLOT( d, void _kd_slotPrevPage() )
00107 Q_PRIVATE_SLOT( d, void _kd_slotNextPage() )
00108 Q_PRIVATE_SLOT( d, void _kd_slotLastPage() )
00109 Q_PRIVATE_SLOT( d, void _kd_slotPaperSizeActivated( int ) )
00110 Q_PRIVATE_SLOT( d, void _kd_slotPaperOrientationActivated( int ) )
00111 Q_PRIVATE_SLOT( d, void _kd_slotZoomIn() )
00112 Q_PRIVATE_SLOT( d, void _kd_slotZoomOut() )
00113 Q_PRIVATE_SLOT( d, void _kd_slotZoomChanged() )
00114 Q_PRIVATE_SLOT( d, void _kd_previewNextItems() )
00115
00116 class Private;
00117 friend class Private;
00118 Private* const d;
00119 };
00120
00121 }
00122
00123 #endif