kplato

kptresourceappointmentsview.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Dag Andersen <danders@get2net.dk>
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 KPTRESOURCEAPPOINTMENTSVIEW_H
21#define KPTRESOURCEAPPOINTMENTSVIEW_H
22
23#include "kptcontext.h"
24#include "kptdoublelistviewbase.h"
25#include "kpteffortcostmap.h"
26
27class TQComboBox;
28class TQDateEdit;
29class TQPushButton;
30class TQSplitter;
31class TQListView;
32class TQListViewItem;
33class TQLabel;
34class TQPushButton;
35
36class TDEListView;
37class TDEListViewItem;
38class KPrinter;
39
40namespace KPlato
41{
42
43class View;
44class Project;
45class Resource;
46class Node;
47
48class ResourceGroup;
49class Resource;
50
51class ResourceAppointmentsView : public DoubleListViewBase
52{
53 TQ_OBJECT
54
55public:
56
57 ResourceAppointmentsView(View *view, TQWidget *parent);
58
59 //~ResourceAppointmentsView();
60
61 void zoom(double zoom);
62
63 View *mainView() const { return m_mainview; }
64 void draw(Resource *resource, const TQDate &start, const TQDate &end);
65 void draw();
66 void print(KPrinter &printer);
67 void clear();
68
69 //virtual bool setContext(Context::ResourceAppointmentsView &context);
70 //virtual void getContext(Context::ResourceAppointmentsView &context) const;
71
72 virtual void createSlaveItems();
73
74protected slots:
75 void slotUpdate();
76
77private:
78 class NodeItem : public DoubleListViewBase::MasterListItem {
79 public:
80 NodeItem(Node *n, TQListView *parent, bool highlight=false);
81 NodeItem(Node *n, TQListViewItem *parent, bool highlight=false);
82 NodeItem(TQString text, TQListView *parent, bool highlight=false);
83 NodeItem(TQString text, TQListViewItem *parent, bool highlight=false);
84
85 Node *node;
86 EffortCostMap effortMap;
87 };
88
89private:
90 View *m_mainview;
91
92 int m_defaultFontSize;
93 Resource *m_resource;
94 TQDate m_start;
95 TQDate m_end;
96 NodeItem *m_availItem;
97 NodeItem *m_totalItem;
98};
99
100} //KPlato namespace
101
102
103#endif // KPTTASKAPPOINTMENTSVIEW_H