kplato

kptresourceview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 - 2004 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 KPTRESOURCEVIEW_H
00021 #define KPTRESOURCEVIEW_H
00022 
00023 #include <qsplitter.h>
00024 #include <qdatetime.h>
00025 #include <qvaluelist.h>
00026 
00027 #include "kptcontext.h"
00028 
00029 class QPoint;
00030 class QListViewItem;
00031 
00032 class KPrinter;
00033 
00034 namespace KPlato
00035 {
00036 class ResListView;
00037 
00038 class View;
00039 class Project;
00040 class Resource;
00041 class Node;
00042 
00043 class ResourceAppointmentsView;
00044 class ResourceGroup;
00045 class Resource;
00046 class ResourceItemPrivate;
00047 
00048 
00049  class ResourceView : public QSplitter
00050 {
00051     Q_OBJECT
00052 
00053  public:
00054     ResourceView(View *view, QWidget *parent);
00055 
00056     //~ResourceView();
00057 
00058     void zoom(double zoom);
00059 
00060     void draw(Project &project);
00061     View *mainView();
00062 
00063     Resource *currentResource();
00064 
00065     QValueList<int> listOffsets(int pageHeight) const;
00066     void print(KPrinter &printer);
00067     
00068     Node *currentNode() const { return m_currentNode; }
00069     
00070     virtual bool setContext(Context::Resourceview &context);
00071     virtual void getContext(Context::Resourceview &context) const;
00072 
00073     virtual QSize sizeHint() const;
00074     
00075 public slots:
00076     void setShowAppointments(bool on) { m_showAppointments = on; }
00077 
00078 signals:
00079     void itemDoubleClicked();
00080     
00081 protected slots:
00082     void resSelectionChanged();
00083     void resSelectionChanged(QListViewItem *item);
00084     void slotItemDoubleClicked(QListViewItem*);
00085     void popupMenuRequested(QListViewItem * item, const QPoint & pos, int);
00086 
00087 private:
00088     void drawResources(const Project &proj, QListViewItem *parent, ResourceGroup *group);
00089 
00090 private:
00091     View *m_mainview;
00092     int m_defaultFontSize;
00093 
00094     ResourceItemPrivate *m_selectedItem;
00095     ResListView *resList;
00096     ResourceAppointmentsView *m_appview;
00097     Node *m_currentNode;
00098     QDate m_start;
00099     QDate m_end;
00100 
00101     bool m_showAppointments;
00102 
00103 };
00104 
00105 }  //KPlato namespace
00106 
00107 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys