kplato

kpttaskdefaultpanel.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation;
7 version 2 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPTTASKDEFAULTPANEL_H
21#define KPTTASKDEFAULTPANEL_H
22
23#include "kptconfigtaskpanelbase.h"
24#include "kptduration.h"
25
26class KMacroCommand;
27
28namespace KPlato
29{
30
31class Part;
32class Task;
33class StandardWorktime;
34
35class ConfigTaskPanelImpl : public ConfigTaskPanelBase
36{
37 TQ_OBJECT
38
39public:
40 ConfigTaskPanelImpl(TQWidget *parent, const char *name);
41
42 virtual int schedulingType() const;
43 virtual int estimationType() const;
44 virtual int optimistic() const;
45 virtual int pessimistic();
46 virtual Duration estimationValue();
47 virtual TQDateTime startDateTime();
48 virtual TQDateTime endDateTime();
49 virtual TQTime startTime() const;
50 virtual TQTime endTime();
51 virtual TQDate startDate();
52 virtual TQDate endDate();
53
54public slots:
55 virtual void setSchedulingType( int type );
56 virtual void changeLeader();
57 virtual void setEstimationType( int type );
58 virtual void setOptimistic( int value );
59 virtual void setPessimistic( int value );
60 virtual void enableDateTime( int scheduleType );
61 virtual void estimationTypeChanged( int type );
62 virtual void setEstimate( const Duration & duration );
63 virtual void setEstimateType( int type );
64 virtual void checkAllFieldsFilled();
65 virtual void setEstimateFields( int mask );
66 virtual void setEstimateScales( double day );
67 virtual void setEstimateFieldUnit( int field, TQString unit );
68 virtual void startDateChanged();
69 virtual void startTimeChanged( const TQTime & time );
70 virtual void endDateChanged();
71 virtual void endTimeChanged( const TQTime & time );
72 virtual void scheduleTypeChanged( int value );
73 virtual void setStartTime( const TQTime & time );
74 virtual void setEndTime( const TQTime & time );
75 virtual void setStartDateTime( const TQDateTime & dt );
76 virtual void setEndDateTime( const TQDateTime & dt );
77 virtual void setStartDate( const TQDate & date );
78 virtual void setEndDate( const TQDate & date );
79
80signals:
81 void obligatedFieldsFilled( bool );
82 void schedulingTypeChanged( int );
83 void changed();
84
85protected:
86 bool useTime;
87};
88
89class TaskDefaultPanel : public ConfigTaskPanelImpl {
90 TQ_OBJECT
91
92public:
93 TaskDefaultPanel(Task &task, StandardWorktime *workTime=0, TQWidget *parent=0, const char *name=0);
94
95 KMacroCommand *buildCommand(Part *part);
96
97 bool ok();
98
99 void setStartValues(Task &task, StandardWorktime *workTime=0);
100
101public slots:
102 virtual void estimationTypeChanged(int type);
103 virtual void scheduleTypeChanged(int value);
104
105private:
106 Task &m_task;
107 double m_dayLength;
108
109 Duration m_effort;
110 Duration m_duration;
111};
112
113} //KPlato namespace
114
115#endif // TASKDEFAULTPANEL_H