File indexing completed on 2024-06-16 04:46:41

0001 /*
0002     SPDX-FileCopyrightText: 2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0003     SPDX-FileCopyrightText: 2021 Dawid Wróbel <me@dawidwrobel.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef REPORTSVIEW_H
0008 #define REPORTSVIEW_H
0009 
0010 // ----------------------------------------------------------------------------
0011 // KDE Includes
0012 
0013 // ----------------------------------------------------------------------------
0014 // QT Includes
0015 
0016 // Project Includes
0017 
0018 #include "kmymoneyplugin.h"
0019 
0020 class KReportsView;
0021 
0022 class ReportsView : public KMyMoneyPlugin::Plugin, public KMyMoneyPlugin::DataPlugin
0023 {
0024     Q_OBJECT
0025     Q_INTERFACES(KMyMoneyPlugin::DataPlugin)
0026 
0027 public:
0028     explicit ReportsView(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args);
0029     ~ReportsView();
0030 
0031     void plug(KXMLGUIFactory* guiFactory) final override;
0032     void unplug() final override;
0033 
0034     QVariant requestData(const QString &arg, uint type) final override;
0035 
0036 private:
0037     QWidget *netWorthForecast() const;
0038     /**
0039      * @brief netWorthForecast
0040      * @param arg consists of following arguments:
0041      * 1) detail level of a chart  (eMyMoney::Report::DetailLevel)
0042      * 2) forecast days of a chart
0043      * 3) width of a chart
0044      * 3) height a chart
0045      * correctly written arg variable looks as follows:
0046      * "2;5;800;600"
0047      * @return self-handling widget with a chart
0048      */
0049     QWidget *netWorthForecast(const QString &arg) const;
0050     QString budget() const;
0051     QString showColoredAmount(const QString &amount, bool isNegative) const;
0052     QString link(const QString& view, const QString& query, const QString& _title) const;
0053     QString linkend() const;
0054     KReportsView* m_view;
0055 };
0056 
0057 #endif