korganizer

koeditorgeneraltodo.h
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>
5 
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.
10 
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.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of TQt, and distribute the resulting executable,
22  without including the source code for TQt in the source distribution.
23 */
24 #ifndef _KOEDITORGENERALTODO_H
25 #define _KOEDITORGENERALTODO_H
26 
27 #include "koeditorgeneral.h"
28 #include "koglobals.h"
29 
30 #include <tqdatetime.h>
31 
32 class KRestrictedLine;
33 
34 class KDateEdit;
35 class KTimeEdit;
36 
37 namespace KCal {
38 class Todo;
39 }
40 using namespace KCal;
41 
42 class KOEditorGeneralTodo : public KOEditorGeneral
43 {
44  TQ_OBJECT
45 
46  public:
47  KOEditorGeneralTodo (TQObject* parent=0,const char* name=0);
48  virtual ~KOEditorGeneralTodo();
49 
50  void initTime(TQWidget *, TQBoxLayout *);
51  void iniStatus(TQWidget *, TQBoxLayout *);
52  void initCompletion(TQWidget *, TQBoxLayout *);
53  void initPriority(TQWidget *, TQBoxLayout *);
54 
55  void finishSetup();
56 
58  void setDefaults( const TQDateTime &due, bool allDay );
60  void readTodo( Todo *todo, Calendar *calendar, const TQDate &date );
62  void writeTodo(Todo *);
63 
65  bool validateInput();
66 
67  void updateRecurrenceSummary( Todo *todo );
68 
70  void modified( Todo *todo, KOGlobals::HowChanged modification );
71 
72  signals:
73  void dueDateEditToggle( bool );
74  void dateTimeStrChanged( const TQString & );
75  void signalDateTimeChanged( const TQDateTime &, const TQDateTime & );
76  void editRecurrence();
77 
78  protected slots:
79  void completedChanged( int );
80  void completedChanged();
81  void dateChanged();
82  void startDateModified();
83 
84  void enableDueEdit( bool enable );
85  void enableStartEdit( bool enable );
86  void enableTimeEdits( bool enable );
87 
88  protected:
89  void setCompletedDate();
90 
91  private:
92  bool mAlreadyComplete;
93  bool mStartDateModified;
94 
95  KDateEdit *mStartDateEdit;
96  KTimeEdit *mStartTimeEdit;
97  TQCheckBox *mTimeButton;
98  TQCheckBox *mDueCheck;
99  KDateEdit *mDueDateEdit;
100  KTimeEdit *mDueTimeEdit;
101  TQCheckBox *mCompletedToggle;
102  TQComboBox *mCompletedCombo;
103  TQLabel *mCompletedLabel;
104  TQLabel *mPriorityLabel;
105  TQComboBox *mPriorityCombo;
106 
107  KDateEdit *mCompletionDateEdit;
108  KTimeEdit *mCompletionTimeEdit;
109 
110  TQCheckBox *mStartCheck;
111 
112  TQDateTime mCompletedDateTime;
113 };
114 
115 
116 #endif