krop's commit fixes my problem in a better way, reverting
[kdepim.git] / korganizer / koeditorgeneraltodo.h
blob72774190b70dbd57e532a0223409758a1fc9774e
1 /*
2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
24 #ifndef KOEDITORGENERALTODO_H
25 #define KOEDITORGENERALTODO_H
27 #include "koeditorgeneral.h"
29 namespace KCal {
30 class Todo;
32 using namespace KCal;
34 namespace KPIM {
35 class KDateEdit;
36 class KTimeEdit;
37 class KTimeZoneComboBox;
40 class KOEditorGeneralTodo : public KOEditorGeneral
42 Q_OBJECT
43 public:
44 explicit KOEditorGeneralTodo( Calendar *calendar, QObject *parent = 0 );
45 virtual ~KOEditorGeneralTodo();
47 void initTime( QWidget *, QBoxLayout * );
48 void initStatus( QWidget *, QBoxLayout * );
49 void initCompletion( QWidget *, QBoxLayout * );
50 void initPriority( QWidget *, QBoxLayout * );
52 void finishSetup();
54 /** Set widgets to default values */
55 void setDefaults( const QDateTime &due, bool allDay );
57 /** Read todo object and setup widgets accordingly */
58 void readTodo( Todo *todo, bool tmpl = false );
60 /** Write todo settings to event object */
61 void fillTodo( Todo * );
63 /** Check if the input is valid. */
64 bool validateInput();
66 /** The todo has been modified externally */
67 void modified ( Todo *, int );
69 signals:
70 void dueDateEditToggle( bool );
71 void dateTimeStrChanged( const QString & );
72 void signalDateTimeChanged( const QDateTime &, const QDateTime & );
74 protected slots:
75 void completedChanged(int);
76 void dateChanged();
77 void startDateModified();
79 void enableDueEdit( bool enable );
80 void enableStartEdit( bool enable );
81 void enableTimeEdits( bool enable );
82 void showAlarm();
84 protected:
85 void setCompletedDate();
86 virtual bool setAlarmOffset( Alarm *alarm, int value ) const;
88 private:
89 KPIM::KTimeZoneComboBox *mTimeZoneComboStart;
90 KPIM::KTimeZoneComboBox *mTimeZoneComboDue;
91 KDateTime::Spec mStartSpec;
92 KDateTime::Spec mDueSpec;
94 bool mAlreadyComplete;
95 bool mStartDateModified;
97 KPIM::KDateEdit *mStartDateEdit;
98 KPIM::KTimeEdit *mStartTimeEdit;
99 QCheckBox *mTimeButton;
100 QCheckBox *mDueCheck;
101 KPIM::KDateEdit *mDueDateEdit;
102 KPIM::KTimeEdit *mDueTimeEdit;
103 KComboBox *mCompletedCombo;
104 QLabel *mCompletedLabel;
105 QLabel *mPriorityLabel;
106 KComboBox *mPriorityCombo;
108 KPIM::KDateEdit *mCompletionDateEdit;
109 KPIM::KTimeEdit *mCompletionTimeEdit;
111 QCheckBox *mStartCheck;
113 QDateTime mCompleted;
116 #endif