KissCount/model/User.h
2010-07-03 11:37:14 +02:00

63 lines
1.2 KiB
C++

#ifndef USER_H
#define USER_H
#include <map>
#include <vector>
#include <wx/wx.h>
#include <wx/colour.h>
struct operation {
wxString id;
unsigned int day;
unsigned int month;
unsigned int year;
double amount;
wxString description;
wxString category;
bool fix_cost;
wxString account;
bool checked;
} ;
struct account {
wxString id;
wxString name;
wxString number;
bool shared;
bool _default;
};
struct category
{
wxString id;
wxString parent;
wxString name;
wxColour color;
wxString font;
};
class User
{
public:
~User();
wxString _id;
wxString _name;
wxString _password;
std::vector<struct account> _accounts;
std::map<unsigned int, std::map<unsigned int, std::vector<struct operation> >* > _operations;
std::vector<struct category> _categories;
std::map<wxString, wxString> _preferences;
struct category GetCategory(wxString catId);
wxString GetCategoryName(wxString catId);
wxString GetCategoryId(wxString catName);
wxString GetAccountName(wxString accountId);
wxString GetAccountId(wxString accountName);
int GetCategoriesNumber();
int GetAccountsNumber();
int GetOperationsNumber(int month, int year);
};
#endif