File indexing completed on 2024-05-12 16:43:48
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 0012 #ifndef KINVESTMENTVIEW_H 0013 #define KINVESTMENTVIEW_H 0014 0015 // ---------------------------------------------------------------------------- 0016 // QT Includes 0017 0018 // ---------------------------------------------------------------------------- 0019 // KDE Includes 0020 0021 // ---------------------------------------------------------------------------- 0022 // Project Includes 0023 0024 #include "kmymoneyviewbase.h" 0025 0026 class MyMoneyAccount; 0027 class MyMoneyObject; 0028 0029 /** 0030 * @author Kevin Tambascio 0031 * @author Łukasz Wojniłowicz 0032 */ 0033 class KInvestmentViewPrivate; 0034 class KInvestmentView : public KMyMoneyViewBase 0035 { 0036 Q_OBJECT 0037 0038 public: 0039 explicit KInvestmentView(QWidget *parent = nullptr); 0040 ~KInvestmentView() override; 0041 0042 void executeCustomAction(eView::Action action) override; 0043 void setDefaultFocus(); 0044 void refresh(); 0045 void updateActions(const MyMoneyObject &obj); 0046 0047 public Q_SLOTS: 0048 /** 0049 * This slot is used to preselect investment account from ledger view 0050 */ 0051 void slotSelectAccount(const MyMoneyObject &obj); 0052 0053 void slotShowInvestmentMenu(const MyMoneyAccount& acc); 0054 void slotSelectByObject(const MyMoneyObject& obj, eView::Intent intent) override; 0055 0056 protected: 0057 void showEvent(QShowEvent* event) override; 0058 0059 private: 0060 Q_DECLARE_PRIVATE(KInvestmentView) 0061 0062 private Q_SLOTS: 0063 /** 0064 * This slot is used to reload (filters + equities account) specific tab 0065 */ 0066 void slotLoadTab(int index); 0067 0068 void slotEquitySelected(const QModelIndex ¤t, const QModelIndex &previous); 0069 void slotSecuritySelected(const QModelIndex ¤t, const QModelIndex &previous); 0070 0071 void slotNewInvestment(); 0072 void slotEditInvestment(); 0073 void slotDeleteInvestment(); 0074 void slotUpdatePriceOnline(); 0075 void slotUpdatePriceManually(); 0076 0077 void slotEditSecurity(); 0078 void slotDeleteSecurity(); 0079 0080 /** 0081 * This slot is used to programatically preselect account in investment view 0082 */ 0083 void slotSelectAccount(const QString &id); 0084 0085 /** 0086 * This slot is used to load investment account into tree view 0087 */ 0088 void slotLoadAccount(const QString &id); 0089 0090 void slotInvestmentMenuRequested(const QPoint&); 0091 }; 0092 0093 #endif