kplato
kptresourcedialog.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTRESOURCEDIALOG_H
00021 #define KPTRESOURCEDIALOG_H
00022
00023 #include "resourcedialogbase.h"
00024 #include "kptresource.h"
00025
00026 #include <kdialogbase.h>
00027
00028 #include <qmap.h>
00029 #include <qcombobox.h>
00030
00031 class KCommand;
00032
00033 class QTime;
00034 class QString;
00035
00036 namespace KPlato
00037 {
00038
00039 class Part;
00040 class Project;
00041 class Resource;
00042 class Calendar;
00043
00044 class ResourceDialogImpl : public ResourceDialogBase {
00045 Q_OBJECT
00046 public:
00047 ResourceDialogImpl (QWidget *parent);
00048
00049 public slots:
00050 void slotChanged();
00051 void slotCalculationNeeded(const QString&);
00052 void slotChooseResource();
00053
00054 signals:
00055 void changed();
00056 void calculate();
00057
00058 protected slots:
00059 void slotAvailableFromChanged(const QDateTime& dt);
00060 void slotAvailableUntilChanged(const QDateTime& dt);
00061 };
00062
00063 class ResourceDialog : public KDialogBase {
00064 Q_OBJECT
00065 public:
00066 ResourceDialog(Project &project, Resource *resource, QWidget *parent=0, const char *name=0);
00067
00068 bool calculationNeeded() { return m_calculationNeeded; }
00069
00070 Calendar *calendar() { return m_calendars[dia->calendarList->currentItem()]; }
00071 KCommand *buildCommand(Part *part = 0);
00072
00073 static KCommand *buildCommand(Resource *original, Resource &resource, Part *part);
00074
00075 protected slots:
00076 void enableButtonOk();
00077 void slotCalculationNeeded();
00078 void slotOk();
00079 void slotCalendarChanged(int);
00080
00081 private:
00082 Resource *m_original;
00083 Resource m_resource;
00084 ResourceDialogImpl *dia;
00085 bool m_calculationNeeded;
00086
00087 QMap<int, Calendar*> m_calendars;
00088 };
00089
00090 }
00091
00092 #endif
|