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

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 KMYMONEYPAYEECOMBO_H
0010 #define KMYMONEYPAYEECOMBO_H
0011 
0012 // ----------------------------------------------------------------------------
0013 // QT Includes
0014 
0015 // ----------------------------------------------------------------------------
0016 // KDE Includes
0017 
0018 // ----------------------------------------------------------------------------
0019 // Project Includes
0020 
0021 #include "kmymoneymvccombo.h"
0022 
0023 class MyMoneyPayee;
0024 
0025 /**
0026   * This class implements a text based payee selector.
0027   * When initially used, the widget has the functionality of a KComboBox object.
0028   * Whenever a key is pressed, the set of loaded payees is searched for
0029   * payees names which match the currently entered text.
0030   *
0031   * If any match is found a list selection box is opened and the user can use
0032   * the up/down, page-up/page-down keys or the mouse to navigate in the list. If
0033   * a payee is selected, the selection box is closed. Other key-strokes are
0034   * directed to the parent object to manipulate the text.  The visible contents of
0035   * the selection box is updated with every key-stroke.
0036   *
0037   * This object is a replacement of the KMyMoneyPayee object and should be used
0038   * for new code.
0039   *
0040   * @author Thomas Baumgart
0041   */
0042 class KMM_WIDGETS_EXPORT KMyMoneyPayeeCombo : public KMyMoneyMVCCombo
0043 {
0044     Q_OBJECT
0045     Q_DISABLE_COPY(KMyMoneyPayeeCombo)
0046 
0047 public:
0048     explicit KMyMoneyPayeeCombo(QWidget* parent = nullptr);
0049     ~KMyMoneyPayeeCombo() override;
0050 
0051     void loadPayees(const QList<MyMoneyPayee>& list);
0052 };
0053 
0054 #endif