kplato

kptresourceview.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 - 2004 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 KPTRESOURCEVIEW_H
21#define KPTRESOURCEVIEW_H
22
23#include <tqsplitter.h>
24#include <tqdatetime.h>
25#include <tqvaluelist.h>
26
27#include "kptcontext.h"
28
29class TQPoint;
30class TQListViewItem;
31
32class KPrinter;
33
34namespace KPlato
35{
36class ResListView;
37
38class View;
39class Project;
40class Resource;
41class Node;
42
43class ResourceAppointmentsView;
44class ResourceGroup;
45class Resource;
46class ResourceItemPrivate;
47
48
49 class ResourceView : public TQSplitter
50{
51 TQ_OBJECT
52
53
54 public:
55 ResourceView(View *view, TQWidget *parent);
56
57 //~ResourceView();
58
59 void zoom(double zoom);
60
61 void draw(Project &project);
62 View *mainView();
63
64 Resource *currentResource();
65
66 TQValueList<int> listOffsets(int pageHeight) const;
67 void print(KPrinter &printer);
68
69 Node *currentNode() const { return m_currentNode; }
70
71 virtual bool setContext(Context::Resourceview &context);
72 virtual void getContext(Context::Resourceview &context) const;
73
74 virtual TQSize sizeHint() const;
75
76public slots:
77 void setShowAppointments(bool on) { m_showAppointments = on; }
78
79signals:
80 void itemDoubleClicked();
81
82protected slots:
83 void resSelectionChanged();
84 void resSelectionChanged(TQListViewItem *item);
85 void slotItemDoubleClicked(TQListViewItem*);
86 void popupMenuRequested(TQListViewItem * item, const TQPoint & pos, int);
87
88private:
89 void drawResources(const Project &proj, TQListViewItem *parent, ResourceGroup *group);
90
91private:
92 View *m_mainview;
93 int m_defaultFontSize;
94
95 ResourceItemPrivate *m_selectedItem;
96 ResListView *resList;
97 ResourceAppointmentsView *m_appview;
98 Node *m_currentNode;
99 TQDate m_start;
100 TQDate m_end;
101
102 bool m_showAppointments;
103
104};
105
106} //KPlato namespace
107
108#endif