File indexing completed on 2024-05-12 05:07:44

0001 /*
0002     SPDX-FileCopyrightText: 2021 Thomas Baumgart <tbaumgart@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KTRANSACTIONSELECTDLG_H
0007 #define KTRANSACTIONSELECTDLG_H
0008 
0009 // ----------------------------------------------------------------------------
0010 // QT Includes
0011 
0012 #include <QDialog>
0013 
0014 // ----------------------------------------------------------------------------
0015 // KDE Includes
0016 
0017 // ----------------------------------------------------------------------------
0018 // Project Includes
0019 
0020 #include "ledgerview.h"
0021 
0022 /**
0023  * @author Thomas Baumgart
0024  */
0025 class KTransactionSelectDlgPrivate;
0026 class KTransactionSelectDlg : public QDialog
0027 {
0028     Q_OBJECT
0029     Q_DISABLE_COPY(KTransactionSelectDlg)
0030 
0031 public:
0032     explicit KTransactionSelectDlg(QWidget* parent = nullptr);
0033     ~KTransactionSelectDlg();
0034 
0035     void addTransaction(const QString& journalEntryId);
0036 
0037     QString journalEntryId() const;
0038 
0039     LedgerView* ledgerView() const;
0040 
0041 protected:
0042     KTransactionSelectDlgPrivate* const d_ptr;
0043     Q_DECLARE_PRIVATE(KTransactionSelectDlg)
0044 };
0045 
0046 class KTransactionMergeDlg : public KTransactionSelectDlg
0047 {
0048     Q_OBJECT
0049     Q_DISABLE_COPY(KTransactionMergeDlg)
0050 
0051 public:
0052     explicit KTransactionMergeDlg(QWidget* parent = nullptr);
0053 
0054     void addTransaction(const QString& journalEntryId);
0055 
0056     /**
0057      * Returns the id of the transaction to remain.
0058      * Returns the value only, if two transactions have
0059      * been added using addTransaction(). Otherwise,
0060      * the returned value is empty.
0061      *
0062      * @sa mergedTransactionId()
0063      */
0064     QString remainingTransactionId() const;
0065 
0066     /**
0067      * Returns the id of the transaction to be merged
0068      * into the remaining transaction.
0069      * Returns the value only, if two transactions have
0070      * been added using addTransaction().  Otherwise,
0071      * the returned value is empty.
0072      *
0073      * @sa remainingTransactionId()
0074      */
0075     QString mergedTransactionId() const;
0076 };
0077 #endif // KTRANSACTIONSELECTDLG_H