Diffstat (limited to 'noncore/apps/qashmoney/account.h') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/account.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/noncore/apps/qashmoney/account.h b/noncore/apps/qashmoney/account.h new file mode 100755 index 0000000..f77f400 --- a/dev/null +++ b/noncore/apps/qashmoney/account.h | |||
@@ -0,0 +1,100 @@ | |||
1 | #ifndef ACCOUNT_H | ||
2 | #define ACCOUNT_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <qlistview.h> | ||
6 | #include <qcombobox.h> | ||
7 | #include <sqlite.h> | ||
8 | |||
9 | class Account | ||
10 | { | ||
11 | public: | ||
12 | |||
13 | Account (); | ||
14 | ~Account (); | ||
15 | |||
16 | // This function adds a new account to the database. It takes the account name, parent, | ||
17 | // initial balance and the account type, description, credit limit, statementbalancedate | ||
18 | // as three integers, and the statementbalance amount | ||
19 | // The parent is an integer account id. Its -1 if there is no parent | ||
20 | // The account types (so far) are 0=not defined 1=parent checking 2=child checking | ||
21 | void addAccount ( QString, int, float, int, QString, float, int, int, int, float, const char * ); | ||
22 | |||
23 | // updates certain parts of an account | ||
24 | void updateAccount ( QString name, QString description, QString currencycode, int accountid ); | ||
25 | |||
26 | void setAccountExpanded ( int expanded, int accountid ); | ||
27 | int getAccountExpanded ( int id ); | ||
28 | |||
29 | // Deletes an account | ||
30 | // Takes the accountid as its parameter | ||
31 | void deleteAccount ( int ); | ||
32 | |||
33 | // Returns the number of accounts | ||
34 | int getNumberOfAccounts (); | ||
35 | |||
36 | // returns number of child accounts for a given parent | ||
37 | // this function is useless for child accounts. It will | ||
38 | // always return 0 | ||
39 | int getNumberOfChildAccounts ( int ); | ||
40 | |||
41 | // This function retrieves all transactions for an account and updates the | ||
42 | // account balance based on the transactions | ||
43 | void updateAccountBalance ( int accountid ); | ||
44 | //void changeAccountBalance ( int accountid, float amount ); | ||
45 | |||
46 | // updates a parent account | ||
47 | void changeParentAccountBalance ( int parentid ); | ||
48 | |||
49 | // Returns the parent account ID for an account | ||
50 | // Takes the account name as its parameter or the account id | ||
51 | int getParentAccountID ( QString accountname ); | ||
52 | int getParentAccountID ( int id ); | ||
53 | |||
54 | // This takes a QListView and puts parents and children memorys | ||
55 | // into the list view | ||
56 | void displayAccounts ( QListView * ); | ||
57 | |||
58 | // This function displays a sorted list of account names in a combobox | ||
59 | // Takes the combobox address for its parameter | ||
60 | int displayParentAccountNames ( QComboBox *, QString ); | ||
61 | |||
62 | int getAccountType ( int ); // returns account type for given account id | ||
63 | |||
64 | // The next three collectively return a date or balance | ||
65 | // They take the accountid as their parameters | ||
66 | int getStatementDay ( int ); | ||
67 | int getStatementMonth ( int ); | ||
68 | int getStatementYear ( int ); | ||
69 | float getStatementBalance ( int ); | ||
70 | |||
71 | // Returns account description and name | ||
72 | QString getAccountDescription ( int accountid ); | ||
73 | QString getCurrencyCode ( int accountid ); | ||
74 | QString getAccountName ( int accountid ); | ||
75 | QStringList getAccountNames (); | ||
76 | QStringList getAccountIDs (); | ||
77 | QString getAccountBalance ( int accountid ); | ||
78 | |||
79 | // returns account credit limit | ||
80 | float getAccountCreditLimit ( int ); | ||
81 | |||
82 | // The primary database that stores all our data | ||
83 | sqlite *adb; | ||
84 | }; | ||
85 | |||
86 | class GreyBackgroundItem : public QListViewItem | ||
87 | { | ||
88 | public: | ||
89 | |||
90 | GreyBackgroundItem ( QListView *parent ); | ||
91 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3 ); | ||
92 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4 ); | ||
93 | GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5 ); | ||
94 | |||
95 | virtual void paintCell ( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); | ||
96 | |||
97 | }; | ||
98 | |||
99 | #endif | ||
100 | |||