File indexing completed on 2024-06-16 04:47:24

0001 /***************************************************************************
0002  * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr
0003  * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  ***************************************************************************/
0006 #ifndef SKGBANKPLUGIN_H
0007 #define SKGBANKPLUGIN_H
0008 /** @file
0009 * This file is Skrooge plugin for bank management.
0010 *
0011 * @author Stephane MANKOWSKI / Guillaume DE BURE
0012  */
0013 #include "skginterfaceplugin.h"
0014 
0015 class SKGDocumentBank;
0016 
0017 /**
0018  * This file is Skrooge plugin for bank management
0019  */
0020 class SKGBankPlugin : public SKGInterfacePlugin
0021 {
0022     Q_OBJECT
0023     Q_INTERFACES(SKGInterfacePlugin)
0024 
0025 public:
0026     /**
0027      * Default Constructor
0028      */
0029     explicit SKGBankPlugin(QWidget* iWidget, QObject* iParent, const QVariantList& iArg);
0030 
0031     /**
0032      * Default Destructor
0033      */
0034     ~SKGBankPlugin() override;
0035 
0036     /**
0037      * Called to initialise the plugin
0038      * @param iDocument the main document
0039      * @return true if the plugin is compatible with the document
0040      */
0041     bool setupActions(SKGDocument* iDocument) override;
0042 
0043     /**
0044      * The number of dashboard widgets of the plugin.
0045      * @return The number of dashboard widgets of the plugin
0046      */
0047     int getNbDashboardWidgets() override;
0048 
0049     /**
0050      * Get a dashboard widget title of the plugin.
0051      * @param iIndex the index of the widget
0052      * @return The title
0053      */
0054     QString getDashboardWidgetTitle(int iIndex) override;
0055 
0056     /**
0057      * Get a dashboard widget of the plugin.
0058      * @param iIndex the index of the widget
0059      * @return The dashboard widget of the plugin
0060      */
0061     SKGBoardWidget* getDashboardWidget(int iIndex) override;
0062 
0063     /**
0064      * The page widget of the plugin.
0065      * @return The page widget of the plugin
0066      */
0067     SKGTabPage* getWidget() override;
0068 
0069     /**
0070      * The title of the plugin.
0071      * @return The title of the plugin
0072      */
0073     QString title() const override;
0074 
0075     /**
0076      * The icon of the plugin.
0077      * @return The icon of the plugin
0078      */
0079     QString icon() const override;
0080 
0081     /**
0082      * The toolTip of the plugin.
0083      * @return The toolTip of the plugin
0084      */
0085     QString toolTip() const override;
0086 
0087     /**
0088      * The tips list of the plugin.
0089      * @return The tips list of the plugin
0090      */
0091     QStringList tips() const override;
0092 
0093     /**
0094      * Must be implemented to set the position of the plugin.
0095      * @return integer value between 0 and 999 (default = 999)
0096      */
0097     int getOrder() const override;
0098 
0099     /**
0100      * Must be implemented to know if a plugin must be display in pages chooser.
0101      * @return true of false (default = false)
0102      */
0103     bool isInPagesChooser() const override;
0104 
0105     /**
0106      * The advice list of the plugin.
0107      * @return The advice list of the plugin
0108      */
0109     SKGAdviceList advice(const QStringList& iIgnoredAdvice) override;
0110 
0111     /**
0112      * Must be implemented to execute the automatic correction for the advice.
0113      * @param iAdviceIdentifier the identifier of the advice
0114      * @param iSolution the identifier of the possible solution
0115      * @return an object managing the error. MUST return ERR_NOTIMPL if iAdviceIdentifier is not known
0116      *   @see SKGError
0117      */
0118     SKGError executeAdviceCorrection(const QString& iAdviceIdentifier, int iSolution) override;
0119 
0120 private Q_SLOTS:
0121     void onReconciliate();
0122 
0123 private:
0124     Q_DISABLE_COPY(SKGBankPlugin)
0125 
0126     SKGDocumentBank* m_currentBankDocument;
0127     QAction* m_reconcileAction;
0128 };
0129 
0130 #endif  // SKGDEBUGPLUGIN_H