KDReportsPreviewWidget.h

00001 /****************************************************************************
00002 ** Copyright (C) 2007-2011 Klaralvdalens Datakonsult AB.  All rights reserved.
00003 **
00004 ** This file is part of the KD Reports library.
00005 **
00006 ** Licensees holding valid commercial KD Reports licenses may use this file in
00007 ** accordance with the KD Reports Commercial License Agreement provided with
00008 ** the Software.
00009 **
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 and version 3 as published by the
00013 ** Free Software Foundation and appearing in the file LICENSE.GPL included.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** Contact info@kdab.com if any conditions of this licensing are not
00019 ** clear to you.
00020 **
00021 **********************************************************************/
00022 
00023 #ifndef KDREPORTSPREVIEWWIDGET_H
00024 #define KDREPORTSPREVIEWWIDGET_H
00025 
00026 #include "KDReportsGlobal.h"
00027 #include <QtGui/QWidget>
00028 #include <QtGui/QPrinter>
00029 
00030 namespace KDReports {
00031 class Report;
00032 
00039 class KDREPORTS_EXPORT PreviewWidget : public QWidget
00040 {
00041     Q_OBJECT
00042 
00043 public:
00047     explicit PreviewWidget( QWidget *parent = 0 );
00048 
00049     ~PreviewWidget();
00050 
00054     void setReport( KDReports::Report* report );
00055 
00059     bool isSelected( int pageNumber ) const;
00060 
00068     void setPageSizeChangeAllowed( bool b );
00069 
00075     void setShowTableSettingsDialog( bool b );
00076 
00081     void setWidthForEndlessPrinter( qreal widthMM );
00082 
00083     // maybe setZoomFactor() to set the initial value?
00084 
00088     KDReports::Report* report() const;
00089 
00094     bool printWithDialog();
00095 
00099     void setShowPageListWidget( bool show );
00100 
00104     void repaint();
00105 
00109     QSize sizeHint() const;
00110 
00111 Q_SIGNALS:
00113     void pageSizeChanged( QPrinter::PageSize pageSize );
00115     void orientationChanged( QPrinter::Orientation orientation );
00117     void tableSettingsClicked();
00118 
00119 protected:
00121     void resizeEvent(QResizeEvent *);
00123     bool eventFilter(QObject*, QEvent*);
00124 
00125 private:
00126     Q_PRIVATE_SLOT( d, void _kd_slotCurrentPageChanged() )
00127     Q_PRIVATE_SLOT( d, void _kd_slotFirstPage() )
00128     Q_PRIVATE_SLOT( d, void _kd_slotPrevPage() )
00129     Q_PRIVATE_SLOT( d, void _kd_slotNextPage() )
00130     Q_PRIVATE_SLOT( d, void _kd_slotLastPage() )
00131     Q_PRIVATE_SLOT( d, void _kd_slotPaperSizeActivated( int ) )
00132     Q_PRIVATE_SLOT( d, void _kd_slotPaperOrientationActivated( int ) )
00133     Q_PRIVATE_SLOT( d, void _kd_slotZoomIn() )
00134     Q_PRIVATE_SLOT( d, void _kd_slotZoomOut() )
00135     Q_PRIVATE_SLOT( d, void _kd_slotZoomChanged() )
00136     Q_PRIVATE_SLOT( d, void _kd_previewNextItems() )
00137 
00138     class Private;
00139     friend class Private;
00140     Private* const d;
00141 };
00142 
00143 }
00144 
00145 #endif
 All Classes Namespaces Functions Enumerations Enumerator

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