KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kptresourcedialog.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* This file is part of the KDE project
  2. Copyright (C) 2003 - 2005 Dag Andersen <kplato@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation;
  6. version 2 of the License.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. * Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef KPTRESOURCEDIALOG_H
  17. #define KPTRESOURCEDIALOG_H
  18. #include "resourcedialogbase.h"
  19. #include "kptresource.h"
  20. #include <kdialogbase.h>
  21. #include <tqmap.h>
  22. #include <tqcombobox.h>
  23. class KCommand;
  24. class TQTime;
  25. class TQString;
  26. namespace KPlato
  27. {
  28. class Part;
  29. class Project;
  30. class Resource;
  31. class Calendar;
  32. class ResourceDialogImpl : public ResourceDialogBase {
  33. Q_OBJECT
  34. public:
  35. ResourceDialogImpl (TQWidget *parent);
  36. public slots:
  37. void slotChanged();
  38. void slotCalculationNeeded(const TQString&);
  39. void slotChooseResource();
  40. signals:
  41. void changed();
  42. void calculate();
  43. protected slots:
  44. void slotAvailableFromChanged(const TQDateTime& dt);
  45. void slotAvailableUntilChanged(const TQDateTime& dt);
  46. };
  47. class ResourceDialog : public KDialogBase {
  48. Q_OBJECT
  49. public:
  50. ResourceDialog(Project &project, Resource *resource, TQWidget *parent=0, const char *name=0);
  51. bool calculationNeeded() { return m_calculationNeeded; }
  52. Calendar *calendar() { return m_calendars[dia->calendarList->currentItem()]; }
  53. KCommand *buildCommand(Part *part = 0);
  54. static KCommand *buildCommand(Resource *original, Resource &resource, Part *part);
  55. protected slots:
  56. void enableButtonOk();
  57. void slotCalculationNeeded();
  58. void slotOk();
  59. void slotCalendarChanged(int);
  60. private:
  61. Resource *m_original;
  62. Resource m_resource;
  63. ResourceDialogImpl *dia;
  64. bool m_calculationNeeded;
  65. TQMap<int, Calendar*> m_calendars;
  66. };
  67. } //KPlato namespace
  68. #endif