File indexing completed on 2024-05-12 16:43:50

0001 /*
0002     SPDX-FileCopyrightText: 2000-2002 Michael Edwardes <mte@users.sourceforge.net>
0003     SPDX-FileCopyrightText: 2000-2002 Javier Campos Morales <javi_c@users.sourceforge.net>
0004     SPDX-FileCopyrightText: 2000-2002 Felix Rodriguez <frodriguez@users.sourceforge.net>
0005     SPDX-FileCopyrightText: 2000-2002 John C <thetacoturtle@users.sourceforge.net>
0006     SPDX-FileCopyrightText: 2000-2002 Thomas Baumgart <ipwizard@users.sourceforge.net>
0007     SPDX-FileCopyrightText: 2000-2002 Kevin Tambascio <ktambascio@users.sourceforge.net>
0008     SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 #ifndef KSCHEDULEDVIEW_H
0012 #define KSCHEDULEDVIEW_H
0013 
0014 // ----------------------------------------------------------------------------
0015 // QT Includes
0016 
0017 // ----------------------------------------------------------------------------
0018 // KDE Includes
0019 
0020 // ----------------------------------------------------------------------------
0021 // Project Includes
0022 
0023 #include "kmymoneyviewbase.h"
0024 
0025 class QTreeWidgetItem;
0026 class KTreeWidgetSearchLineWidget;
0027 class MyMoneySchedule;
0028 class MyMoneyAccount;
0029 
0030 namespace eDialogs {
0031 enum class ScheduleResultCode;
0032 }
0033 namespace eView {
0034 namespace Schedules {
0035 enum class Requester;
0036 }
0037 }
0038 
0039 /**
0040   * Contains all the scheduled transactions be they bills, deposits or transfers.
0041   * Encapsulates all the operations including adding, editing and deleting.
0042   * Used by the KMyMoneyView class to show the view.
0043   *
0044   * @author Michael Edwardes 2000-2002
0045   * $Id: kscheduledview.h,v 1.33 2009/03/01 19:13:08 ipwizard Exp $
0046   *
0047   * @short A class to encapsulate recurring transaction operations.
0048   */
0049 
0050 class KScheduledViewPrivate;
0051 class KScheduledView : public KMyMoneyViewBase
0052 {
0053     Q_OBJECT
0054 
0055 public:
0056     /**
0057       * Standard constructor for QWidgets.
0058       */
0059     explicit KScheduledView(QWidget *parent = nullptr);
0060 
0061     /**
0062       * Standard destructor.
0063       */
0064     ~KScheduledView() override;
0065 
0066     void executeCustomAction(eView::Action action) override;
0067     void refresh();
0068     void updateActions(const MyMoneyObject& obj);
0069 
0070     // TODO: remove that function
0071     /**
0072      * ugly proxy function
0073      */
0074     eDialogs::ScheduleResultCode enterSchedule(MyMoneySchedule& schedule, bool autoEnter, bool extendedKeys);
0075 
0076 public Q_SLOTS:
0077     void slotSelectSchedule(const QString& schedule);
0078     void slotShowScheduleMenu(const MyMoneySchedule& sch);
0079     void slotEditSchedule();
0080 
0081     void slotEnterOverdueSchedules(const MyMoneyAccount& acc);
0082 
0083     void slotSelectByObject(const MyMoneyObject& obj, eView::Intent intent) override;
0084 
0085 Q_SIGNALS:
0086     void enterOverdueSchedulesFinished(eView::Schedules::Requester req);
0087 
0088 protected:
0089     void showEvent(QShowEvent* event) override;
0090 
0091 private:
0092     Q_DECLARE_PRIVATE(KScheduledView)
0093 
0094 private Q_SLOTS:
0095 
0096     void customContextMenuRequested(const QPoint);
0097     void slotListItemExecuted(QTreeWidgetItem*, int);
0098 
0099     void slotAccountActivated();
0100 
0101     void slotListViewCollapsed(QTreeWidgetItem* item);
0102     void slotListViewExpanded(QTreeWidgetItem* item);
0103 
0104     void slotTimerDone();
0105 
0106     void slotSetSelectedItem();
0107 
0108     void slotRearrange();
0109 
0110     void slotNewSchedule();
0111     void slotDeleteSchedule();
0112     void slotDuplicateSchedule();
0113     void slotEnterSchedule();
0114     void slotSkipSchedule();
0115 };
0116 
0117 #endif