File indexing completed on 2024-04-28 05:08:26

0001 /***************************************************************************
0002     Copyright (C) 2005-2009 Robby Stephenson <robby@periapsis.org>
0003  ***************************************************************************/
0004 
0005 /***************************************************************************
0006  *                                                                         *
0007  *   This program is free software; you can redistribute it and/or         *
0008  *   modify it under the terms of the GNU General Public License as        *
0009  *   published by the Free Software Foundation; either version 2 of        *
0010  *   the License or (at your option) version 3 or any later version        *
0011  *   accepted by the membership of KDE e.V. (or its successor approved     *
0012  *   by the membership of KDE e.V.), which shall act as a proxy            *
0013  *   defined in Section 14 of version 3 of the license.                    *
0014  *                                                                         *
0015  *   This program is distributed in the hope that it will be useful,       *
0016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0018  *   GNU General Public License for more details.                          *
0019  *                                                                         *
0020  *   You should have received a copy of the GNU General Public License     *
0021  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
0022  *                                                                         *
0023  ***************************************************************************/
0024 
0025 #ifndef TELLICO_REPORTDIALOG_H
0026 #define TELLICO_REPORTDIALOG_H
0027 
0028 #include <QDialog>
0029 
0030 class QStackedWidget;
0031 #ifdef USE_KHTML
0032 class KHTMLPart;
0033 #else
0034 class QWebEngineView;
0035 #endif
0036 class QTemporaryFile;
0037 
0038 namespace Tellico {
0039   namespace Export {
0040     class HTMLExporter;
0041   }
0042   namespace GUI {
0043     class ComboBox;
0044   }
0045 
0046 /**
0047  * @author Robby Stephenson
0048  */
0049 class ReportDialog : public QDialog {
0050 Q_OBJECT
0051 
0052 public:
0053   /**
0054    * The constructor sets up the dialog.
0055    *
0056    * @param parent A pointer to the parent widget
0057    */
0058   ReportDialog(QWidget* parent);
0059   virtual ~ReportDialog();
0060 
0061 public Q_SLOTS:
0062   /**
0063    * Regenerate the report.
0064    */
0065   void slotRefresh();
0066 
0067 private Q_SLOTS:
0068   void slotGenerate();
0069   void slotPrint();
0070   void slotSaveAs();
0071   void slotUpdateSize();
0072 
0073 private:
0074   void generateChart();
0075   void generateHtml();
0076   void generateAllEntries();
0077   void showText(const QString& text, const QUrl& url);
0078 
0079   QStackedWidget* m_reportView;
0080 #ifdef USE_KHTML
0081   KHTMLPart* m_HTMLPart;
0082 #else
0083   QWebEngineView* m_webView;
0084 #endif
0085   GUI::ComboBox* m_templateCombo;
0086   Export::HTMLExporter* m_exporter;
0087   QString m_xsltFile;
0088   QTemporaryFile* m_tempFile;
0089 };
0090 
0091 } // end namespace
0092 #endif