KissCount/src/view/AccountPanel.hpp

98 lines
2.8 KiB
C++
Raw Permalink Normal View History

2011-09-04 19:25:53 +02:00
/*
2012-02-01 11:02:54 +01:00
Copyright 2010-2012 Grégory Soutadé
2011-09-04 19:25:53 +02:00
This file is part of KissCount.
KissCount is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
KissCount is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACCOUNTPANEL_H
#define ACCOUNTPANEL_H
2011-09-04 21:01:32 +02:00
#include <QTreeWidget>
2011-09-06 19:47:02 +02:00
#include <QCalendarWidget>
2011-09-13 21:39:22 +02:00
#include <QTableWidget>
#include <QRadioButton>
2011-09-21 20:47:54 +02:00
#include <QStandardItemModel>
2011-09-04 21:01:32 +02:00
2011-09-04 19:25:53 +02:00
#include "view.hpp"
#include <model/model.hpp>
2011-10-20 11:11:59 +02:00
#include "grid/GridAccount.hpp"
2013-02-26 12:17:35 +01:00
#include "CostRepartitionBanner.hpp"
2011-09-04 19:25:53 +02:00
class GridAccount;
class AccountPanel: public KissPanel
{
Q_OBJECT;
public:
AccountPanel(KissCount* kiss, wxUI *parent, bool lowResolution);
AccountPanel(KissCount* kiss, wxUI *parent, bool lowResolution, int month, int year, int mode);
2011-09-04 19:25:53 +02:00
~AccountPanel();
void Init(KissCount* kiss, wxUI *parent, int curMode);
2011-09-04 19:25:53 +02:00
KissPanel* CreatePanel();
QString GetToolTip();
void OnShow();
void ChangeUser();
void LoadYear(int year, bool showMonth=true);
void ShowMonth(int month, int year);
void GenerateMonth(int month, int year);
void UpdateStats();
2011-09-04 19:25:53 +02:00
2011-09-21 20:47:54 +02:00
int _curMonth, _curYear;
private slots:
2011-09-04 19:25:53 +02:00
void OnOperationModified();
void OnAccountModified(int row, int column);
2011-10-31 09:15:37 +01:00
void OnTreeRightClick(const QPoint & pos);
2011-10-24 21:05:12 +02:00
void OnTreeChange (QTreeWidgetItem * item, int column);
2011-09-04 19:25:53 +02:00
void OnMenuGenerate();
void OnMenuDelete();
void OnCalendarChange();
void OnModeChange();
void OnGroup();
void OnUnGroup();
void OnUpdateNextMonths();
void OnSnapshots();
2011-09-04 19:25:53 +02:00
private:
2011-09-04 21:01:32 +02:00
QTreeWidget *_tree;
2011-09-06 19:47:02 +02:00
QCalendarWidget* _calendar;
2011-10-20 11:11:59 +02:00
GridAccount* _grid;
2011-09-13 21:39:22 +02:00
QTableWidget* _accountsGrid, *_statsGrid;
2013-02-26 12:17:35 +01:00
CostRepartitionBanner* _costRepartitionBanner;
2014-11-10 11:54:28 +01:00
int *_categoriesValues, *_tagsValues;
2011-09-04 19:25:53 +02:00
// wxRadioBox *_radioMode;
std::map<QString, int> _categoriesIndexes;
2014-11-10 11:54:28 +01:00
std::map<QString, int> _tagsIndexes;
2011-09-04 19:25:53 +02:00
std::vector<Operation>* _curOperations;
2014-11-10 11:54:28 +01:00
QString* _categories, *_tags, *_accounts;
2012-04-30 21:15:51 +02:00
std::map<int, int> _accountsInitValues;
2011-09-04 19:25:53 +02:00
int _fixCosts;
2011-09-13 21:39:22 +02:00
QRadioButton *_virtual, *_real, *_check;
bool _inModification;
2011-09-04 19:25:53 +02:00
void InitStatsGrid(User* user);
void InitAccountsGrid(User* user, int month, int year);
void InsertOperation(User* user, Operation* op, int line, bool fix);
void GetTreeSelection(int* month, int* year);
};
#endif