kplato

kpttaskdefaultpanel.h

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