OSDN Git Service

fix compile problem
[tjqt4port/tj2qt4.git] / taskjuggler / Account.h
1 /*
2  * Account.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * $Id$
11  */
12
13 #ifndef _Account_h_
14 #define _Account_h_
15
16 #include "AccountList.h"
17 #include "TransactionList.h"
18
19 class Interval;
20
21 /**
22  * @short Stores all account related information.
23  * @author Chris Schlaeger <cs@kde.org>
24  */
25 class Account : public CoreAttributes
26 {
27 public:
28     Account(Project* p, const QString& i, const QString& n, Account* pr,
29             AccountType at, const QString& df = QString::null, uint dl = 0);
30     virtual ~Account();
31
32     virtual CAType getType() const { return CA_Account; }
33
34     Account* getParent() const { return static_cast<Account*>(parent); }
35
36     AccountListIterator getSubListIterator() const
37     {
38         return AccountListIterator(*sub);
39     }
40
41     void inheritValues();
42
43     void setAcctType(AccountType at) { acctType = at; }
44     AccountType getAcctType() const { return acctType; }
45
46     void credit(Transaction* t);
47     bool isGroup() const { return !sub->isEmpty(); }
48
49     double getBalance(int sc, time_t d) const;
50     double getVolume(int sc, const Interval& period) const;
51
52 private:
53     TransactionList transactions;
54     AccountType acctType;
55 } ;
56
57 #endif