kplato

kptview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
00003    Copyright (C) 2002 - 2005 Dag Andersen <danders@get2net.dk>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KPLATO_VIEW
00022 #define KPLATO_VIEW
00023 
00024 #include <KoView.h>
00025 #include "kptcontext.h"
00026 
00027 class QListViewItem;
00028 class QPopupMenu;
00029 class QHBoxLayout;
00030 class QTabWidget;
00031 class QWidgetStack;
00032 
00033 class KListView;
00034 class KPrinter;
00035 class KAction;
00036 class KActionMenu;
00037 class KSelectAction;
00038 class KToggleAction;
00039 class KRadioAction;
00040 class KStatusBarLabel;
00041 
00042 class DCOPObject;
00043 
00044 namespace KPlato
00045 {
00046 
00047 class AccountsView;
00048 class GanttView;
00049 class PertView;
00050 class ResourceView;
00051 //class ReportView;
00052 class Part;
00053 class Node;
00054 class Project;
00055 class Relation;
00056 class Context;
00057 
00058 class View : public KoView {
00059     Q_OBJECT
00060 
00061 public:
00062     View(Part* part, QWidget* parent=0, const char* name=0);
00063     ~View();
00067     virtual void setZoom(double zoom);
00068 
00069     Part *getPart()const;
00070 
00071     Project& getProject() const;
00072 
00073     virtual void setupPrinter(KPrinter &printer);
00074     virtual void print(KPrinter &printer);
00075 
00076     QPopupMenu *popupMenu(const QString& name);
00077 
00078     void projectCalculate();
00079 
00080     virtual DCOPObject* dcopObject();
00081    
00082     virtual bool setContext(Context &context);
00083     virtual void getContext(Context &context) const;
00084 
00085     void setTaskActionsEnabled(QWidget *w, bool on);
00086     void setScheduleActionsEnabled();
00087     
00088 public slots:
00089     void slotUpdate(bool calculate);
00090     void slotEditResource();
00091     void slotEditCut();
00092     void slotEditCopy();
00093     void slotEditPaste();
00094     void slotViewGantt();
00095     void slotViewExpected();
00096     void slotViewOptimistic();
00097     void slotViewPessimistic();
00098     
00099     void slotViewGanttResources();
00100     void slotViewGanttTaskName();
00101     void slotViewGanttTaskLinks();
00102     void slotViewGanttProgress();
00103     void slotViewGanttFloat();
00104     void slotViewGanttCriticalTasks();
00105     void slotViewGanttCriticalPath();
00106     void slotViewGanttNoInformation();
00107     void slotViewTaskAppointments();
00108     void slotViewPert();
00109     void slotViewResources();
00110     void slotViewResourceAppointments();
00111     void slotViewAccounts();
00112     void slotAddTask();
00113     void slotAddSubTask();
00114     void slotAddMilestone();
00115     void slotProjectEdit();
00116     void slotDefineWBS();
00117     void slotGenerateWBS();
00118     void slotConfigure();
00119     void slotAddRelation(Node *par, Node *child);
00120     void slotModifyRelation(Relation *rel);
00121     void slotAddRelation(Node *par, Node *child, int linkType);
00122     void slotModifyRelation(Relation *rel, int linkType);
00123   
00124     void setBaselineMode(bool on);
00125     
00126     void slotExportGantt(); // testing
00127     void setTaskActionsEnabled(bool on);
00128     
00129     void slotRenameNode(Node *node, const QString& name);
00130     
00131     void slotPopupMenu(const QString& menuname, const QPoint & pos);
00132     
00133 protected slots:
00134     void slotProjectCalendar();
00135     void slotProjectWorktime();
00136     void slotProjectCalculate();
00137     void slotProjectCalculateExpected();
00138     void slotProjectCalculateOptimistic();
00139     void slotProjectCalculatePessimistic();
00140     void slotProjectAccounts();
00141     void slotProjectResources();
00142     void slotViewReportDesign();
00143     void slotViewReports();
00144 
00145     void slotOpenNode();
00146     void slotTaskProgress();
00147     void slotDeleteTask();
00148     void slotIndentTask();
00149     void slotUnindentTask();
00150     void slotMoveTaskUp();
00151     void slotMoveTaskDown();
00152 
00153     void slotConnectNode();
00154     void slotChanged(QWidget *);
00155     void slotChanged();
00156 
00157     void slotAboutToShow(QWidget *widget);
00158 
00159 #ifndef NDEBUG
00160     void slotPrintDebug();
00161     void slotPrintSelectedDebug();
00162     void slotPrintCalendarDebug();
00163     void slotPrintTestDebug();
00164 #else
00165     static void slotPrintDebug() { };
00166     static void slotPrintSelectedDebug() { };
00167     static void slotPrintCalendarDebug() { };
00168     static void slotPrintTestDebug() { };
00169 #endif
00170 
00171 protected:
00172     virtual void updateReadWrite(bool readwrite);
00173     Node *currentTask();
00174     void updateView(QWidget *widget);
00175 
00176 private:
00177     GanttView *m_ganttview;
00178     QHBoxLayout *m_ganttlayout;
00179     PertView *m_pertview;
00180     QHBoxLayout *m_pertlayout;
00181     QWidgetStack *m_tab;
00182     ResourceView *m_resourceview;
00183     AccountsView *m_accountsview;
00184 //    ReportView *m_reportview;
00185     QPtrList<QString> m_reportTemplateFiles;
00186 
00187     bool m_baselineMode;
00188     
00189     int m_viewGrp;
00190     int m_defaultFontSize;
00191     int m_currentEstimateType;
00192     
00193     bool m_updateGanttview;
00194     bool m_updateResourceview;
00195     bool m_updateAccountsview;
00196 
00197     KStatusBarLabel *m_estlabel;
00198 
00199     DCOPObject* m_dcop;
00200     
00201     // ------ Edit
00202     KAction *actionCut;
00203     KAction *actionCopy;
00204     KAction *actionPaste;
00205 
00206     KAction *actionIndentTask;
00207     KAction *actionUnindentTask;
00208     KAction *actionMoveTaskUp;
00209     KAction *actionMoveTaskDown;
00210     
00211     // ------ View
00212     KAction *actionViewGantt;
00213     KRadioAction *actionViewExpected;
00214     KRadioAction *actionViewOptimistic;
00215     KRadioAction *actionViewPessimistic;
00216     
00217     KToggleAction *actionViewGanttResources;
00218     KToggleAction *actionViewGanttTaskName;
00219     KToggleAction *actionViewGanttTaskLinks;
00220     KToggleAction *actionViewGanttProgress;
00221     KToggleAction *actionViewGanttFloat;
00222     KToggleAction *actionViewGanttCriticalTasks;
00223     KToggleAction *actionViewGanttCriticalPath;
00224     KToggleAction *actionViewGanttNotScheduled;
00225     KToggleAction *actionViewTaskAppointments;
00226     KAction *actionViewPert;
00227     KAction *actionViewResources;
00228     KToggleAction *actionViewResourceAppointments;
00229     KAction *actionViewAccounts;
00230     KAction *actionViewReports;
00231     
00232     // ------ Insert
00233     KAction *actionAddTask;
00234     KAction *actionAddSubtask;
00235     KAction *actionAddMilestone;
00236     
00237     // ------ Project
00238     KAction *actionEditMainProject;
00239     KAction *actionEditStandardWorktime;
00240     KAction *actionEditCalendar;
00241     KAction *actionEditAccounts;
00242     KAction *actionEditResources;
00243     KActionMenu *actionCalculate;
00244     KAction *actionCalculateExpected;
00245     KAction *actionCalculateOptimistic;
00246     KAction *actionCalculatePessimistic;
00247     // ------ Reports
00248     KAction *actionFirstpage;
00249     KAction *actionPriorpage;
00250     KAction *actionNextpage;
00251     KAction *actionLastpage;
00252     
00253     // ------ Tools
00254     KAction *actionDefineWBS;
00255     KAction *actionGenerateWBS;
00256     
00257     // ------ Export (testing)
00258     KAction *actionExportGantt;
00259     
00260     // ------ Settings
00261     KAction *actionConfigure;
00262 
00263     // ------ Popup
00264     KAction *actionOpenNode;
00265     KAction *actionTaskProgress;
00266     KAction *actionDeleteTask;
00267     KAction *actionEditResource;
00268 
00269     //Test
00270     KAction *actNoInformation;
00271 };
00272 
00273 } //Kplato namespace
00274 
00275 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys