kplato

kptstandardworktimedialog.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 KPTSTANDARDWORKTIMEDIALOG_H
00021 #define KPTSTANDARDWORKTIMEDIALOG_H
00022 
00023 #include "standardworktimedialogbase.h"
00024 #include "kptcalendar.h"
00025 
00026 #include <kdialogbase.h>
00027 
00028 #include <qstring.h>
00029 
00030 class KMacroCommand;
00031 
00032 namespace KPlato
00033 {
00034 
00035 class Project;
00036 class Part;
00037 
00038 class StandardWorktimeDialogImpl : public StandardWorktimeDialogBase {
00039     Q_OBJECT
00040 public:
00041     StandardWorktimeDialogImpl ( StandardWorktime *std, QWidget *parent);
00042 
00043     StandardWorktime *standardWorktime() { return m_std; }
00044     double inYear() const { return m_year; }
00045     double inMonth() const { return m_month; }
00046     double inWeek() const { return m_week; }
00047     double inDay() const { return m_day; }
00048     
00049 private slots:
00050     void slotCheckAllFieldsFilled();
00051     void slotEnableButtonOk(bool on);
00052 
00053     void slotYearChanged(double);
00054     void slotMonthChanged(double);
00055     void slotWeekChanged(double);
00056     void slotDayChanged(double);
00057     
00058 signals:
00059     void obligatedFieldsFilled(bool yes);
00060     void enableButtonOk(bool);
00061 
00062 private:
00063     StandardWorktime *m_std;
00064     double m_year;
00065     double m_month;
00066     double m_week;
00067     double m_day;
00068 };
00069 
00070 class StandardWorktimeDialog : public KDialogBase {
00071     Q_OBJECT
00072 public:
00073     StandardWorktimeDialog(Project &project, QWidget *parent=0, const char *name=0);
00074     
00075     KMacroCommand *buildCommand(Part *part);
00076 
00077 protected slots:
00078     void slotOk();
00079     
00080 private:
00081     Project &project;
00082     StandardWorktimeDialogImpl *dia;
00083     StandardWorktime *m_original;
00084 };
00085 
00086 } //KPlato namespace
00087 
00088 #endif // STANDARDWORKTIMEDIALOG_H
KDE Home | KDE Accessibility Home | Description of Access Keys