KissCount/model/User.h

63 lines
1.2 KiB
C
Raw Normal View History

#ifndef USER_H
#define USER_H
2010-06-22 12:29:36 +02:00
#include <map>
2010-06-03 18:28:38 +02:00
#include <vector>
2010-05-24 20:14:15 +02:00
#include <wx/wx.h>
#include <wx/colour.h>
2010-05-16 10:35:34 +02:00
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;
2010-05-16 10:35:34 +02:00
} ;
struct account {
2010-05-24 20:14:15 +02:00
wxString id;
wxString name;
wxString number;
bool shared;
bool _default;
};
struct category
{
wxString id;
wxString parent;
wxString name;
wxColour color;
wxString font;
2010-05-24 20:14:15 +02:00
};
class User
{
2010-05-15 11:21:42 +02:00
public:
~User();
wxString _id;
wxString _name;
wxString _password;
std::vector<struct account> _accounts;
2010-07-03 11:37:14 +02:00
std::map<unsigned int, std::map<unsigned int, std::vector<struct operation> >* > _operations;
std::vector<struct category> _categories;
std::map<wxString, wxString> _preferences;
2010-05-24 20:14:15 +02:00
2010-06-22 12:29:36 +02:00
struct category GetCategory(wxString catId);
2010-05-24 20:14:15 +02:00
wxString GetCategoryName(wxString catId);
2010-06-03 18:28:38 +02:00
wxString GetCategoryId(wxString catName);
2010-05-24 20:14:15 +02:00
wxString GetAccountName(wxString accountId);
2010-06-03 18:28:38 +02:00
wxString GetAccountId(wxString accountName);
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