F:/KPlato/koffice/kplato/kptaccountsview.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002   Copyright (C) 2005 Dag Andersen <kplato@kde.org>
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License as published by the Free Software Foundation; either
00007   version 2 of the License, or (at your option) any later version.
00008 
00009   This library is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012   Library General Public License for more details.
00013 
00014   You should have received a copy of the GNU Library General Public License
00015   along with this library; see the file COPYING.LIB.  If not, write to
00016   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017   Boston, MA 02110-1301, USA.
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     //~AccountsView();
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 }  //KPlato namespace
00129 
00130 #endif

Généré le Wed Nov 22 23:40:55 2006 pour KPlato par  doxygen 1.5.1-p1