kplato

kptaccountsview.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Dag Andersen <kplato@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPTACCOUNTSVIEW_H
21#define KPTACCOUNTSVIEW_H
22
23#include <tqdatetime.h>
24
25#include <tdelistview.h>
26
27#include "kptaccount.h"
28#include "kptcontext.h"
29#include "kpteffortcostmap.h"
30#include "kptdoublelistviewbase.h"
31
32class TQComboBox;
33class TQDateEdit;
34class TQPushButton;
35class TQSplitter;
36class TQListViewItem;
37class TQLabel;
38class TQPushButton;
39
40class TDEListView;
41class TDEListViewItem;
42class KPrinter;
43
44namespace KPlato
45{
46
47class Label;
48class Account;
49class View;
50class Project;
51class Resource;
52class Node;
53
54class ResourceGroup;
55class Resource;
56class ResourceItemPrivate;
57
58class AccountsView : public TQWidget
59{
60 TQ_OBJECT
61
62public:
63
64 AccountsView(Project &project, View *view, TQWidget *parent);
65
66 //~AccountsView();
67
68 void zoom(double zoom);
69
70 View *mainView() { return m_mainview; }
71 void draw();
72 void print(KPrinter &printer);
73
74 virtual bool setContext(Context::Accountsview &context);
75 virtual void getContext(Context::Accountsview &context) const;
76
77signals:
78 void update();
79
80public slots:
81 void slotConfigure();
82
83protected slots:
84 void slotUpdate();
85
86protected:
87 void getContextClosedItems(Context::Accountsview &context, TQListViewItem *item) const;
88 void setContextClosedItems(Context::Accountsview &context);
89
90private:
91 class AccountItem : public DoubleListViewBase::MasterListItem {
92 public:
93 AccountItem(Account *a, TQListView *parent, bool highlight=false);
94 AccountItem(Account *a, TQListViewItem *parent, bool highlight=false);
95 AccountItem(TQString text, Account *a, TQListViewItem *parent, bool _highlight=false);
96
97 void add(int col, const TQDate &date, const EffortCost &ec);
98
99 Account *account;
100 EffortCostMap costMap;
101 };
102
103 void init();
104 void initAccList(const AccountList &list);
105 void initAccSubItems(Account *acc, AccountItem *parent);
106 void initAccList(const AccountList &list, AccountItem *parent);
107 void createPeriods();
108 void clearPeriods();
109 TQString periodText(int offset);
110
111private:
112 View *m_mainview;
113 Project &m_project;
114 Accounts &m_accounts;
115
116 int m_defaultFontSize;
117
118 TQDate m_date;
119 int m_period;
120 bool m_cumulative;
121
122 DoubleListViewBase *m_dlv;
123
124 TQStringList m_periodTexts;
125 TQPushButton *m_changeBtn;
126 Label *m_label;
127
128};
129
130} //KPlato namespace
131
132#endif
Account holds one account.
Definition kptaccount.h:49
This class represents any node in the project, a node can be a project or a subproject or any task.
Definition kptnode.h:57
Project is the main node in a project, it contains child nodes and possibly sub-projects.
Definition kptproject.h:52
This class represents a group of similar resources to be assigned to a task e.g.
Definition kptresource.h:66
Any resource that is used by a task.