kplato

kpttaskgeneralpanel.h

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