File indexing completed on 2024-04-21 04:41:48

0001 /* This file is part of the KDE project
0002    Copyright (C) 2015 Jarosław Staniek <staniek@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2.1 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017    Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KREPORTEXAMPLE_WINDOW_H
0021 #define KREPORTEXAMPLE_WINDOW_H
0022 
0023 #include "KReportExampleDataSource.h"
0024 
0025 #include <QMainWindow>
0026 #include <QDomDocument>
0027 #include <QAction>
0028 
0029 #include <KReportPreRenderer>
0030 #include <KReportPage>
0031 #include <KReportView>
0032 
0033 class ReportDesignerWidget;
0034 
0035 /*! @short KReportExample application's main window */
0036 class Window : public QMainWindow
0037 {
0038     Q_OBJECT
0039 public:
0040     Window(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
0041     ~Window() override;
0042 
0043 public Q_SLOTS:
0044     void showDesign(const QDomElement &design);
0045 
0046 protected:
0047     void closeEvent(QCloseEvent *event) override;
0048 
0049 private:
0050     void createMenus();
0051     bool loadDocument();
0052 
0053     ReportDesignerWidget *m_designerWidget;
0054     QMenu *m_fileMenu;
0055     QAction *m_exitAction;
0056 
0057     KReportView *m_reportView;
0058     QDomDocument m_document;
0059 
0060     int m_currentPage;
0061 };
0062 
0063 #endif