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

0001 /*
0002     SPDX-FileCopyrightText: 2015-2019 Thomas Baumgart <tbaumgart@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 
0007 #ifndef SIMPLELEDGERVIEW_H
0008 #define SIMPLELEDGERVIEW_H
0009 
0010 // ----------------------------------------------------------------------------
0011 // QT Includes
0012 
0013 // ----------------------------------------------------------------------------
0014 // KDE Includes
0015 
0016 // ----------------------------------------------------------------------------
0017 // Project Includes
0018 
0019 #include "kmymoneyviewbase.h"
0020 class SelectedObjects;
0021 
0022 class SimpleLedgerViewPrivate;
0023 class SimpleLedgerView : public KMyMoneyViewBase
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit SimpleLedgerView(QWidget *parent = nullptr);
0029     ~SimpleLedgerView() override;
0030 
0031     void updateActions(const SelectedObjects& selections) override;
0032     void executeAction(eMenu::Action action, const SelectedObjects& selections) override;
0033 
0034     bool hasClosableView() const override;
0035     void closeCurrentView() override;
0036 
0037 public Q_SLOTS:
0038     void showEvent(QShowEvent* event) override;
0039 
0040     void slotSettingsChanged() override;
0041 
0042 private Q_SLOTS:
0043     void tabSelected(int idx);
0044     void tabClicked(int idx);
0045     /**
0046      * Open the ledger of account @a accountId and make it the current ledger
0047      */
0048     void openLedger (QString accountId);
0049     void closeLedger(int idx);
0050     void checkTabOrder(int from, int to);
0051     void setupCornerWidget();
0052     void slotRequestSelectionChange(const SelectedObjects& selections) const;
0053 
0054     void sectionResized(QWidget* view, const QString& configGroupName, int section, int oldSize, int newSize) const;
0055     void sectionMoved(QWidget* view, int section, int oldIndex, int newIndex) const;
0056 
0057 protected:
0058     bool eventFilter(QObject* o, QEvent* e) override;
0059     void aboutToShow() override;
0060 
0061 Q_SIGNALS:
0062     void settingsChanged();
0063     void resizeSection(QWidget* view, const QString& configGroupName, int section, int oldSize, int newSize);
0064     void moveSection(QWidget* view, int section, int oldIndex, int newIndex);
0065 
0066 private:
0067     Q_DECLARE_PRIVATE(SimpleLedgerView)
0068 };
0069 
0070 #endif // SIMPLELEDGERVIEW_H
0071