Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/dialogs/kfindtransactiondlg.h
Context not available. | |||||
3 | ------------------- | 3 | ------------------- | ||
---|---|---|---|---|---|
4 | copyright : (C) 2003 by Thomas Baumgart | 4 | copyright : (C) 2003 by Thomas Baumgart | ||
5 | email : ipwizard@users.sourceforge.net | 5 | email : ipwizard@users.sourceforge.net | ||
6 | (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||||
6 | ***************************************************************************/ | 7 | ***************************************************************************/ | ||
7 | 8 | | |||
8 | /*************************************************************************** | 9 | /*************************************************************************** | ||
Context not available. | |||||
21 | // QT Includes | 22 | // QT Includes | ||
22 | 23 | | |||
23 | #include <QDialog> | 24 | #include <QDialog> | ||
24 | #include <QDate> | | |||
25 | #include <QMap> | | |||
26 | #include <QList> | | |||
27 | 25 | | |||
28 | // ---------------------------------------------------------------------------- | 26 | // ---------------------------------------------------------------------------- | ||
29 | // KDE Includes | 27 | // KDE Includes | ||
30 | 28 | | |||
31 | #include <QDialog> | | |||
32 | | ||||
33 | // ---------------------------------------------------------------------------- | 29 | // ---------------------------------------------------------------------------- | ||
34 | // Project Includes | 30 | // Project Includes | ||
35 | 31 | | |||
36 | #include "mymoneysplit.h" | | |||
37 | #include "mymoneytransaction.h" | | |||
38 | #include "mymoneytransactionfilter.h" | | |||
39 | | ||||
40 | class QTreeWidget; | | |||
41 | class QTreeWidgetItem; | 32 | class QTreeWidgetItem; | ||
42 | class DateRangeDlg; | 33 | | ||
34 | namespace Ui { class KSortOptionDlg; } | ||||
43 | 35 | | |||
44 | /** | 36 | /** | ||
45 | * @author Thomas Baumgart | 37 | * @author Thomas Baumgart | ||
46 | */ | 38 | */ | ||
47 | class KSortOptionDlg : public QDialog | 39 | class KSortOptionDlg : public QDialog | ||
48 | { | 40 | { | ||
41 | Q_OBJECT | ||||
42 | Q_DISABLE_COPY(KSortOptionDlg) | ||||
43 | | ||||
49 | public: | 44 | public: | ||
50 | KSortOptionDlg(QWidget *parent); | 45 | explicit KSortOptionDlg(QWidget *parent = nullptr); | ||
51 | ~KSortOptionDlg(); | 46 | ~KSortOptionDlg(); | ||
52 | void init(); | 47 | | ||
53 | void setSortOption(const QString& option, const QString& def); | 48 | void setSortOption(const QString& option, const QString& def); | ||
54 | QString sortOption() const; | 49 | QString sortOption() const; | ||
55 | void hideDefaultButton(); | 50 | void hideDefaultButton(); | ||
56 | 51 | | |||
57 | private: | 52 | private: | ||
58 | struct Private; | 53 | Ui::KSortOptionDlg *ui; | ||
59 | Private* const d; | | |||
60 | }; | 54 | }; | ||
61 | 55 | | |||
62 | namespace Ui | 56 | class KFindTransactionDlgPrivate; | ||
63 | { | | |||
64 | class KFindTransactionDlgDecl; | | |||
65 | } | | |||
66 | | ||||
67 | class KFindTransactionDlg : public QDialog | 57 | class KFindTransactionDlg : public QDialog | ||
68 | { | 58 | { | ||
69 | Q_OBJECT | 59 | Q_OBJECT | ||
60 | Q_DISABLE_COPY(KFindTransactionDlg) | ||||
70 | 61 | | |||
71 | public: | 62 | public: | ||
72 | /** | 63 | /** | ||
73 | @param withEquityAccounts set to false to hide equity accounts in account page | 64 | @param withEquityAccounts set to false to hide equity accounts in account page | ||
74 | */ | 65 | */ | ||
75 | KFindTransactionDlg(QWidget *parent = 0, bool withEquityAccounts = false); | 66 | explicit KFindTransactionDlg(QWidget *parent = nullptr, bool withEquityAccounts = false); | ||
76 | ~KFindTransactionDlg(); | 67 | virtual ~KFindTransactionDlg(); | ||
77 | 68 | | |||
78 | virtual bool eventFilter(QObject *o, QEvent *e); | 69 | bool eventFilter(QObject *o, QEvent *e) override; | ||
79 | | ||||
80 | protected: | | |||
81 | void resizeEvent(QResizeEvent*); | | |||
82 | void showEvent(QShowEvent* event); | | |||
83 | 70 | | |||
84 | protected slots: | 71 | protected slots: | ||
85 | virtual void slotReset(); | 72 | virtual void slotReset(); | ||
Context not available. | |||||
91 | */ | 78 | */ | ||
92 | virtual void slotShowHelp(); | 79 | virtual void slotShowHelp(); | ||
93 | 80 | | |||
94 | | ||||
95 | void slotUpdateSelections(); | 81 | void slotUpdateSelections(); | ||
96 | 82 | | |||
97 | virtual void slotAmountSelected(); | 83 | virtual void slotAmountSelected(); | ||
Context not available. | |||||
130 | void selectionNotEmpty(bool); | 116 | void selectionNotEmpty(bool); | ||
131 | 117 | | |||
132 | protected: | 118 | protected: | ||
133 | enum opTypeE { | 119 | KFindTransactionDlgPrivate * const d_ptr; | ||
134 | addAccountToFilter = 0, | 120 | KFindTransactionDlg(KFindTransactionDlgPrivate &dd, QWidget *parent, bool withEquityAccounts); | ||
135 | addCategoryToFilter, | | |||
136 | addPayeeToFilter, | | |||
137 | addTagToFilter | | |||
138 | }; | | |||
139 | | ||||
140 | void setupCategoriesPage(); | | |||
141 | void setupAccountsPage(bool withEquityAccounts=false); | | |||
142 | void setupAmountPage(); | | |||
143 | void setupPayeesPage(); | | |||
144 | void setupTagsPage(); | | |||
145 | void setupDetailsPage(); | | |||
146 | | ||||
147 | void setupFilter(); | | |||
148 | | ||||
149 | void selectAllItems(QTreeWidget* view, const bool state); | | |||
150 | void selectAllSubItems(QTreeWidgetItem* item, const bool state); | | |||
151 | void selectItems(QTreeWidget* view, const QStringList& list, const bool state); | | |||
152 | void selectSubItems(QTreeWidgetItem* item, const QStringList& list, const bool state); | | |||
153 | | ||||
154 | /** | | |||
155 | * This method loads the m_payeesView with the payees name | | |||
156 | * found in the engine. | | |||
157 | */ | | |||
158 | void loadPayees(); | | |||
159 | 121 | | |||
160 | /** | 122 | void resizeEvent(QResizeEvent*) override; | ||
161 | * This method loads the m_tagsView with the tags name | 123 | void showEvent(QShowEvent* event) override; | ||
162 | * found in the engine. | | |||
163 | */ | | |||
164 | void loadTags(); | | |||
165 | 124 | | |||
166 | /** | 125 | private: | ||
167 | * This method loads the register with the matching transactions | 126 | Q_DECLARE_PRIVATE(KFindTransactionDlg) | ||
168 | */ | | |||
169 | void loadView(); | | |||
170 | | ||||
171 | /** | | |||
172 | * This method returns information about the selection state | | |||
173 | * of the items in the m_accountsView. | | |||
174 | * | | |||
175 | * @param view pointer to the listview to scan | | |||
176 | * | | |||
177 | * @retval true if all items in the view are marked | | |||
178 | * @retval false if at least one item is not marked | | |||
179 | * | | |||
180 | * @note If the view contains no items the method returns @p true. | | |||
181 | */ | | |||
182 | bool allItemsSelected(const QTreeWidget* view) const; | | |||
183 | bool allItemsSelected(const QTreeWidgetItem *item) const; | | |||
184 | | ||||
185 | void scanCheckListItems(const QTreeWidget* view, const opTypeE op); | | |||
186 | void scanCheckListItems(const QTreeWidgetItem* item, const opTypeE op); | | |||
187 | void addItemToFilter(const opTypeE op, const QString& id); | | |||
188 | | ||||
189 | protected: | | |||
190 | QDate m_startDates[(int)eMyMoney::TransactionFilter::Date::LastDateItem]; | | |||
191 | QDate m_endDates[(int)eMyMoney::TransactionFilter::Date::LastDateItem]; | | |||
192 | | ||||
193 | /** | | |||
194 | * This member holds a list of all transactions matching the filter criteria | | |||
195 | */ | | |||
196 | QList<QPair<MyMoneyTransaction, MyMoneySplit> > m_transactionList; | | |||
197 | | ||||
198 | MyMoneyTransactionFilter m_filter; | | |||
199 | | ||||
200 | QMap<QWidget*, QString> m_helpAnchor; | | |||
201 | | ||||
202 | bool m_needReload; | | |||
203 | | ||||
204 | Ui::KFindTransactionDlgDecl* m_ui; | | |||
205 | DateRangeDlg *m_dateRange; | | |||
206 | }; | 127 | }; | ||
207 | 128 | | |||
208 | #endif | 129 | #endif | ||
Context not available. |