File indexing completed on 2024-05-19 15:27:53

0001 /* This file is part of KGraphViewer.
0002    Copyright (C) 2005-2007 Gael de Chalendar <kleag@free.fr>
0003 
0004    KGraphViewer is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public
0006    License as published by the Free Software Foundation, version 2.
0007 
0008    This program is distributed in the hope that it will be useful,
0009    but WITHOUT ANY WARRANTY; without even the implied warranty of
0010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011    General Public License for more details.
0012 
0013    You should have received a copy of the GNU General Public License
0014    along with this program; if not, write to the Free Software
0015    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0016    02110-1301, USA
0017 */
0018 
0019 /* This file was part of the KDE project
0020    Copyright (C) 2005 Jarosław Staniek <staniek@kde.org>
0021 
0022    This program is free software; you can redistribute it and/or
0023    modify it under the terms of the GNU Library General Public
0024    License as published by the Free Software Foundation; either
0025    version 2 of the License, or (at your option) any later version.
0026  */
0027 
0028 #ifndef KGVSIMPLEPRINTPREVIEWWINDOW_H
0029 #define KGVSIMPLEPRINTPREVIEWWINDOW_H
0030 
0031 #include <qpainter.h>
0032 // Added by qt3to4:
0033 #include <KgvPageLayoutDia.h>
0034 #include <QEvent>
0035 #include <kactioncollection.h>
0036 #include <ktoolbar.h>
0037 
0038 class QLabel;
0039 class QScrollArea;
0040 
0041 namespace KGraphViewer
0042 {
0043 class KGVSimplePrintPreviewScrollView;
0044 class KGVSimplePrintPreviewView;
0045 class KGVSimplePrintingSettings;
0046 class KGVSimplePrintingEngine;
0047 
0048 //! @short A window for displaying print preview for simple printing.
0049 class KGVSimplePrintPreviewWindow : public QWidget
0050 {
0051     Q_OBJECT
0052 
0053 public:
0054     KGVSimplePrintPreviewWindow(KGVSimplePrintingEngine &engine, const QString &previewName, QWidget *parent);
0055     ~KGVSimplePrintPreviewWindow();
0056 
0057     int currentPage() const
0058     {
0059         return m_pageNumber;
0060     }
0061 
0062     KGVSimplePrintingSettings *settings() const
0063     {
0064         return m_settings;
0065     }
0066 
0067 public Q_SLOTS:
0068     void updatePagesCount();
0069     //      void setPagesCount(int pagesCount);
0070     void goToPage(int pageNumber);
0071     void setFullWidth();
0072     void slotRedraw();
0073 
0074 Q_SIGNALS:
0075     void printRequested();
0076     void pageSetupRequested();
0077 
0078 protected Q_SLOTS:
0079     void slotPageSetup();
0080     void slotPrintClicked();
0081     void slotZoomInClicked();
0082     void slotZoomOutClicked();
0083     void slotFirstClicked();
0084     void slotPreviousClicked();
0085     void slotNextClicked();
0086     void slotLastClicked();
0087     void initLater();
0088 
0089 protected:
0090     bool event(QEvent *e) override;
0091 
0092     KGVSimplePrintingEngine &m_engine;
0093     KGVSimplePrintingSettings *m_settings;
0094     KToolBar *m_toolbar, *m_navToolbar;
0095     int m_pageNumber; //, m_pagesCount;
0096     int m_idFirst, m_idLast, m_idPrevious, m_idNext;
0097     QLabel *m_pageNumberLabel;
0098     //     QScrollArea* m_scrollView;
0099     KGVSimplePrintPreviewScrollView *m_scrollView;
0100     KGVSimplePrintPreviewView *m_view;
0101     KActionCollection m_actions;
0102 
0103     friend class KGVSimplePrintPreviewView;
0104 };
0105 
0106 }
0107 
0108 #endif