File indexing completed on 2024-05-19 05:06:54
0001 /* 0002 SPDX-FileCopyrightText: 2005 Thomas Baumgart <ipwizard@users.sourceforge.net> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 // krazy:excludeall=dpointer 0007 0008 #ifndef VIEWINTERFACE_H 0009 #define VIEWINTERFACE_H 0010 0011 // ---------------------------------------------------------------------------- 0012 // QT Includes 0013 0014 #include <QObject> 0015 0016 // ---------------------------------------------------------------------------- 0017 // KDE Includes 0018 0019 // ---------------------------------------------------------------------------- 0020 // Project Includes 0021 0022 #include "mymoneysplit.h" 0023 #include "mymoneytransaction.h" 0024 0025 #include "icons.h" 0026 #include <kmm_plugin_export.h> 0027 0028 namespace KMyMoneyRegister { 0029 class SelectedTransactions; 0030 } 0031 0032 enum class View; 0033 0034 class MyMoneyInstitution; 0035 class MyMoneyAccount; 0036 class MyMoneySplit; 0037 class MyMoneyTransaction; 0038 class KMyMoneyViewBase; 0039 0040 namespace KMyMoneyPlugin { 0041 0042 /** 0043 * This abstract class represents the ViewInterface to 0044 * add new view pages to the JanusWidget of KMyMoney. It 0045 * also gives access to the account context menu. 0046 */ 0047 class KMM_PLUGIN_EXPORT ViewInterface : public QObject 0048 { 0049 Q_OBJECT 0050 0051 public: 0052 explicit ViewInterface(QObject* parent, const char* name = 0); 0053 virtual ~ViewInterface(); 0054 0055 virtual void addView(KMyMoneyViewBase* view, const QString& name, View idView, Icons::Icon icon) = 0; 0056 virtual void removeView(View idView) = 0; 0057 0058 Q_SIGNALS: 0059 /** 0060 * This signal is emitted when a new account has been selected by 0061 * the GUI. If no account is selected or the selection is removed, 0062 * @a account is identical to MyMoneyAccount(). This signal is used 0063 * by plugins to get information about changes. 0064 */ 0065 void accountSelected(const MyMoneyAccount& acc); 0066 0067 /** 0068 * This signal is emitted when an account has been successfully reconciled 0069 * and all transactions are updated in the engine. It can be used by plugins 0070 * to create reconciliation reports. 0071 * 0072 * @param account the account data 0073 * @param date the reconciliation date as provided through the dialog 0074 * @param startingBalance the starting balance as provided through the dialog 0075 * @param endingBalance the ending balance as provided through the dialog 0076 * @param transactionList reference to QStringList of JournalEntryIds 0077 */ 0078 void accountReconciled(const MyMoneyAccount& account, 0079 const QDate& date, 0080 const MyMoneyMoney& startingBalance, 0081 const MyMoneyMoney& endingBalance, 0082 const QStringList& transactionList); 0083 0084 void viewStateChanged(bool); 0085 }; 0086 0087 } // namespace 0088 #endif