File indexing completed on 2024-05-19 05:08:15

0001 /*
0002     SPDX-FileCopyrightText: 2000-2002 Michael Edwardes <mte@users.sourceforge.net>
0003     SPDX-FileCopyrightText: 2005 Thomas Baumgart <ipwizard@users.sourceforge.net>
0004     SPDX-FileCopyrightText: 2000-2002 Javier Campos Morales <javi_c@users.sourceforge.net>
0005     SPDX-FileCopyrightText: 2000-2002 Felix Rodriguez <frodriguez@users.sourceforge.net>
0006     SPDX-FileCopyrightText: 2000-2002 John C <thetacoturtle@users.sourceforge.net>
0007     SPDX-FileCopyrightText: 2000-2002 Kevin Tambascio <ktambascio@users.sourceforge.net>
0008     SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #ifndef KCATEGORIESVIEW_H
0013 #define KCATEGORIESVIEW_H
0014 
0015 // ----------------------------------------------------------------------------
0016 // QT Includes
0017 
0018 // ----------------------------------------------------------------------------
0019 // KDE Includes
0020 
0021 // ----------------------------------------------------------------------------
0022 // Project Includes
0023 
0024 #include "kmymoneyviewbase.h"
0025 
0026 class MyMoneyMoney;
0027 class MyMoneyAccount;
0028 class SelectedObjects;
0029 
0030 /**
0031   * @brief  This class contains the implementation of the categories view.
0032   * @author Michael Edwardes, Thomas Baumgart
0033   *
0034   * While named "categories view", this view actually displays all accounts
0035   * that are children of the global "Income" and "Expense" accounts. Even though
0036   * categories are internally just accounts as well, the distinction between
0037   * categories and accounts in the user interface is done for better
0038   * usability and clarity.
0039   *
0040   * The main functionality in the categories view is actually implemented
0041   * in the KMyMoneyAccountTreeView. Signals from user actions are connect to
0042   * other signals/slots in KCategoriesView and relayed to KMyMoneyView.
0043   * A typical example is the selectObject() signal that eventually results
0044   * in enabling/disabling the user actions for the categories view.
0045   *
0046   * For the categories view three user actions are important (all created in
0047   * kmymoney.cpp): category_new, category_edit and category_delete. They are
0048   * accessible from either the main menu or the context menu.
0049   */
0050 class KCategoriesViewPrivate;
0051 class KCategoriesView : public KMyMoneyViewBase
0052 {
0053     Q_OBJECT
0054 
0055 public:
0056     explicit KCategoriesView(QWidget *parent = nullptr);
0057     ~KCategoriesView();
0058 
0059 public Q_SLOTS:
0060     void slotProfitLossChanged(const MyMoneyMoney &profit, bool isApproximate);
0061 
0062     void slotSettingsChanged() override;
0063     void updateActions(const SelectedObjects& selections) override;
0064 
0065 protected Q_SLOTS:
0066     void slotUnusedIncomeExpenseAccountHidden();
0067 
0068 private:
0069     Q_DECLARE_PRIVATE(KCategoriesView)
0070 
0071 private Q_SLOTS:
0072     void slotNewCategory();
0073     void slotEditCategory();
0074     void slotDeleteCategory();
0075 };
0076 
0077 #endif