File indexing completed on 2024-05-19 05:06:49
0001 /* 0002 SPDX-FileCopyrightText: 2007-2008 Thomas Baumgart <tbaumgart@kde.org> 0003 SPDX-FileCopyrightText: 2017-2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef KCATEGORYREASSIGNDLG_H 0008 #define KCATEGORYREASSIGNDLG_H 0009 0010 #include "kmm_base_dialogs_export.h" 0011 0012 // ---------------------------------------------------------------------------- 0013 // QT Includes 0014 0015 #include <QDialog> 0016 0017 // ---------------------------------------------------------------------------- 0018 // KDE Includes 0019 0020 // ---------------------------------------------------------------------------- 0021 // Project Includes 0022 0023 class MyMoneyAccount; 0024 namespace Ui { 0025 class KCategoryReassignDlg; 0026 } 0027 0028 /** 0029 * Implementation of the dialog that lets the user select a payee in order 0030 * to re-assign transactions (for instance, if payees are deleted). 0031 */ 0032 0033 class KMM_BASE_DIALOGS_EXPORT KCategoryReassignDlg : public QDialog 0034 { 0035 Q_OBJECT 0036 Q_DISABLE_COPY(KCategoryReassignDlg) 0037 0038 public: 0039 explicit KCategoryReassignDlg(QWidget* parent = nullptr); 0040 ~KCategoryReassignDlg(); 0041 0042 /** 0043 * This function sets up the dialog, lets the user select a category and returns 0044 * the id of the selected category in the list of all known income and expense accounts. 0045 * 0046 * @param category reference to MyMoneyAccount object of the category to be deleted 0047 * 0048 * @return Returns the id of the selected category in the list or QString() if 0049 * the dialog was aborted. QString() is also returned if the @a category 0050 * does not have an id. 0051 */ 0052 QString show(const MyMoneyAccount& category); 0053 0054 protected: 0055 void accept() final override; 0056 0057 private: 0058 Ui::KCategoryReassignDlg *ui; 0059 }; 0060 0061 #endif // KCATEGORYREASSIGNDLG_H