-
Notifications
You must be signed in to change notification settings - Fork 0
/
jbudget.h
51 lines (36 loc) · 1.06 KB
/
jbudget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef JBUDGET_H
#define JBUDGET_H
#include <QFile>
#include "jcategory.h"
#include "jtransactionlist.h"
#define VERSION 0x000001
class jBudget
{
QFile * mBudgetFile;
float mIncome;
float mBank;
jTransactionList* mTransList;
QList<jCategory*> mCategories;
void readBudget();
void writeTransactions();
void readTransactions();
void writeCategories();
void readCategories();
public:
jBudget(QString fileName);
~jBudget();
float getIncome(){ return mIncome; }
void setIncome(float income){ mIncome = income; }
float getBank(){ return mBank; }
void setBank(float bank){ mBank = bank; }
jTransactionList * getTransactionList();
void addCategory(QString heading, float amount);
void removeCategory(QString heading);
jCategory* getCategory(QString heading);
float sumCategories();
QList<jCategory*> getCategories(){ return mCategories; }
QString getPath();
bool save();
bool save(QString fileName);
};
#endif // JBUDGET_H