00001 /* This file is part of the KDE project 00002 Copyright (C) 2004 - 2006 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; 00007 version 2 of the License. 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 KPTTASKGENERALPANEL_H 00021 #define KPTTASKGENERALPANEL_H 00022 00023 #include "ui_kpttaskgeneralpanelbase.h" 00024 #include "kptduration.h" 00025 00026 #include <QWidget> 00027 00028 class KMacroCommand; 00029 00030 namespace KPlato 00031 { 00032 00033 class TaskGeneralPanel; 00034 class RequestResourcesPanel; 00035 class Part; 00036 class Task; 00037 class StandardWorktime; 00038 class DurationWidget; 00039 00040 class TaskGeneralPanelImpl : public QWidget, public Ui_TaskGeneralPanelBase 00041 { 00042 Q_OBJECT 00043 public: 00044 TaskGeneralPanelImpl(QWidget *parent, const char *name); 00045 00046 virtual int schedulingType() const; 00047 virtual int estimationType() const; 00048 virtual int optimistic() const; 00049 virtual int pessimistic(); 00050 virtual Duration estimationValue(); 00051 virtual QDateTime startDateTime(); 00052 virtual QDateTime endDateTime(); 00053 virtual QTime startTime() const; 00054 virtual QTime endTime(); 00055 virtual QDate startDate(); 00056 virtual QDate endDate(); 00057 virtual int risktype() const; 00058 00059 DurationWidget *estimate; 00060 00061 public slots: 00062 virtual void setSchedulingType( int type ); 00063 virtual void changeLeader(); 00064 virtual void setEstimationType( int type ); 00065 virtual void setOptimistic( int value ); 00066 virtual void setPessimistic( int value ); 00067 virtual void enableDateTime( int scheduleType ); 00068 virtual void estimationTypeChanged( int type ); 00069 virtual void setEstimate( const Duration & duration ); 00070 virtual void setEstimateType( int type ); 00071 virtual void checkAllFieldsFilled(); 00072 virtual void setEstimateFields( int mask ); 00073 virtual void setEstimateScales( double day ); 00074 virtual void setEstimateFieldUnit( int field, QString unit ); 00075 virtual void startDateChanged(); 00076 virtual void startTimeChanged( const QTime & time ); 00077 virtual void endDateChanged(); 00078 virtual void endTimeChanged( const QTime & time ); 00079 virtual void scheduleTypeChanged( int value ); 00080 virtual void setStartTime( const QTime & time ); 00081 virtual void setEndTime( const QTime & time ); 00082 virtual void setStartDateTime( const QDateTime & dt ); 00083 virtual void setEndDateTime( const QDateTime & dt ); 00084 virtual void setStartDate( const QDate & date ); 00085 virtual void setEndDate( const QDate & date ); 00086 virtual void setRisktype( int r ); 00087 00088 signals: 00089 void obligatedFieldsFilled( bool ); 00090 void schedulingTypeChanged( int ); 00091 void changed(); 00092 00093 protected: 00094 bool useTime; 00095 }; 00096 00097 class TaskGeneralPanel : public TaskGeneralPanelImpl { 00098 Q_OBJECT 00099 public: 00100 TaskGeneralPanel(Task &task, StandardWorktime *workTime=0, QWidget *parent=0, const char *name=0); 00101 00102 KMacroCommand *buildCommand(Part *part); 00103 00104 bool ok(); 00105 00106 void setStartValues(Task &task, StandardWorktime *workTime=0); 00107 00108 public slots: 00109 virtual void estimationTypeChanged(int type); 00110 virtual void scheduleTypeChanged(int value); 00111 00112 private: 00113 Task &m_task; 00114 double m_dayLength; 00115 00116 Duration m_effort; 00117 Duration m_duration; 00118 }; 00119 00120 } //KPlato namespace 00121 00122 #endif // TASKGENERALPANEL_H