File indexing completed on 2024-05-12 16:44:01

0001 /*
0002     SPDX-FileCopyrightText: 2009-2010 Cristian Oneț <onet.cristian@gmail.com>
0003     SPDX-FileCopyrightText: 2009-2010 Alvaro Soliverez <asoliverez@gmail.com>
0004     SPDX-FileCopyrightText: 2011-2017 Thomas Baumgart <tbaumgart@kde.org>
0005     SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef KMYMONEYCASHFLOWCOMBO_H
0010 #define KMYMONEYCASHFLOWCOMBO_H
0011 
0012 // ----------------------------------------------------------------------------
0013 // QT Includes
0014 
0015 // ----------------------------------------------------------------------------
0016 // KDE Includes
0017 
0018 // ----------------------------------------------------------------------------
0019 // Project Includes
0020 
0021 #include "kmymoneymvccombo.h"
0022 
0023 namespace eMyMoney {
0024 namespace Account {
0025 enum class Type;
0026 }
0027 }
0028 namespace eWidgets {
0029 namespace eRegister {
0030 enum class CashFlowDirection;
0031 }
0032 }
0033 
0034 /**
0035   * @author Thomas Baumgart
0036   * This class implements a combo box with the possible states for
0037   * actions (Deposit, Withdrawal, etc.).
0038   */
0039 class KMyMoneyCashFlowComboPrivate;
0040 class KMM_WIDGETS_EXPORT KMyMoneyCashFlowCombo : public KMyMoneyMVCCombo
0041 {
0042     Q_OBJECT
0043     Q_DISABLE_COPY(KMyMoneyCashFlowCombo)
0044 
0045 public:
0046     /**
0047       * Create a combo box that contains the entries "Pay to", "From" and
0048       * "  " for don't care.
0049       */
0050     explicit KMyMoneyCashFlowCombo(eMyMoney::Account::Type type, QWidget *parent = nullptr);
0051     ~KMyMoneyCashFlowCombo() override;
0052 
0053     void setDirection(eWidgets::eRegister::CashFlowDirection dir);
0054     void reverseDirection();
0055     eWidgets::eRegister::CashFlowDirection direction() const;
0056 
0057     void removeDontCare();
0058 
0059 protected Q_SLOTS:
0060     void slotSetDirection(const QString& id);
0061 
0062 Q_SIGNALS:
0063     void directionSelected(eWidgets::eRegister::CashFlowDirection);
0064 
0065 private:
0066     Q_DECLARE_PRIVATE(KMyMoneyCashFlowCombo)
0067 };
0068 
0069 #endif