File indexing completed on 2024-05-12 16:42:10

0001 /*
0002     SPDX-FileCopyrightText: 2011-2012 Alessandro Russo <axela74@yahoo.it>
0003     SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KTAGREASSIGNDLG_H
0008 #define KTAGREASSIGNDLG_H
0009 
0010 // ----------------------------------------------------------------------------
0011 // QT Includes
0012 
0013 #include <QDialog>
0014 
0015 // ----------------------------------------------------------------------------
0016 // KDE Includes
0017 
0018 // ----------------------------------------------------------------------------
0019 // Project Includes
0020 
0021 namespace Ui {
0022 class KTagReassignDlg;
0023 }
0024 
0025 /**
0026  *  Implementation of the dialog that lets the user select a tag in order
0027  *  to re-assign transactions (for instance, if tags are deleted).
0028  */
0029 
0030 class MyMoneyTag;
0031 
0032 class KTagReassignDlg : public QDialog
0033 {
0034     Q_OBJECT
0035     Q_DISABLE_COPY(KTagReassignDlg)
0036 
0037 public:
0038     explicit KTagReassignDlg(QWidget* parent = nullptr);
0039     ~KTagReassignDlg();
0040 
0041     /**
0042       * This function sets up the dialog, lets the user select a tag and returns
0043       * the id of the selected tag in the tagslist.
0044       *
0045       * @param tagslist reference to QList of MyMoneyTag objects to be contained in the list
0046       *
0047       * @return Returns the id of the selected tag in the list or QString() if
0048       *         the dialog was aborted. QString() is also returned if the tagslist is empty.
0049       */
0050     QString show(const QList<MyMoneyTag>& tagslist);
0051 
0052 protected:
0053     void accept() override;
0054 
0055 private:
0056     Ui::KTagReassignDlg *ui;
0057 };
0058 
0059 #endif // KTAGREASSIGNDLG_H