kplato

kptresourceappointmentsview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Dag Andersen <danders@get2net.dk>
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 KPTRESOURCEAPPOINTMENTSVIEW_H
00021 #define KPTRESOURCEAPPOINTMENTSVIEW_H
00022 
00023 #include "kptcontext.h"
00024 #include "kptdoublelistviewbase.h"
00025 #include "kpteffortcostmap.h"
00026 
00027 class QComboBox;
00028 class QDateEdit;
00029 class QPushButton;
00030 class QSplitter;
00031 class QListView;
00032 class QListViewItem;
00033 class QLabel;
00034 class QPushButton;
00035 
00036 class KListView;
00037 class KListViewItem;
00038 class KPrinter;
00039 
00040 namespace KPlato
00041 {
00042 
00043 class View;
00044 class Project;
00045 class Resource;
00046 class Node;
00047 
00048 class ResourceGroup;
00049 class Resource;
00050 
00051 class ResourceAppointmentsView : public DoubleListViewBase
00052 {
00053     Q_OBJECT
00054 public:
00055 
00056     ResourceAppointmentsView(View *view, QWidget *parent);
00057 
00058     //~ResourceAppointmentsView();
00059 
00060     void zoom(double zoom);
00061 
00062     View *mainView() const { return m_mainview; }
00063     void draw(Resource *resource, const QDate &start, const QDate &end);
00064     void draw();
00065     void print(KPrinter &printer);
00066     void clear();
00067     
00068     //virtual bool setContext(Context::ResourceAppointmentsView &context);
00069     //virtual void getContext(Context::ResourceAppointmentsView &context) const;
00070 
00071     virtual void createSlaveItems();
00072     
00073 protected slots:
00074     void slotUpdate();
00075     
00076 private:
00077     class NodeItem : public DoubleListViewBase::MasterListItem {
00078     public:
00079         NodeItem(Node *n, QListView *parent, bool highlight=false);
00080         NodeItem(Node *n, QListViewItem *parent, bool highlight=false);
00081         NodeItem(QString text, QListView *parent, bool highlight=false);
00082         NodeItem(QString text, QListViewItem *parent, bool highlight=false);
00083         
00084         Node *node;
00085         EffortCostMap effortMap;
00086     };
00087     
00088 private:
00089     View *m_mainview;
00090     
00091     int m_defaultFontSize;
00092     Resource *m_resource;
00093     QDate m_start;
00094     QDate m_end;
00095     NodeItem *m_availItem;
00096     NodeItem *m_totalItem;
00097 };
00098 
00099 }  //KPlato namespace
00100 
00101 
00102 #endif // KPTTASKAPPOINTMENTSVIEW_H
KDE Home | KDE Accessibility Home | Description of Access Keys