00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTACCOUNTSVIEW_H
00021 #define KPTACCOUNTSVIEW_H
00022
00023 #include "kptview.h"
00024
00025 #include <QDate>
00026 #include <QLabel>
00027
00028 #include "kptaccount.h"
00029 #include "kptcontext.h"
00030 #include "kpteffortcostmap.h"
00031 #include "kptdoublelistviewbase.h"
00032
00033 class QComboBox;
00034 class QPushButton;
00035 class QSplitter;
00036 class QTreeWidgetItem;
00037 class QLabel;
00038 class QPushButton;
00039
00040 class QTreeWidget;
00041 class QTreeWidgetItem;
00042 class KPrinter;
00043
00044 namespace KPlato
00045 {
00046
00047 class Account;
00048 class View;
00049 class Project;
00050 class Resource;
00051 class Node;
00052
00053 class ResourceGroup;
00054 class Resource;
00055 class ResourceItemPrivate;
00056
00057 class AccountsView : public ViewBase
00058 {
00059 Q_OBJECT
00060 public:
00061
00062 AccountsView( Project &project, View *view, QWidget *parent );
00063
00064
00065
00066 virtual void setZoom( double zoom );
00067
00068 virtual void draw();
00069 void print( KPrinter &printer );
00070
00071 virtual bool setContext( Context::Accountsview &context );
00072 virtual void getContext( Context::Accountsview &context ) const;
00073
00074 signals:
00075 void configChanged();
00076
00077 public slots:
00078 void slotConfigure();
00079
00080 protected slots:
00081 void slotUpdate();
00082
00083 protected:
00084 void getContextClosedItems( Context::Accountsview &context, QTreeWidgetItem *item ) const;
00085 void setContextClosedItems( Context::Accountsview &context );
00086
00087 private:
00088 class AccountItem : public DoubleListViewBase::MasterListItem
00089 {
00090 public:
00091 AccountItem( Account *a, QTreeWidget *parent, bool highlight = false );
00092 AccountItem( Account *a, QTreeWidgetItem *parent, bool highlight = false );
00093 AccountItem( QString text, Account *a, QTreeWidgetItem *parent, bool _highlight = false );
00094
00095 void add
00096 ( int col, const QDate &date, const EffortCost &ec );
00097
00098 Account *account;
00099 EffortCostMap costMap;
00100 };
00101
00102 void init();
00103 void initAccList( const AccountList &list );
00104 void initAccSubItems( Account *acc, AccountItem *parent );
00105 void initAccList( const AccountList &list, AccountItem *parent );
00106 void createPeriods();
00107 void clearPeriods();
00108 QString periodText( int offset );
00109
00110 private:
00111 Project &m_project;
00112 Accounts &m_accounts;
00113
00114 int m_defaultFontSize;
00115
00116 QDate m_date;
00117 int m_period;
00118 bool m_cumulative;
00119
00120 DoubleListViewBase *m_dlv;
00121
00122 QStringList m_periodTexts;
00123 QPushButton *m_changeBtn;
00124 QLabel *m_label;
00125
00126 };
00127
00128 }
00129
00130 #endif