Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

rtkqtreportviewer.h

00001 /*<<<<<COPYRIGHT*/
00002 /*
00003  * RTK The report toolkit
00004  * Copyright (C) 2003 Francisco Santiago Capel Torres
00005 
00006  * rtkqtreportviewer.h RTK standard Qt report viewer
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  */
00019 /*>>>>>COPYRIGHT*/
00020 /***************************************************************************
00021               mreportviewer.h  -  Kugar QT report viewer widget
00022               -------------------
00023     begin     : Fri Aug 13 1999
00024     copyright : (C) 1999 by Mutiny Bay Software
00025     email     : info@mutinybaysoftware.com
00026     copyright : (C) 2002 Alexander Dymo
00027     email     : cloudtemple@mksat.net
00028  ***************************************************************************/
00029 
00030 #ifndef RTKQTREPORTVIEWER_H
00031 #define RTKQTREPORTVIEWER_H
00032 
00033 #include <qapplication.h>
00034 #include <qwidget.h>
00035 #include <qlayout.h>
00036 #include <qscrollview.h>
00037 #include <qpushbutton.h>
00038 #include <qpixmap.h>
00039 #include <qpainter.h>
00040 #include <qpaintdevicemetrics.h>
00041 #include <qprogressdialog.h>
00042 
00043 #include "rtkoutputqpainter.h"
00044 using namespace RTK;
00045 
00046 #include "rtkqtpagedisplay.h"
00047 
00048 #define M_PROGRESS_DELAY 500                    // Number of ms to delay progress dialog display
00049 
00050 
00052 extern QApplication *mAppRef;
00053 
00054 
00055 class QReportViewer : public QWidget
00056 {
00057         Q_OBJECT
00058 
00059 public:
00060         QReportViewer( Output *output, bool autodelete = false,
00061                        QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00062         virtual ~QReportViewer();
00063         void setPageCollection( const QPageCollection *pc );
00064         void clearReport();
00065         void setPageDimensions( int sizex, int sizey );
00066 
00067         QSize sizeHint() const;
00068 
00069 
00070 
00071 public slots:
00072         void slotPrint();
00073         void slotFirstPage();
00074         void slotNextPage();
00075         void slotPrevPage();
00076         void slotLastPage();
00077 
00078 protected:
00079         QVBoxLayout* controlsLayout;
00080         QHBoxLayout* mainLayout;
00081         QPushButton *pushPrint, *pushFirst, *pushNext, *pushPrev, *pushLast;
00082 
00083 
00084 protected:
00085         void paintEvent( QPaintEvent *event );
00086         void resizeEvent( QResizeEvent *event );
00087 
00088         QScrollView *scroller;
00089         QPageDisplay *display;
00090 
00091 private:
00092         QProgressDialog* progress;
00093         const QPageCollection *mPageCollection;
00094         int totalSteps;
00095         int mCurrentPage;
00096         void init();
00097         Output *mOutput;
00098         bool mAutodelete;
00099 };
00100 
00101 #endif // RTKQTREPORTVIEWER_H
00102 
00103 

Generated on Tue Feb 22 14:44:37 2005 for RTK. Report ToolKit by  doxygen 1.3.9.1