KissCount/model/User.h

49 lines
887 B
C
Raw Normal View History

#ifndef USER_H
#define USER_H
#include <list>
2010-05-24 20:14:15 +02:00
#include <wx/wx.h>
2010-05-15 11:21:42 +02:00
#include "Preferences.h"
2010-05-16 10:35:34 +02:00
struct operation {
wxString id;
unsigned int day;
unsigned int month;
unsigned int year;
2010-05-27 21:09:02 +02:00
double amount;
2010-05-16 10:35:34 +02:00
wxString description;
wxString category;
bool fix_cost;
2010-05-16 20:09:18 +02:00
wxString account;
2010-05-16 10:35:34 +02:00
} ;
2010-05-24 20:14:15 +02:00
struct Account {
wxString id;
wxString name;
wxString number;
int amount;
bool shared;
bool _default;
};
class User
{
2010-05-15 11:21:42 +02:00
public:
~User();
wxString _id;
wxString _name;
wxString _password;
2010-05-24 20:14:15 +02:00
std::map<wxString, Account> _accounts;
2010-05-15 11:21:42 +02:00
std::map<unsigned int, std::map<unsigned int, std::list<operation> >* > _operations;
Preferences _preferences;
2010-05-24 20:14:15 +02:00
wxString GetCategoryName(wxString catId);
wxString GetAccountName(wxString accountId);
2010-05-27 21:09:02 +02:00
int GetCategoriesNumber();
2010-06-02 22:14:11 +02:00
int GetAccountsNumber();
int GetOperationsNumber(int month, int year);
};
#endif